Skip to content

[ML] Disable auto-merge of backport PRs; merge only after CI is green#3114

Merged
edsavage merged 1 commit into
elastic:mainfrom
edsavage:fix/disable-backport-auto-merge
Jul 24, 2026
Merged

[ML] Disable auto-merge of backport PRs; merge only after CI is green#3114
edsavage merged 1 commit into
elastic:mainfrom
edsavage:fix/disable-backport-auto-merge

Conversation

@edsavage

Copy link
Copy Markdown
Contributor

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 --squash merges 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 resolvable ml-cpp-ci rollup 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:

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 --squash once a required status check gating the full build/test matrix exists on main/release branches (e.g. a Buildkite pipeline "one combined status per build" named ml-cpp-ci, made a required check). Tracked in #3099.

Fixes the premature-merge half of #3099.

Test plan

  • Merge a >bug PR carrying version + auto-backport labels.
  • Confirm backport PRs are opened, CI is triggered, and they receive a github-actions[bot] approval.
  • Confirm no auto-merge is armed (PRs stay open until a maintainer merges).

Made with Cursor

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>
@elasticsearchmachine

Copy link
Copy Markdown

Pinging @elastic/ml-core (Team:ML)

@edsavage
edsavage merged commit 3c2671d into elastic:main Jul 24, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants