[ML] Add auto-backport label for automatic backport PR merging#2947
Merged
edsavage merged 1 commit intoelastic:mainfrom Mar 8, 2026
Merged
[ML] Add auto-backport label for automatic backport PR merging#2947edsavage merged 1 commit intoelastic:mainfrom
edsavage merged 1 commit intoelastic:mainfrom
Conversation
When the original PR has the 'auto-backport' label: - The backport workflow enables GitHub auto-merge (squash) on the created backport PRs after they are created. - A new auto-approve-backports workflow auto-approves backport PRs opened by github-actions[bot] on version branches, satisfying the branch protection requirement for 1 approval. Without the 'auto-backport' label, backport PRs are created as before but require manual review and merge. Prerequisites: auto-merge must be enabled in the repo settings (Settings > General > Allow auto-merge). Made-with: Cursor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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
Adds an
auto-backportlabel that controls whether backport PRs are automatically merged after CI passes. This builds on PR #2940 (label copying and backport-pending tracking).How it works
Without
auto-backportlabel (default): Backport PRs are created as before, requiring manual review and merge.With
auto-backportlabel on the original PR:sorenlouv/backport-github-actionEnable auto-merge on backport PRsstep parses the created PR numbers from the backport log and enables GitHub auto-merge (squash) on each oneauto-approve-backports.ymlworkflow auto-approves backport PRs that:github-actions[bot]backport/auto-backportlabelbackport-pendinglabel is removed from the original PR (from PR [ML] Improve backport automation with label copying and pending tracking #2940)Prerequisites
Auto-merge must be enabled in the repo settings (Settings > General > Allow auto-merge). Currently it is disabled (
allow_auto_merge: false). A repo admin needs to toggle this on. Without it, thegh pr merge --autostep will emit a warning but not fail the workflow.Label
Created the
auto-backportlabel on the repo (color#692F45, matching elasticsearch's label).Comparison with other elastic repos
autoMerge: truein.backportrc.json+auto-approve-backports.ymlauto-backportlabel triggers auto-merge via workflow inputsauto-backportlabel exists but backport handled by external infraauto-backportlabel on original PR → auto-merge + auto-approve on backport PRsTest plan
auto-backport— verify backport PRs are created but NOT auto-mergedauto-backport— verify backport PRs get auto-merge enabled and auto-approvedbackport-pendingis removed from the original PR after all backports mergeMade with Cursor