Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[mergify] backport automation to 7.x, 7.12 and 7.11 #24608
[mergify] backport automation to 7.x, 7.12 and 7.11 #24608
Changes from 2 commits
da361cc
edc1caa
bab54e9
254b2dd
840d99a
c1238b8
bf22c7e
ff1eaca
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
How exactly will the labels work?
a. If we are about to release 7.12.0, I might want to use the label
v7.12.1
, in order to postpone the backport for after the release is out. Will we update the version filter here after a release? If so, will my PR automatically backported when we update the label filter here?b. Will my PR be backported if I add
v7.12.0
even after lets say 7.12.1 was released? (Although it might be a bit confusing to users looking at the PR labels to figure out if a bug fix is available)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.
I'll answer your questions in a minute, for clarity, the initial proposal was to use the existing labels
vmajor.minor.0
(see #24576 (comment))Yes,
mergify
works for even PRs which were not backported after the merge, as long as the label is added. In addition you can use thegithub comment
=@Mergifyio backport <destination> will backport this PR on <destination> branch
To illustrate the above, I just tagged elastic/apm-pipeline-library#1053 with the explicit label and elastic/apm-pipeline-library#1056 was created. NOTE: for some reason the timestamp for the label does not match with when I did it, (about 7 minutes ago instead of 2 days...)
Yes, backports with mergify don't know about releases but branches and labels.
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.
if the mergify config is updated with that branch before you merge the PR, the PR would backported.
the backport is made on a new PR when you merge the fixed PR, if the labels and mergify configuration are in place when you merge, a new PR is made to every branch that you requested backport with the labels.
There is an alternative way to make the backports manually using a GitHub comment (see https://docs.mergify.io/commands.html#backport)
https://mergify.io/features/backports
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.
Maybe to clarify case a:
v7.12.0
is setv7.12.1
to my PR (because of FF I don't want the change be backported yet)v7.12.0
orv7.12.1
is set.After step 5, will my old PR be picked up automatically or am I required to remember that I did have a 2 weeks old PR that I must now 'manually' backport by adding a comment to the PR (or remove + add label again).
Case b is a little unfortunate as labels do not necesarrily reflect reality, but well, it's the way it is.
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.
this happens after you merge the PR, mergify does not review old merged PRs, so the backport is not made. In this case, you have to manually backport the PR, either from the PR with a GiHub Comment or as you make now from your laptop.
However, if we detect changes on the mergify configfile can trigger something that reviews all PRs with the new label and make backport mergify comments on those PRs, but this is something not out of the box. We have to see if this use case exists and how many times it happens, then we can evaluate the effort and the value of this process.
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.
AFAIK if you fix something in branch 7.12 that has the version 7.12.0 this will be in the 7.12 branch (the same major.minor) that will contain the version 7.12.1 (different patch), so in the case you put as an example there is no backport.
I can see a case similar of what you explain between minor versions, but in those case you use the branch
7.x
and then you backport to7.12
,7.11
, ... in those cases the branch already exists so the backport is made.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.
To help to unblock this 🧵
Since there is no backport automation in place for this project I see the benefits of enabling it for facilitating the backporting process, but I don't know if it could cause any issues. Although,
mergify
requires certain discipline regarding what labels should be added.Do you think if we enable
mergify
it will help with the backporting? Or is it required to solve all of the above-mentioned use cases?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.
I don't think either behavior is a blocker and adding mergify is an improvement either way. As we have to document the backport process in our how to guides. I'm trying to figure out how it works and where we have potential gotchas that we should document as well. I did just bring up the two cases as we've seen them from time to time in the past: label does not match actual release + us holding of with backport in order to target the next patch release... cough... kafka ... cough.
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.
Wouldn't it be easier to ask the user to use a tool for this? Either running mergify locally or backport.
In Kibana we help the user like this:
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.
good point. I don't know what's the tool the team have in place for that, in order to be be tool-agnostic the message provides the git commands to solve it locally.
I'll keep a note to iterate on this and make the user experience smooth. Thanks for the feedback :)
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.
Most people use the
dev-tools/cherry-pick-pr
tool in the Beats repo it seems. But a few contributors use the nodejs backport tool. Both are supported. For the changelog we have a 'requirement' on the PR title to properly link to the original PR, so we can find unique PRs and double check if these features are really released (github tags can be missleading). Both tools are supported by our changelog scripts. Using custom git commands might be a problem if the title is not properly formatted (unless we add another lint check on the PR title for backports).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.
We can then iterate with the existing tools, the current comment intends to help with fixing the just created backport PR that has got some conflicts, so we might need to think about that particular use case. I'll keep a note for the upcoming iterations