Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newly added packages update all issues and prs in the history #90

Open
esatterwhite opened this issue Nov 30, 2021 · 11 comments
Open

Newly added packages update all issues and prs in the history #90

esatterwhite opened this issue Nov 30, 2021 · 11 comments

Comments

@esatterwhite
Copy link
Contributor

esatterwhite commented Nov 30, 2021

when a new packages is added to an existing monorepo the initial release of the package results in adding the release success comment on every PR/Issue before it.

The commits aren't filtered. It updates months worth of Pull requests + Issues, and GitHub sends out dozens of email notifications

It seems something went wrong here.
https://github.com/semantic-release/github/blob/d70e766d275b856dbe95f48358dcb9e6025748a7/lib/success.js#L43

  } else {
    const parser = issueParser('github', githubUrl ? {hosts: [githubUrl]} : {});
    const releaseInfos = releases.filter((release) => Boolean(release.name));
    const shas = commits.map(({hash}) => hash);

    const searchQueries = getSearchQueries(`repo:${owner}/${repo}+type:pr+is:merged`, shas).map(
      async (q) => (await github.search.issuesAndPullRequests({q})).data.items
    );

We need to debug this point to make sure, that only filtered commits are passed to plugin method.

Originally posted by @antongolub in #41 (comment)

@esatterwhite
Copy link
Contributor Author

esatterwhite commented Nov 30, 2021

The logs out put this on a new package › ℹ Found 233 commits since last release
There should not be any commits since the last release - there wasn't one for a new package

@esatterwhite
Copy link
Contributor Author

There look to be a couple of places the success hook could be called

https://github.com/semantic-release/semantic-release/blob/b64855fc57e2ab5ded02ddc939fc369ef082ec84/index.js#L134

    } else {
      const commits = await getCommits({...context, lastRelease, nextRelease});
      nextRelease.notes = await plugins.generateNotes({...context, commits, lastRelease, nextRelease});

      if (options.dryRun) {
        logger.warn(`Skip ${nextRelease.gitTag} tag creation in dry-run mode`);
      } else {
        await addNote({channels: [...currentRelease.channels, nextRelease.channel]}, nextRelease.gitHead, {cwd, env});
        await push(options.repositoryUrl, {cwd, env});
        await pushNotes(options.repositoryUrl, {cwd, env});
        logger.success(
          `Add ${nextRelease.channel ? `channel ${nextRelease.channel}` : 'default channel'} to tag ${
            nextRelease.gitTag
          }`
        );
      }

      context.branch.tags.push({
        version: nextRelease.version,
        channel: nextRelease.channel,
        gitTag: nextRelease.gitTag,
        gitHead: nextRelease.gitHead,
      });

      const releases = await plugins.addChannel({...context, commits, lastRelease, currentRelease, nextRelease});
      context.releases.push(...releases);
      await plugins.success({...context, lastRelease, commits, nextRelease, releases});
    }

and

https://github.com/semantic-release/semantic-release/blob/b64855fc57e2ab5ded02ddc939fc369ef082ec84/index.js#L201

  const releases = await plugins.publish(context);
  context.releases.push(...releases);

  await plugins.success({...context, releases});

the first one isn't passing the commits array that is on the context object. If I had to take a wild guess, its probably happening there

@esatterwhite
Copy link
Contributor Author

@antongolub this one is really rather problematic. Any chance you might be able to look at this?

@antongolub
Copy link
Collaborator

@esatterwhite,

Ok, I will dig this issue next week, but I cannot promise a quick fix. We really have a lot of work to do right now, sorry.

@esatterwhite
Copy link
Contributor Author

@antongolub friendly check in 😄

@antongolub
Copy link
Collaborator

antongolub commented Feb 19, 2022

My recipe for success in GTD is procrastination and multitasking
:((

@esatterwhite
Copy link
Contributor Author

Any traction here? Everytime I add a new package everyone in my org gets hammered with 500 emails. I'm also worries that this is going to kill out git hub access throu CI and we will start getting rate limited wich would break the build process for every project in the org

@esatterwhite
Copy link
Contributor Author

@antongolub re-nudge.

@antongolub
Copy link
Collaborator

@esatterwhite

I'm so sorry, but I have no resources left for volunteer projects at this moment. Hope that someone else will be able to continue this work.

@esatterwhite
Copy link
Contributor Author

I'm so sorry, but I have no resources left for volunteer projects at this moment. Hope that someone else will be able to continue this work.

how about now? 😄

@antongolub
Copy link
Collaborator

I'm afraid, the situation with available time is only getting worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants