[ML] Disable auto-merge of backport PRs; merge only after CI is green#3114
Merged
Merged
Conversation
Release branches do not require the ml-cpp build/test matrix, so arming auto-merge (gh pr merge --auto) merged backports as soon as the light required checks (CLA, labels, snyk) passed -- before the C++ build/test build finished. Keep authoring backports with the ephemeral token (so CI runs) and approving them (so the required review is satisfied), but stop arming auto-merge. A maintainer merges each backport once its CI is green. Re-enable auto-merge once a required status check gating the full build and test matrix is in place. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Pinging @elastic/ml-core (Team:ML) |
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
Prioritise safety: backport PRs should only merge after a successful CI build (automatically or by a human). Until a required status check gates the full build/test matrix, this disables the auto-merge arming in the backport workflow.
Problem
The release branches' protection rules do not require the ml-cpp build/test checks. So
gh pr merge --auto --squashmerges a backport as soon as the lightweight required checks (CLA,Check labels, snyk) pass — before the C++ build/test matrix finishes. That's exactly how the #3080/#3081 backports (#3106–#3111) auto-merged mid-build, one with a failing build step.We also confirmed that flipping
set_commit_status: true(#3112) does not by itself produce a resolvableml-cpp-cirollup status in this pipeline (only per-step contexts are published), so there is currently nothing safe to mark as a required check.Change
The final workflow step still:
github-actions[bot](so the org "require 1 review" ruleset is satisfied),but it no longer arms auto-merge. Each backport is left as a one-click merge for a maintainer once its CI build is green.
No behaviour change to backport creation or CI triggering — only the automatic merge is removed.
Re-enabling auto-merge later
Re-add
gh pr merge --auto --squashonce a required status check gating the full build/test matrix exists onmain/release branches (e.g. a Buildkite pipeline "one combined status per build" namedml-cpp-ci, made a required check). Tracked in #3099.Fixes the premature-merge half of #3099.
Test plan
>bugPR carrying version +auto-backportlabels.github-actions[bot]approval.Made with Cursor