[ML] Automate patch version bump in CI pipeline#3030
[ML] Automate patch version bump in CI pipeline#3030edsavage wants to merge 2 commits intoelastic:mainfrom
Conversation
✅ 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. |
Widen ml-cpp-version-bump branch_configuration for PR elastic#3030 smoke tests; revert to main-only after validation. Made-with: Cursor
The temporary ml-cpp-version-bump branch_configuration change is proposed separately so PR elastic#3030 stays focused on the bump automation. Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
This PR updates the ML CI “version bump” pipeline from a stubbed/manual flow to an automated patch-version bump workflow that (1) notifies Slack, (2) bumps elasticsearchVersion on a target branch, and (3) optionally polls published artifact JSON until the expected versions appear.
Changes:
- Add
dev-tools/bump_version.shto bumpelasticsearchVersion(and update.backportrc.jsonwhen targetingmain) with optionalDRY_RUN=true. - Add a dedicated Buildkite pipeline YAML generator for Slack notifications in the version-bump pipeline.
- Update
.buildkite/job-version-bump.json.pyto run the bump step and then poll staging/snapshot artifact JSON viaelastic/json-watcher.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
dev-tools/bump_version.sh |
New automation script to bump elasticsearchVersion, commit, and push (with DRY_RUN support). |
.buildkite/pipelines/send_slack_version_bump_notification.sh |
New pipeline snippet generator to configure Slack notifications specifically for version bump runs. |
.buildkite/job-version-bump.json.py |
Replaces the old stub/block flow with bump + (optional) artifact polling steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Pinging @elastic/ml-core (Team:ML) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a558843 to
46c5b73
Compare
Widen ml-cpp-version-bump branch_configuration for PR elastic#3030 smoke tests; revert to main-only after validation. Made-with: Cursor
The temporary ml-cpp-version-bump branch_configuration change is proposed separately so PR elastic#3030 stays focused on the bump automation. Made-with: Cursor
46c5b73 to
9293f24
Compare
Replace the ml-cpp-version-bump stub with a two-phase Buildkite flow. Phase 1 (job-version-bump.json.py): validate_version_bump_params.sh on Wolfi (patch-only rules; optional git fetch re-check when enabled), then version_bump_upload_phase2.sh uploads phase 2 only when work remains (step conditionals cannot rely on build meta-data). Phase 2 (job-version-bump-phase2.json.py): bump_version.sh bumps elasticsearchVersion on a ci/ml-cpp-version-bump-* topic branch, pushes, opens a PR via GitHub CLI (ensure_github_cli.sh, create_github_pull_request.sh), defaults to gh pr merge --auto --squash, optional immediate merge and VERSION_BUMP_MERGE_ADMIN; records meta-data for no-op and PR URL. Slack step (send_slack_version_bump_notification.sh) uses Wolfi and step notify. DRA wait (wait_version_bump_dra.py) skips on DRY_RUN or when validation/bump report no change. Adds dev-tools/unittest for validation and pipeline JSON. Does not modify .backportrc.json (reserved for future release automation). Minor version bumps stay a follow-up change. Co-authored-by: Cursor <cursoragent@cursor.com>
9293f24 to
25e681c
Compare
|
Cleanup (2026-05-07): Commit history was squashed to a single commit ( |
- Reject leading/trailing whitespace in version_bump_validation; trim NEW_VERSION/BRANCH in shell after env read - Use temp-file sed rewrite in bump_version.sh for BusyBox/GNU/BSD portability - wait_version_bump_dra: fail when buildkite-agent missing or meta-data get errors; treat exit 1 + not-found stderr as missing key - Verify gh tarball against official gh_*_checksums.txt before install - Require --body in create_github_pull_request.sh; extend pipeline unit tests Co-authored-by: Cursor <cursoragent@cursor.com>
|
Copilot follow-up (pushed
Pytest: |
Summary
Automates patch
elasticsearchVersionbumps for ml-cpp via the ml-cpp-version-bump Buildkite pipeline: validate parameters, optionally run the bump (topic branch + GitHub PR + merge), notify Slack, then wait for DRA artifacts. Minor version bumps remain out of scope for a follow-up change.Dev-tools Python tests for this work run under the existing dev-tools pytest PR check (see #3052); this PR does not add duplicate pytest wiring in
format_and_validation.yml.sh.What changed (current tree)
Two-phase pipeline (Buildkite meta-data limitation)
Phase 1 —
.buildkite/job-version-bump.json.pydev-tools/validate_version_bump_params.shon Wolfi): patch-only rules,WORKFLOW=patch,NEW_VERSION/BRANCHchecks, optionalgit fetch+ Python re-validation after pull when enabled.NEW_VERSION).dev-tools/version_bump_upload_phase2.sh): uploads phase 2 only when Slack / bump / DRA work should run (stepifcannot depend on meta-data per Buildkite docs).Phase 2 —
.buildkite/job-version-bump-phase2.json.py(uploaded above)dev-tools/bump_version.sh: topic branchci/ml-cpp-version-bump-*, commitgradle.properties, push,gh pr create, defaultgh pr merge --auto --squash, optional immediate merge, optionalVERSION_BUMP_MERGE_ADMIN. Sets meta-dataml_cpp_version_bump_changedandml_cpp_version_bump_pr_url(non-empty URL only; Buildkite rejects empty values).DRY_RUN=trueskips push/PR/merge. Does not edit.backportrc.json..buildkite/pipelines/send_slack_version_bump_notification.sh: Wolfi image (sobuildkite-agentmeta-data works), step-levelnotifyso the message is not blocked on build end; link to the opened PR when present.dev-tools/wait_version_bump_dra.py: long poll; skipped whenDRY_RUNor when validation/bump indicated no-op / no PR opened.Supporting scripts
dev-tools/create_github_pull_request.sh+dev-tools/ensure_github_cli.sh— install/useghon Wolfi for PR create/merge.dev-tools/version_bump_validation.py— shared rules used by validate shell + pytest..buildkite/pipelines/send_version_bump_notification.sh— drop obsolete Workflow line from legacy blocked/finished Slack templates.Tests
dev-tools/unittest/test_version_bump_validation.py— validation behaviour (opt-in git integration viaVERSION_BUMP_GIT_INTEGRATION).dev-tools/unittest/test_job_version_bump_pipeline.py— JSON shape / env wiring for both pipeline generators.History / review note (2026-05-07)
Prior 32 exploratory commits were squashed into one for review (
25e681cd8onfeature/version-bump-patch-only). Net diff vsmainis unchanged aside from dropping a stray blank line informat_and_validation.yml.shthat had no functional effect.Labels
Please keep
:mland appropriate version labels for backport automation when merging.