-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
[IMP] add nobump option for 'merge' command. Make bumpversion_mode re… #110
Conversation
fafaadc
to
092f98d
Compare
The towncrier commit should not be in this PR. |
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.
Also don't forget newsfragments/90.feature
Hi @sbidoul thanks for your review. |
8d061ed
to
6b425f2
Compare
@sbidoul : Now ready for review. Thanks ! |
Side question. i was thinking to add a |
605fe3a
to
6adad5b
Compare
Hi @sbidoul. Thanks for your help. -> I revert the refactor of the -> I reverted also the changes that makes the branch name pattern changed. -> I just kept the possible values to I let the fixup commit, to make more easy to read the diff. Ping me if all is OK, and if you want me to squach before merging. |
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.
One last question: what happen if people forget the new required "nobump" options?
If it fails silently, user will not understand why their command does nothing.
So we probably want to report a GitHub comment to avoid too much support headaches with the change.
raise RequiredOptionError( | ||
self.name, "bumpversion_mode", self.bumpversion_mode_list | ||
) | ||
if len(options) == 1 and options[0] in self.bumpversion_mode_list: | ||
self.bumpversion_mode = options[0] |
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.
Nitpick I would have done this to avoid changing the rest of the code. No big deal though.
self.bumpversion_mode = options[0] | |
if options[0] != 'nobump': | |
self.bumpversion_mode = options[0] |
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.
Yes I get it. You're right, diff could be lighter.
The problem I see with such implementation is for developpers. IMO,
- if option is optional, the developer expect that bumpversion_mode is in
["major", "minor", "patch", None]
- if option is required, the developer expects that bumpversion_mode is in
["major", "minor", "patch", "nobump"]
I so implemented that point with such design. If it's a blocking point, I revert, no problem.
Nice catch ! In fact, it's not a problem of that PR, it's a general limitation of this bot. For the time being, if we write I so tried that changes, I set in a PR against my PR :
I propose you to include this feature in that current PR. It breaks "the one feature per fragment" law, but I think that it should merge together, and the second feature depends on the first one. Do you like it ? Let me know ! |
@legalsylvain nice error messages, it's a great improvement, thanks. I made a couple of comments on the implementation over there. |
Hi @sbidoul. I took into account your remarks :
kind regards. |
01f7020
to
b82b2ae
Compare
@sbidoul. I took into account your remarks and squashed fixup! commits. could you take a look, and merge if all is OK ? Thanks ! |
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.
@legalsylvain thanks for your work on this.
One last thing: could you add the error comment in a task
named, e.g. add_pr_comment
. Similar to what is done in on_pr_open_mention_maintainer
. The reason we want to do that is that the tasks have a built-in retry mechanism in case we hit the GitHub rate limit. Another reason is that the webhooks are based on the gidgethub library which is using asyncio, while the rest is based on the github3 library which uses synchronous IOs.
f6c3e26
to
c7e1298
Compare
578e3ce
to
6b92e1f
Compare
Hi @sbidoul. |
Hi @sbidoul. Do you have some time to finish the review and merge this PR ? |
LGTM. Thanks for this @legalsylvain! Now we'll need to communicate to the contributors before deploying. |
Thanks ! |
@sbidoul : Done here : https://odoo-community.org/groups/contributors-15/contributors-160206?mode=thread Please answer to that mail, when you update in production the ocabot. Thanks for your time. |
nobump
for the optionbumpversion_mode
of the commandmerge
bumpversion_mode
required. (close Add nobump option to ocabot merge #90)