Open dagood opened 3 years ago
Here's what I have in mind for this. A pipeline that runs periodically (or you can trigger it) that will:
base:microsoft/main
and the Backport
label.Needs Backport Bot Followup
. If one exists, then:
Backported {version}
to each PR listed in the PR description.Needs Backport Bot Followup
from the merged/closed PR.Backported {version}
tag.
{version}
". Include the list of PRs being ported in the PR description. Add the tag Needs Backport Bot Followup
.Backport
label and also one Backported {version}
label for every release branch, remove the PR's Backport
label, because it's done.That's what I come up with when I avoid external databases and webhooks and aim for something that primarily works well for infra changes.
There's probably more needed to make it work well for other situations, like backporting FIPS fixes or other feature work. (E.g. if you make a fix PR on 1.16, you probably want to cherry-pick it to 1.15, 1.14, etc. The change probably won't apply to 1.17 or 1.18, so the bot shouldn't even attempt it. Or, maybe you make a fix to 1.18 that you know applies to 1.17, but is inapplicable to <= 1.16 because the feature being fixed didn't exist yet.) I'm not sure which of these scenarios will end up mattering. If we end up maintaining only two release branches like upstream Go, we probably don't need to worry about this.
@microsoft/golang-compiler Does this sound roughly reasonable?
The alert issues I mentioned should be done for the upstream sync and go-docker updates, too. It just seems more important here, because we can't just retry a cherry-pick and hope it works next time.
We talked about this again in today's sync. Now that we're using submodules, we can use git merges!
The process would be this:
microsoft/main
.git merge-base 1.16 1.17
, apply the patches at that point onto the Go source code, examine the diff from there to latest 1.16
, and apply that diff onto 1.17
.A cherry-pick-only approach is still valid, but merges make it a lot easier to trace fixes through all branches.
This is what a complete merge flow might look like:
(Note the boring branches merging from two places... the idea is that 1.17-boring should be up to date with all boring-specific changes from 1.16-boring as well as version-specific changes from 1.17.)
When someone has to manually resolve conflicts, we can put a safeguard in place for bad submodule updates. A PR CI job can check whether the current PR is a merge PR (bot author, matching title) and make sure the submodule commit is not changed. Submodules are a little more awkward to handle than normal files, so some protection against mistakes will be helpful.
As of writing (starting to add release branch infra: https://github.com/microsoft/go/issues/128), it seems that the most reasonable way to apply infra fixes from
microsoft/main
onto release branches is cherry-picking. A few ideas to improve that process:Automate the cherry-picks.
Periodically copy all build infra files from
microsoft/main
to all release branches.Make "fake" merges that carry infrastructure changes but ignore changes from the upstream commits.