Skip to content

[ML] Apply required team and type labels to automated version-bump PRs - #3136

Merged
edsavage merged 3 commits into
elastic:mainfrom
edsavage:fix/version-bump-pr-team-type-labels
Aug 5, 2026
Merged

[ML] Apply required team and type labels to automated version-bump PRs#3136
edsavage merged 3 commits into
elastic:mainfrom
edsavage:fix/version-bump-pr-team-type-labels

Conversation

@edsavage

@edsavage edsavage commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

The automated patch version-bump PRs (e.g. #3135) were opened with only the ci:skip-es-tests label, 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 create call in dev-tools/bump_version.sh (alongside the existing ci: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.sh et al.) via version_bump_snapshot_helpers, and only then checks out the target release-branch tip. The running bump_version.sh is main's copy (its open file descriptor survives the checkout) and it invokes the snapshotted main helper. So the label list here runs for every release-branch patch bump regardless of what that branch's own dev-tools/ contains — this is exactly the design #3083 introduced. No backport labels required.

Test plan

  • bash -n dev-tools/bump_version.sh passes
  • New guard test test_bump_version_pr_applies_required_labels asserts the --label values are wired in; test_job_version_bump_pipeline.py green (15 passed)
  • Next automated patch bump opens its PR carrying :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)

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

Copy link
Copy Markdown

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :ml and >build labels to the PR creation command in dev-tools/bump_version.sh.
  • Add a unit test asserting the required --label flags are present in bump_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.

Comment thread dev-tools/bump_version.sh
Comment thread dev-tools/unittest/test_job_version_bump_pipeline.py Outdated
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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@edsavage
edsavage enabled auto-merge (squash) August 5, 2026 03:41
@edsavage
edsavage disabled auto-merge August 5, 2026 03:41
@edsavage
edsavage merged commit e0f5f89 into elastic:main Aug 5, 2026
24 checks passed
@edsavage

Copy link
Copy Markdown
Contributor Author

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.

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.

3 participants