[ML] Improve backport automation with label copying and pending tracking#2940
Merged
edsavage merged 2 commits intoelastic:mainfrom Mar 8, 2026
Merged
[ML] Improve backport automation with label copying and pending tracking#2940edsavage merged 2 commits intoelastic:mainfrom
edsavage merged 2 commits intoelastic:mainfrom
Conversation
- Add copySourcePRLabels to copy labels like >bug and :ml from the original PR to backport PRs, excluding backport and version labels to avoid recursive triggers. - Add sourcePRLabels to apply a backport-pending label to the original PR when backports are created, making it easy to filter PRs that still need backport attention. 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. |
When a backport PR (labelled 'backport') is merged, extract the original PR number from the title, check if any sibling backport PRs are still open, and remove the backport-pending label from the original PR once all backports are complete. Made-with: Cursor
edsavage
added a commit
to edsavage/ml-cpp
that referenced
this pull request
Mar 8, 2026
Trivial whitespace change to test the backport workflow improvements from PR elastic#2940 (copySourcePRLabels, sourcePRLabels, and automatic backport-pending removal). This commit will be reverted after testing. Made-with: Cursor
edsavage
added a commit
that referenced
this pull request
Mar 8, 2026
Trivial whitespace change to test the backport workflow improvements from PR #2940 (copySourcePRLabels, sourcePRLabels, and automatic backport-pending removal). This commit will be reverted after testing. Made-with: Cursor
edsavage
added a commit
that referenced
this pull request
Mar 8, 2026
Trivial whitespace change to test the backport workflow improvements from PR #2940 (copySourcePRLabels, sourcePRLabels, and automatic backport-pending removal). This commit will be reverted after testing. Made-with: Cursor (cherry picked from commit 0df84a6) Co-authored-by: Ed Savage <ed.savage@elastic.co>
edsavage
added a commit
that referenced
this pull request
Mar 8, 2026
Trivial whitespace change to test the backport workflow improvements from PR #2940 (copySourcePRLabels, sourcePRLabels, and automatic backport-pending removal). This commit will be reverted after testing. Made-with: Cursor (cherry picked from commit 0df84a6) Co-authored-by: Ed Savage <ed.savage@elastic.co>
4 tasks
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
Improves the backport automation with three changes based on feedback from PR #2917:
copySourcePRLabels(.backportrc.json): Copies labels from the original PR to backport PRs using a regex that excludesbackportandv*version labels (to avoid recursive backport triggers). Labels like>bug,>enhancement,:mlwill now appear on backport PRs automatically.sourcePRLabels(.backportrc.json): Adds abackport-pendinglabel to the original PR when backport PRs are created, making it easy to filter which PRs still need backport attention.Automatic
backport-pendingremoval (backport.yml): When a backport PR is merged, a newremove-backport-pendingjob extracts the original PR number from the title, checks if all sibling backport PRs are also merged/closed, and removes thebackport-pendinglabel from the original PR if none remain open. This completes the full lifecycle — no manual label removal needed.How it works
Test plan
>bug/:mllabels>bugand:mllabels copiedbackport-pendinglabel addedbackportandv*labels are NOT copied to backport PRsbackport-pendingremains on the original PRbackport-pendingis removed from the original PR