-
Notifications
You must be signed in to change notification settings - Fork 686
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: make backport.py
more flexible for complex pull requests
#7260
base: develop
Are you sure you want to change the base?
Conversation
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, it LGTM; the one change I'm asking for is if can we mention the skipped commits in the PR body.
branch = f"backport-{args.pr}" | ||
base = f"release/{args.version}" | ||
remote = args.remote | ||
subprocess.check_call(["git", "fetch", remote]) | ||
subprocess.check_call(["git", "checkout", "-b", branch, f"{remote}/{base}"]) | ||
subprocess.check_call(["git", "cherry-pick", "-x"] + [commit["sha"] for commit in commits]) | ||
subprocess.check_call(["git", "cherry-pick", "-x"] + commit_hashes) | ||
if input("OK to push and create PR? [y/N]").lower() != "y": | ||
sys.exit() | ||
subprocess.check_call(["git", "push", "-u", remote, branch]) |
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.
In the message body below, let's mention the skipped commits? E.g. Only contains changes from #{args.pr}, except {commits}.
?
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.
Good idea. Added in 234d5bf, but do let me know if you see a nicer way to build up the conditional skip_message
without fancier templating.
9b3123e
to
234d5bf
Compare
For example, Weblate-side merge commits from "develop" require "git cherry-pick -m" and therefore can't be merged en masse even if we wanted their contents.
Otherwise only the first 30 commits are returned.
Co-authored-by: Kunal Mehta <legoktm@debian.org>
234d5bf
to
ae00ff7
Compare
Currently blocked on #7339. |
Status
Ready for review
Description of Changes
The much-loved
backport.py
script makes 2.5 assumptions that do not hold for complex pull requests like #7143, which we fix here:gh api
) in the pull request.git cherry-pick -x
(i.e., there are no merge commits requiringgit [cherry-pick → merge] -m
).Testing
Depending on the state of your local
release/2.10.1
branch, you can replicate #7257 with:Deployment
Development-only; no deployment considerations.