[ML] Skip backport for minor-freeze version bump PRs#3070
Open
edsavage wants to merge 2 commits into
Open
Conversation
Minor-freeze Leg B PRs are labeled vX.Y.0 by elasticsearchmachine and update .backportrc.json in the same merge, which caused the backport workflow to open spurious PRs onto the new release branch (e.g. elastic#3069 after elastic#3068). Co-authored-by: Cursor <cursoragent@cursor.com>
✅ 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. |
|
Pinging @elastic/ml-core (Team:ML) |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the repository’s automated backporting behavior to avoid creating incorrect backport PRs when the minor-freeze version bump on main is merged (a commit that should remain main-only but may carry release-version labels).
Changes:
- Add a
no-backportlabel to the PR created bydev-tools/bump_main_minor_freeze.sh. - Update the Backport GitHub Actions workflow to skip when
no-backportis present (and also when the title contains(minor freeze)). - Add unit tests to guard the workflow skip conditions and the bump script’s label application.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
dev-tools/unittest/test_backport_workflow.py |
Adds tests that assert the workflow and bump script contain the backport-skip mechanisms. |
dev-tools/bump_main_minor_freeze.sh |
Ensures minor-freeze PRs get a no-backport label when created. |
.github/workflows/backport.yml |
Skips running the backport job for PRs labeled no-backport (and those with (minor freeze) in the title). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replace the broad `(minor freeze)` title-substring fallback with a head.ref check keyed off the automation topic branch (ci/ml-cpp-minor-freeze-main-*) so unrelated PRs that merely mention a minor freeze are not skipped. Make the guard-rail tests tolerant of whitespace/quote-style changes via regex. Co-authored-by: Cursor <cursoragent@cursor.com>
3 tasks
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
After the 9.5 minor freeze, merging #3068 (Leg B main bump to 9.6.0) triggered the automatic backport workflow and opened spurious #3069 onto branch
9.5. That PR would have incorrectly bumped the release branch to 9.6.0; it has been closed without merging.This happens because:
elasticsearchmachinelabels minor-freeze PRs with the release version (e.g.v9.5.0)targetBranchChoicesin.backportrc.jsonbranchLabelMappingrule then backports the main-only freeze commit onto the new release branchThis will recur on every minor freeze unless we skip backport for these automation PRs.
Changes
no-backportlabel to minor-freeze PRs opened bybump_main_minor_freeze.shci/ml-cpp-minor-freeze-main-*)The
no-backportlabel already exists on the repo.Test plan
python3 -m pytest dev-tools/unittest/test_backport_workflow.py -vdev-tools pyteststep passesno-backportand does not spawn a spurious backport PRManual verification
After this PR merges to
main— backport skip smoke testNo need to wait for the next minor freeze. Once #3070 is on
main:main(e.g. a trivial dev-tools comment) with:no-backport, a version label (e.g.v9.6.0),:ml,>testifis false).backportlabel referencing the test PR.This reproduces the #3068 → #3069 failure mode (version label on a main-only change) without running the version-bump pipeline. Revert or close the test PR afterward.
On the next production minor freeze
When release-eng triggers
ml-cpp-version-bumpwithWORKFLOW=minoragain:bump_main_minor_freeze.shshould include theno-backportlabel and be created from aci/ml-cpp-minor-freeze-main-*branch.Note: sandbox refs (
testing-*) skip Leg B in CI, so they cannot be used for a full Leg B label E2E test.Review notes
Addressed Copilot feedback:
(minor freeze)title-substring fallback with a head-ref check on the automation topic branch (ci/ml-cpp-minor-freeze-main-*) so unrelated PRs mentioning a minor freeze in their title are not skipped.backport.ymlvia regex.