[CI] Gate main merges on backports and release-branch unit tests - #6670
Draft
Mikaayenson wants to merge 2 commits into
Draft
[CI] Gate main merges on backports and release-branch unit tests#6670Mikaayenson wants to merge 2 commits into
Mikaayenson wants to merge 2 commits into
Conversation
Wait for auto-backports to land and tip Unit Tests to pass before the next main merge, using one merge-queue-safe check instead of per-branch status jobs.
Replace the per-branch required checks with release-line-caught-up instead of leaving the old workflow around for cutover.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
We only merge to
main. Backport automation then pushes to the release branches, and Unit Tests run on those pushes. Another PR should not merge until that has succeeded.Today's required checks (
branch-status-checks (8.19)and the 9.x jobs) fail while those tests are still running. They can also pass against the previous tip if the new backport has not pushed yet.release-line-caught-upis a single check. It stays pending until the currentmaincommit is backported to every target and Unit Tests on those tips have succeeded. Then it goes green. If backport or tests fail, or if that has not happened within 28 minutes, it goes red.Merge queues
GitHub's merge queue needs a stable required check that runs on
merge_group, and it needs that check to stay pending while work is still in flight. The old matrix jobs fail immediately when tip CI is running, so queue entries get ejected. They also report as separate check names (branch-status-checks (8.19), and so on), which you have to keep in sync with the target branch list.With this change, the queue serializes on the previous main merge:
release-line-caught-upjob looks atorigin/main(A) and stays pending.backport.ymlsetsrelease-line-caught-upsuccess on A's merge SHA.If A's backport or tip tests fail, B's check goes red and the queue stops until that release line is fixed. Throughput is one main merge per backport-and-test cycle. That is the same rule we already have; the queue just waits instead of failing at t=0.
buildandbuild-and-validatealso run onmerge_group, so the other required checks exist for queue entries.Changes
branch-status-checks.yml.backport.ymlwrites arelease-line-caught-upcommit status on the merge SHA after all targets are done (push, nothing to cherry-pick, orbackport: skip).pull_requestandmerge_groupformain.build,build-and-validate, andcode-checksalso run onmerge_group.manual-backport.yml.Before this can merge
Those old check names will not run on this PR. On
mainbranch protection:branch-status-checks (8.19),(9.3),(9.4),(9.5)release-line-caught-upCLA,build, andbuild-and-validateUntil the first status exists,
release-line-caught-upfalls back to waiting for green Unit Tests on the current release tips. After this merges, later PRs wait on the commit status.Turn on the merge queue after this PR is in
main.Test plan
branch-status-checks (*)required checks so this PR is not stuck waiting for jobs that no longer existrelease-line-caught-uppasses on this PR (tip Unit Tests fallback)release-line-caught-upstatus once release-branch Unit Tests passrelease-line-caught-upstays pending until backports finish, then passes