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

Enable backport automation with mergify #143

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
pull_request_rules:
- name: ask to resolve conflict
conditions:
- conflict
actions:
comment:
message: |
This pull request is now in conflicts. Could you fix it @{{author}}? 🙏
Copy link
Member Author

Choose a reason for hiding this comment

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

author won't be resolved correctly -> Mergifyio/mergify#1096

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
This pull request is now in conflicts. Could you fix it @{{author}}? 🙏
This pull request is now in conflicts. Could you fix it? 🙏

To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/
```
git fetch upstream
git checkout -b {{head}} upstream/{{head}}
git merge upstream/{{base}}
git push upstream {{head}}
```
- name: backport patches to 7.x branch
conditions:
- base=master
- label=v7.13.0
Copy link
Member Author

Choose a reason for hiding this comment

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

We will need some automation in the future to bump the version when required

Copy link
Contributor

Choose a reason for hiding this comment

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

Just so I am sure I understand how this works. If we set the v7.13.0 on the PR, it will be auto backported?

Copy link
Member Author

Choose a reason for hiding this comment

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

Exactly, but only when it gets merged.

To illustrate the above, please see the below example for one of the repositories where this service is configured:

  1. Avoid cache gsutils temporary location apm-pipeline-library#994 contains the label backport-to-7.x (that's what we are using in that particular repo), and was merged.
  2. A mergify action was triggered -> https://github.com/elastic/apm-pipeline-library/runs/1920298071
  3. Avoid cache gsutils temporary location (bp #994) apm-pipeline-library#995 was created afterwards

Copy link
Contributor

Choose a reason for hiding this comment

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

Great!

actions:
backport:
branches:
- 7.x
- name: backport patches to 7.12 branch
conditions:
- base=master
- label=v7.12.0
actions:
backport:
branches:
- 7.12