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

Filter PR/Issue that should get a comment on success #359

Closed
balazsorban44 opened this issue Apr 23, 2021 · 3 comments · Fixed by #874
Closed

Filter PR/Issue that should get a comment on success #359

balazsorban44 opened this issue Apr 23, 2021 · 3 comments · Fixed by #874
Labels

Comments

@balazsorban44
Copy link

balazsorban44 commented Apr 23, 2021

First I would like to describe my problem, and try to come with a suggestion:
Originally posted at: semantic-release/semantic-release#1603
but posting here as it seems more fit:

so to get our prerelease (next) branch up-to-date, I did as you suggested, and merged our main/latest branch into it. Now semantic-release sent out a comment to ALL minor bugfix issues/PRs made to the main - those have already been closed and released - when it published a new next release 👀. Is it possible to avoid that somehow? Those changes have already been released, why semantic-release is so eager to comment/send out notifications on those again? 😕
It now generated over 100 comments on already closed/handled issues, and I have no idea why. 😢
Will those be re-released a third time now when I merge them back to main? 😨
The repo in question: https://github.com/nextauthjs/next-auth
Our config is fairly simple:

"release": {
 ​"branches": [
   ​"+([0-9])?(.{+([0-9]),x}).x",
   ​"main",
   ​{
     ​"name": "beta",
     ​"prerelease": true
   ​},
   ​{
     ​"name": "next",
     ​"prerelease": true
   ​}
 ​]
},

Is there any configuration that could prohibit semantic-release to dig up already closed/merged labeled/commented issues/PRs, and only comment/label those that haven't been done so before? 🤔

If currently there is no way of achieving this, here is my suggestion:

I studied the following file:

https://github.com/semantic-release/github/blob/master/lib/success.js

And it would be nice to have an option to filter the issues/prs, before sending out a comment, something like this:

successFilter: (pr) => !pr.labels.some(label => label.name.includes("released"))

This should restrict the PRs to only those that don't have a label yet containing "released"

Ref: https://docs.github.com/en/rest/reference/search#search-issues-and-pull-requests

@markov00
Copy link

markov00 commented Nov 3, 2021

Any update on this? It becomes really annoying in particular in some cases like the following elastic/elastic-charts#1108 (comment)
where we have dozen of successful release comments
I saw the #360 PR I hope it can go through and be merged soon, if not we should probably just disable the successComment as a workaround
Thanks

@JonasSchubert
Copy link
Contributor

I have opened a PR in the gitlab project with a different approach, utilizing the lodash template. This is based on an idea by @fgreinacher.
It allows to use the successComment without introducing further configuration and can by quiet powerful.
Maybe it can be used in this project to, in case it will be approved for the gitlab plugin to keep the projects similar.

Copy link

github-actions bot commented Sep 2, 2024

🎉 This issue has been resolved in version 10.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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