Skip to content
New issue

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

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

Already on GitHub? # to your account

Combine issues/PRs comments into one #41

Open
bubkoo opened this issue Nov 2, 2020 · 6 comments
Open

Combine issues/PRs comments into one #41

bubkoo opened this issue Nov 2, 2020 · 6 comments

Comments

@bubkoo
Copy link

bubkoo commented Nov 2, 2020

Each release add a comment to the related issue and pr. Combine the comments into one making a better life.

image

@bubkoo bubkoo changed the title Combine issues/PRs comments into one comment Combine issues/PRs comments into one Nov 2, 2020
@antongolub
Copy link
Collaborator

Yep, this is really annoying. As a temporary workaround we just recommend to disable github plugin comments.

module.exports = {
  branch: 'master',
  plugins: [
    '@semantic-release/commit-analyzer',
    '@semantic-release/release-notes-generator',
    '@semantic-release/changelog',
    '@semantic-release/npm',
    [
      '@semantic-release/github',
      {
        successComment: false,
        failComment: false
      }
    ],
    '@semantic-release/git'
  ]
}

@esatterwhite
Copy link
Contributor

esatterwhite commented Nov 30, 2021

This is probably related to the same underlying issue. I notice that when a new packages is added to an existing monorepo the initial release of the package results addeding the release success comment on every PR/Issue before it.

Like the commits aren't filtered. It updates months worth of prs and GitHub sends out dozens of email notifications

@esatterwhite
Copy link
Contributor

esatterwhite commented Nov 30, 2021

Is this what the --first-parent option aims to solve?

@antongolub
Copy link
Collaborator

@esatterwhite,

--first-parent is used to filter commits by release branch only (master, main).

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.

@esatterwhite
Copy link
Contributor

@antongolub Making a new issue so this doesn't get lost

@antongolub
Copy link
Collaborator

image

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

No branches or pull requests

3 participants