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

[#290] ci: Add github action to cherry-pick the PR automatically based on label #293

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

jerryshao
Copy link
Contributor

What changes were proposed in this pull request?

This PR adds the support of creating a cherry-pick PR against the specified branch based on the label.

Why are the changes needed?

With this, we don't have to manually create a new PR against different branches when we need to do a cherry-pick.

Fix: #290

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Local test.

@jerryshao jerryshao added need backport Issues that need to backport to another branch branch-0.1 labels Aug 29, 2023
@jerryshao jerryshao self-assigned this Aug 29, 2023
@github-actions
Copy link

Code Coverage Report

Overall Project 61.24% 🟢

There is no coverage information present for the Files changed

cherry_pick_branch_0_1:
runs-on: ubuntu-latest
name: Cherry pick into branch_0.1
if: ${{ contains(github.event.pull_request.labels.*.name, 'branch-0.1') && github.event.pull_request.merged == true }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does GitHub robot support wildcard or multiply branches? I'm afraid that there would be the scenario that we need to back port MRs to many release branches.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not worked here to use wildcard, because we need to specify the target branch name anyhow in Line22:

          branch: branch-0.1
          labels: |
            cherry-pick

Also see the docs, if we need to backport to multiple branches, then we need to add specific actions https://github.com/marketplace/actions/github-cherry-pick-action

Besides, IMO I don't like this to be too flexible, which will easily be error-prone.

Copy link
Member

Choose a reason for hiding this comment

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

It would be nice if wildcards were supported.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds reasonable. Another problem, Will we back port all MRs to previous release branches? I see no filter conditions to discharge unnecessary MRs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only PRs with label specified will be cherry-picked to different branches. Also, it is cherry-picking, not merge, so only the one commit will be backported.

@jerryshao
Copy link
Contributor Author

@xunliu @yuqi1129 do you have any further comment?

@yuqi1129
Copy link
Contributor

@xunliu @yuqi1129 do you have any further comment?

I notice that you have labeled this PR as 'need backport', Is this just a flag that represents we should back port to previous release versions Or GitHub robot depend on the keyword to do backport automatically?

@jerryshao
Copy link
Contributor Author

"need backport" is only for us, not for github action. Github action only checks the label "branch-0.1"

@yuqi1129
Copy link
Contributor

"need backport" is only for us, not for github action. Github action only checks the label "branch-0.1"

I see, It's OK for me

Copy link
Contributor

@yuqi1129 yuqi1129 left a comment

Choose a reason for hiding this comment

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

LGTM

@jerryshao jerryshao merged commit b69d459 into apache:main Aug 29, 2023
2 checks passed
github-actions bot pushed a commit that referenced this pull request Aug 29, 2023
…d on label (#293)

### What changes were proposed in this pull request?

This PR adds the support of creating a cherry-pick PR against the
specified branch based on the label.

### Why are the changes needed?

With this, we don't have to manually create a new PR against different
branches when we need to do a cherry-pick.

Fix: #290 

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Local test.
github-actions bot pushed a commit that referenced this pull request Aug 29, 2023
…d on label (#293)

### What changes were proposed in this pull request?

This PR adds the support of creating a cherry-pick PR against the
specified branch based on the label.

### Why are the changes needed?

With this, we don't have to manually create a new PR against different
branches when we need to do a cherry-pick.

Fix: #290 

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Local test.
github-actions bot pushed a commit that referenced this pull request Aug 29, 2023
…d on label (#293)

### What changes were proposed in this pull request?

This PR adds the support of creating a cherry-pick PR against the
specified branch based on the label.

### Why are the changes needed?

With this, we don't have to manually create a new PR against different
branches when we need to do a cherry-pick.

Fix: #290 

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Local test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need backport Issues that need to backport to another branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement] Support using Github App to automatically cherry pick to different branches
3 participants