-
Notifications
You must be signed in to change notification settings - Fork 893
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
add script and doc for cherry_pick_pull #1216
Conversation
bcd3760
to
dec29b9
Compare
➜ karmada git:(script-cherry-pick-pull) ./hack/cherry_pick_pull.sh
./hack/cherry_pick_pull.sh <remote branch> <pr-number>...: cherry pick one or more <pr> onto <remote branch> and leave instructions for proposing pull request
Checks out <remote branch> and handles the cherry-pick of <pr> (possibly multiple) for you.
Examples:
./hack/cherry_pick_pull.sh upstream/release-3.14 12345 # Cherry-picks PR 12345 onto upstream/release-3.14 and proposes that as a PR.
./hack/cherry_pick_pull.sh upstream/release-3.14 12345 56789 # Cherry-picks PR 12345, then 56789 and proposes the combination as a single PR.
Set the DRY_RUN environment var to skip git push and creating PR.
This is useful for creating patches to a release branch without making a PR.
When DRY_RUN is set the script will leave you in a branch containing the commits you cherry-picked.
Set UPSTREAM_REMOTE (default: upstream) and FORK_REMOTE (default: origin)
to override the default remote names to what you have locally.
For merge process info, see https://github.com/karmada-io/karmada/blob/master/docs/userguide/cherry-picks.md
➜ karmada git:(script-cherry-pick-pull) DRY_RUN=true ./hack/cherry_pick_pull.sh upstream/release-1.0 1206
You are not logged into any GitHub hosts. Run gh auth login to authenticate.
➜ karmada git:(script-cherry-pick-pull) gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Paste an authentication token
Tip: you can generate a Personal Access Token here https://github.com/settings/tokens
The minimum required scopes are 'repo', 'read:org', 'workflow'.
? Paste your authentication token: ****************************************
- gh config set -h github.com git_protocol https
✓ Configured git protocol
✓ Logged in as carlory
➜ karmada git:(script-cherry-pick-pull) ./hack/cherry_pick_pull.sh upstream/release-1.0 1206
github.com
✓ Logged in to github.com as carlory (/Users/dijun/.config/gh/hosts.yml)
✓ Git operations for github.com configured to use https protocol.
✓ Token: *******************
+++ Updating remotes...
Fetching upstream
Fetching origin
+++ Creating local branch automated-cherry-pick-of-#1206-upstream-release-1.0-1641377057
Branch 'automated-cherry-pick-of-#1206-upstream-release-1.0-1641377057' set up to track remote branch 'release-1.0' from 'upstream'.
Switched to a new branch 'automated-cherry-pick-of-#1206-upstream-release-1.0-1641377057'
+++ Downloading patch to /tmp/1206.patch (in case you need to do this again)
+++ About to attempt cherry pick of PR. To reattempt:
$ git am -3 /tmp/1206.patch
Applying: remove unreachable code
+++ I'm about to do the following to push to GitHub (and I'm assuming origin is your personal fork):
git push origin automated-cherry-pick-of-#1206-upstream-release-1.0-1641377057:automated-cherry-pick-of-#1206-upstream-release-1.0
+++ Proceed (anything but 'y' aborts the cherry-pick)? [y/n] y
Enumerating objects: 11, done.
Counting objects: 100% (11/11), done.
Delta compression using up to 4 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 515 bytes | 515.00 KiB/s, done.
Total 6 (delta 4), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
remote:
remote: Create a pull request for 'automated-cherry-pick-of-#1206-upstream-release-1.0' on GitHub by visiting:
remote: https://github.com/carlory/karmada/pull/new/automated-cherry-pick-of-%231206-upstream-release-1.0
remote:
To https://github.com/carlory/karmada.git
* [new branch] automated-cherry-pick-of-#1206-upstream-release-1.0-1641377057 -> automated-cherry-pick-of-#1206-upstream-release-1.0
+++ Creating a pull request on GitHub at carlory:automated-cherry-pick-of-#1206-upstream-release-1.0
Creating pull request for carlory:automated-cherry-pick-of-#1206-upstream-release-1.0 into release-1.0 in karmada-io/karmada
https://github.com/karmada-io/karmada/pull/1217
+++ Returning you to the script-cherry-pick-pull branch and cleaning up. |
#1217 is created by the |
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 @carlory .
Signed-off-by: carlory <[email protected]>
dec29b9
to
6538d4d
Compare
/cc @RainbowMango |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind documentation
/kind feature
What this PR does / why we need it:
As release-1.0 published, we need a script to backport some PRs from master to release branches.
Does this PR introduce a user-facing change?: