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

GitHub Action to automatically create backport PRs #4678

Merged

Conversation

waiting-for-dev
Copy link
Contributor

Summary

This commit integrates the backport-github-action GitHub Action.

It automatically creates PRs for the branches specified via labels on another PR. For instance, if a PR to master has the following labels:

  • Needs Backport
  • Needs Backport-v3.2
  • Needs Backport-v3.1

It'll create two other PRs, cherry-picking the commits on v3.2 and v3.1 branches. The action is triggered whenever:

  • A PR with those labels is merged
  • A closed PR has those labels added

After the action runs, the "parent" PR is updated with a status report, informing of any encountered error (e.g., merge conflicts).

We've chosen this action over the Backporting action because the former has support for PRs containing multiple commits, which corresponds to our current flow. At the same time, the latter only works with single-commit PRs.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

  • I have written a thorough PR description.
  • I have kept my commits small and atomic.
  • I have used clear, explanatory commit messages.

The following are not always needed (cross them out if they are not):

  • [ ] I have added automated tests to cover my changes.
  • [ ] I have attached screenshots to demo visual changes.
  • [ ] I have opened a PR to update the guides.
  • [ ] I have updated the readme to account for my changes.

This commit integrates the backport-github-action [1] GitHub Action.

It automatically creates PRs for the branches specified via labels on
another PR. For instance, if a PR to master has the following labels:

- Needs Backport
- Needs Backport-v3.2
- Needs Backport-v3.1

It'll create two other PRs, cherry-picking the commits on v3.2 and v3.1
branches. The action is triggered whenever:

- A PR with those labels is merged
- A closed PR has those labels added

After the action runs, the "parent" PR is updated with a status report,
informing of any encountered error (e.g., merge conflicts).

We've chosen this action over the Backporting [2] action because the
former has support for PRs containing multiple commits, which
corresponds to our current flow. At the same time, the latter only works
with single-commit PRs.

1 - https://github.com/sqren/backport-github-action
2 - https://github.com/marketplace/actions/backporting
@waiting-for-dev waiting-for-dev added the type:enhancement Proposed or newly added feature label Oct 18, 2022
@kennyadsl
Copy link
Member

Screenshot 2022-10-18 at 17 56 59@2x

Copy link
Member

@jarednorman jarednorman left a comment

Choose a reason for hiding this comment

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

So this rules

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

This is super nice!

Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

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

thanks @waiting-for-dev , this is super cool!

@waiting-for-dev waiting-for-dev merged commit 5f628dd into solidusio:master Oct 20, 2022
@waiting-for-dev waiting-for-dev deleted the waiting-for-dev/automatic_backport branch October 20, 2022 03:30
@tvdeyen
Copy link
Member

tvdeyen commented Nov 23, 2022

This is 💯

@waiting-for-dev waiting-for-dev added the changelog:repository Changes to the repository not within any gem label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:repository Changes to the repository not within any gem type:enhancement Proposed or newly added feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants