-
Notifications
You must be signed in to change notification settings - Fork 81
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
feat: allow to skip success and fail comments based on provided condition #730
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
afc7ccf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
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? |
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 |
Yes, that sounds like a good plan! I'm not entirely sure whether |
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. |
Good point, I agree we should align success and fail comments. What about |
Alternatively we can just make a single |
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. |
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? |
@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. |
@JonasSchubert Great, thanks a ton! Let's go on with 1b (separate options) then! |
summery sounds good, 1b is good with me, thank you 👍🏼 |
afc7ccf
to
327b847
Compare
327b847
to
2a6eaf9
Compare
2a6eaf9
to
29b2a3a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Co-authored-by: Gregor Martynus <[email protected]>
Co-authored-by: Gregor Martynus <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 📦🚀 |
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 |
Hi @fgreinacher and wow! Thanks for the kind words. I am honored and yes I would be interested. |
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! |
Welcome @JonasSchubert to the team, awesome to have more people here 🥳 |
Could solve #480 and #636. This is based on the idea of @fgreinacher here.
I added documentation with some highlighting on how to use this functionality and provided some unit tests.
I introduced a new variable
defaultComment
to ease up the filtering for issues and merge requests, but keeping the default comment message.semantic-release/github
has 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.