Skip to content
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

Merged
merged 1 commit into from
Jan 8, 2022

Conversation

carlory
Copy link
Member

@carlory carlory commented Jan 5, 2022

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?:

add a script and document for cherry-pick pull

@karmada-bot karmada-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. labels Jan 5, 2022
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 5, 2022
@carlory carlory force-pushed the script-cherry-pick-pull branch 2 times, most recently from bcd3760 to dec29b9 Compare January 5, 2022 09:55
@carlory
Copy link
Member Author

carlory commented Jan 5, 2022

➜  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.

@carlory
Copy link
Member Author

carlory commented Jan 5, 2022

#1217 is created by the hack/cherry_pick_pull.sh script

@carlory carlory changed the title [WIP] add script and doc for cherry_pick_pull add script and doc for cherry_pick_pull Jan 5, 2022
@karmada-bot karmada-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 5, 2022
@carlory
Copy link
Member Author

carlory commented Jan 5, 2022

/cc @RainbowMango @kevin-wangzefeng

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @carlory .

@carlory carlory force-pushed the script-cherry-pick-pull branch from dec29b9 to 6538d4d Compare January 8, 2022 06:27
@carlory
Copy link
Member Author

carlory commented Jan 8, 2022

/cc @RainbowMango

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 8, 2022
@karmada-bot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 8, 2022
@karmada-bot karmada-bot merged commit 90f0832 into karmada-io:master Jan 8, 2022
@carlory carlory deleted the script-cherry-pick-pull branch July 13, 2022 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants