[ML] Apply required team and type labels to automated version-bump PRs - #3136
Conversation
The automated patch version-bump PRs only carried ci:skip-es-tests, so a human had to add the mandatory team (:ml) and type (>build, >non-issue) labels by hand (e.g. elastic#3135). Pass them from bump_version.sh so the PRs open compliant, and add a guard test. Co-authored-by: Cursor <[email protected]>
|
Pinging @elastic/ml-core (Team:ML) |
Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR updates the automated patch version-bump workflow so that created PRs are policy-compliant on open by applying the mandatory team (:ml) and type (>build) labels in addition to the existing ci:skip-es-tests label.
Changes:
- Add
:mland>buildlabels to the PR creation command indev-tools/bump_version.sh. - Add a unit test asserting the required
--labelflags are present inbump_version.sh.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| dev-tools/bump_version.sh | Adds required :ml and >build labels to automated patch bump PR creation. |
| dev-tools/unittest/test_job_version_bump_pipeline.py | Adds a guard test ensuring the required --label arguments are wired into bump_version.sh. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Apply the required :ml and >build labels in bump_main_minor_freeze.sh so the automated minor-freeze bump PR opens policy-compliant, matching bump_version.sh. Make the label guard test tolerant of quoting style and extend it to cover both bump scripts so neither can regress. Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
dev-tools/unittest/test_job_version_bump_pipeline.py:208
- The helper claims “no quotes” is harmless, but for labels that begin with
>(e.g.>build) an unquoted form would be interpreted by the shell as redirection and break the script. Also, a safe refactor to backslash-escape the label (\>build) would currently fail this guard. Consider requiring escape for leading->labels while still allowing unquoted forms for other labels.
Tolerates double quotes, single quotes, or no quotes so a harmless requote
of the argument doesn't fail the guard while the behaviour is unchanged.
"""
pattern = rf"--label\s+(?:\"{re.escape(label)}\"|'{re.escape(label)}'|{re.escape(label)})(?:\s|\))"
return re.search(pattern, script) is not None
|
Test-plan status (2026-08-10): the post-merge verification items here are pending the next automated version bump — none has run since this merged (the last bump, #3135 for 9.5.1, was on 2026-08-04, before this landed). Not forgotten; they'll be exercised and confirmed on the next bump. |
Summary
The automated patch version-bump PRs (e.g. #3135) were opened with only the
ci:skip-es-testslabel, so a human still had to hand-apply the mandatory team label (:ml) and a type label (>build) before the PR was policy-compliant.This wires those labels into the
gh pr createcall indev-tools/bump_version.sh(alongside the existingci:skip-es-tests), so the bump PRs open compliant with no manual step.Why main-only (no backport)
The version-bump pipeline starts from
main, snapshots the helper scripts (create_github_pull_request.shet al.) viaversion_bump_snapshot_helpers, and only then checks out the target release-branch tip. The runningbump_version.shismain's copy (its open file descriptor survives the checkout) and it invokes the snapshottedmainhelper. So the label list here runs for every release-branch patch bump regardless of what that branch's owndev-tools/contains — this is exactly the design #3083 introduced. No backport labels required.Test plan
bash -n dev-tools/bump_version.shpassestest_bump_version_pr_applies_required_labelsasserts the--labelvalues are wired in;test_job_version_bump_pipeline.pygreen (15 passed):ml,>build,ci:skip-es-tests(pending next automated version bump — per the Elastic release schedule the next patch cycle is 8.19.21 / 9.4.6: Feature Freeze Tue 25 Aug 2026, GA Tue 01 Sep 2026; then 9.5.2 FF 8 Sep 2026)