Uh oh!
There was an error while loading. Please reload this page.
feat: allow to skip success and fail comments based on provided condition - #730
Conversation
I like it a lot, thanks for picking it up @JonasSchubert! It's a very flexible approach that does not add much complexity to the code base. @travi@gr2m Any objections on going this way? Would probably be quite easy to handle it the same way in the GitHub plugin (see also semantic-release/github#359 (comment)) |
51cd64f to
afc7ccfCompare
gr2m
left a comment
There was a problem hiding this comment.
I think the pull request and the feature is great, thank you!
Just one question: it seems that the new defaultComment is meant to do two things
- decide whether to comment at all based on custom logic
- customize the comment itself?
In your examples you always use the <%= defaultComment %> placeholder, wrapped in an if condition. Wouldn't it make more sense to introduce an option like commentCondition in which we can just put in the condition string, using the lodash template syntax?
Thanks for the review @gr2m! It is already possible to disable commenting by statically setting the
|
gr2m
commented
Jun 11, 2024
Sorry if I miss something obvious, but why not do an option like |
We could certainly also do that! My only small concern is that we then have two ways two disable the success comment:
But it's probably not a big issue if we manage to describe it properly :) @JonasSchubert WDYT about this idea? |
gr2m
commented
Jun 11, 2024
independent of what we have today, what would the ideal arguments look like? We shouldn't be afraid of breaking things, it's better than ending up with arguments that are unnecessary complicated due to legacy reasons. Maybe we could deprecate the possibility of setting |
fgreinacher
commented
Jun 12, 2024
Yes, that sounds like a good plan! I'm not entirely sure whether |
JonasSchubert
commented
Jun 13, 2024
Sounds like a good idea to separate the responsibilities of these configuration options. 👍 We had at least three attempts to filter success comments now (semantic-release/github#360, #678 and this PR) and this suggestion sounds reasonable. Should this then also be changed for the A proper description is definitely needed, but from experience I know description and documentation might not be read by everybody. 😏 This is why I think we have to make it as understandable as possible without the need for too much documentation. |
fgreinacher
commented
Jun 13, 2024
Good point, I agree we should align success and fail comments. What about |
gr2m
commented
Jun 13, 2024
Alternatively we can just make a single |
fgreinacher
commented
Jun 14, 2024
I also thought about that, but in the end the reasons for skipping a success comment are quite different from the reasons for skipping a fail comment. The former is usually done to reduce noise, e.g. not spamming irrelevant MRs. The later should IMO only be done in exceptional situations, e.g. when the issue tracker is disabled. I therefore believe mixing both would increase complexity unnecessarily. |
travi
commented
Jun 14, 2024
sorry for my slow responses here. the last few weeks have been especially crazy for me. i appreciate the callout to this detail. i think this is the biggest consideration for me. like @gr2m, i'm open to breakages to get to an api we are comfortable with and think solves the problem well, but would like to make sure we take both github and gitlab into consideration with that design. i still hope that we can eventually extract some of the common behaviors to a more "git-host core" like package to reduce some of the duplication, but that is something that likely is a bit further into the future still. |
Thanks for all your comments! Let me summarize:
@JonasSchubert Now that the scope has grown a bit are you still willing to work on it? |
JonasSchubert
commented
Jun 20, 2024
@fgreinacher I would still be willing to work on it, yes. As soon as we agreed on the way forward I will adjust my PR. I would then also prefer 1.b. as 1.a. will be very complex to configure for the end user. |
fgreinacher
commented
Jun 20, 2024
@JonasSchubert Great, thanks a ton! Let's go on with 1b (separate options) then! |
gr2m
commented
Jun 20, 2024
summery sounds good, 1b is good with me, thank you 👍🏼 |
afc7ccf to
327b847Compare327b847 to
2a6eaf9CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
2a6eaf9 to
29b2a3aCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
fgreinacher
left a comment
There was a problem hiding this comment.
Thanks a ton for the rework @JonasSchubert and thanks for your patience.
I like it a lot, just some smaller thoughts.
Co-authored-by: Florian Greinacher <florian@greinacher.de>
gr2m
left a comment
There was a problem hiding this comment.
Just found two typos, other than that this is good to go!
And just making sure, we do not introduce breaking changes, only log a deprecation warning?
Thank you all again for putting so much thought and work into making this feature great
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
fgreinacher
left a comment
There was a problem hiding this comment.
Really great work @JonasSchubert, I love it!
🎉 This issue has been resolved in version 13.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
fgreinacher
commented
Jul 9, 2024
Hey @JonasSchubert, we noticed that you have been super active here for quite some time now and brought in multiple high-quality and impactful contributions. We'd therefore like to invite you as an additional maintainer for the GitLab plugin. Would that be interesting for you? /cc @travi |
JonasSchubert
commented
Jul 11, 2024
Hi @fgreinacher and wow! Thanks for the kind words. I am honored and yes I would be interested. |
travi
commented
Jul 12, 2024
thanks for the help, @JonasSchubert! i've invited you to our gitlab team |
Thanks a lot @travi . Appreciate all your work and I am happy to be psrt of the team! |
fgreinacher
commented
Jul 12, 2024
Welcome @JonasSchubert to the team, awesome to have more people here 🥳 |
Could solve #480 and #636. This is based on the idea of @fgreinacherhere.
I added documentation with some highlighting on how to use this functionality and provided some unit tests.
I introduced a new variable
defaultCommentto ease up the filtering for issues and merge requests, but keeping the default comment message.semantic-release/githubhas at least one PR which shall have the same result, but is a different approach. I like the templating idea @fgreinacher brought up and think this would be a good solution there too - also to keep the plugins similar.I am aware that this project has an open PR. As there was no update since February I took the liberty to create this one, hope this is ok for you @Hakihiro.