[ML] Automate version bump in CI pipeline#3018
Open
edsavage wants to merge 3 commits intoelastic:mainfrom
Open
[ML] Automate version bump in CI pipeline#3018edsavage wants to merge 3 commits intoelastic:mainfrom
edsavage wants to merge 3 commits intoelastic:mainfrom
Conversation
Replace the manual block step in the version-bump pipeline with an automated step that: 1. Checks out the target branch 2. Updates elasticsearchVersion in gradle.properties to $NEW_VERSION 3. Commits as elasticsearchmachine 4. Pushes directly to the branch (no PR needed) Follows the same pattern as Elasticsearch's automated Lucene snapshot updates (.buildkite/scripts/lucene-snapshot/update-es-snapshot.sh). The Fetch DRA Artifacts step now depends on the bump step, ensuring the version is updated before polling for artifacts at the new version. 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. |
Adds a DRY_RUN=true option that performs all steps (checkout, sed, commit) but skips the final git push. Useful for testing the pipeline and for local verification. Also makes sed portable across macOS/Linux and uses local git config instead of --global. Made-with: Cursor
Extends the version bump script and pipeline to support the minor release workflow (feature freeze day) in addition to patch bumps. Script changes (bump_version.sh): - Accepts WORKFLOW env var: 'patch' (default) or 'minor' - Minor workflow: creates a new minor branch from BRANCH (e.g., 9.4 from main inheriting current version), then bumps BRANCH to NEW_VERSION (the next minor) - Exports MINOR_BRANCH and MINOR_VERSION via Buildkite meta-data for downstream steps - Idempotent: skips branch creation if it already exists on remote - Refactored into reusable helpers (git_push, sed_inplace, configure_git, bump_version_on_branch) Pipeline changes (job-version-bump.json.py): - Reads WORKFLOW env var at pipeline generation time - Patch: 1 bump step + 1 DRA step (2 artifact checks) — unchanged - Minor: 1 bump step + 2 parallel DRA steps (upstream + minor branch, 4 artifact checks total covering staging + snapshot for both branches) - Minor branch name/version derived from NEW_VERSION at generation time (e.g., NEW_VERSION=9.5.0 → minor branch 9.4, version 9.4.0) - Refactored DRA step generation into helper functions Tested locally with DRY_RUN=true on a throwaway branch: - Minor workflow correctly creates branch, bumps upstream - Patch workflow backward-compatible - Unknown workflow rejected with clear error Made-with: Cursor
Contributor
Author
Status checklistConsolidated tracker for this PR against the Version Bump Automation PSI spec. Core functionality
Pipeline / DRA artifact verification
Branch protection
Testing
Spec items not yet addressed
Not applicable to ml-cpp
|
Contributor
|
@edsavage Just to get context: is this needed for the new automated version-bump orchestration strategy? |
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
Replaces the manual block step in the version-bump pipeline with automated version bump logic, supporting both patch and minor release workflows.
Patch workflow (
WORKFLOW=patch, default)$BRANCH, updateselasticsearchVersioningradle.propertiesto$NEW_VERSION, commits aselasticsearchmachine, pushesMinor workflow (
WORKFLOW=minor, feature freeze day)$BRANCH(e.g.,mainat9.4.0→ branch9.4), pushes it (inherits the current version)$BRANCH(e.g.,main) to$NEW_VERSION(e.g.,9.5.0), commits, pushes$NEW_VERSIONstaging + snapshotPattern
Follows the established Elasticsearch repo pattern for automated commits from CI:
elasticsearchmachine/infra-root+elasticsearchmachine@elastic.coas committergit config(not--global)git diff-index --quiet HEADfor idempotencygit pull --ff-onlybefore push to handle concurrent commitsScript features
DRY_RUN=true— performs all steps exceptgit pushsed -i(macOS/Linux)git_push,sed_inplace,configure_git,bump_version_on_branchWORKFLOWvalues rejected with clear errorMINOR_BRANCH/MINOR_VERSIONvia Buildkite meta-data for downstream stepsPipeline features
WORKFLOWenv var selects pipeline shape at generation timeNEW_VERSION(e.g.,9.5.0→9.4branch,9.4.0version)Files
dev-tools/bump_version.sh— standalone script with patch + minor support.buildkite/job-version-bump.json.py— pipeline generator with workflow-aware step generationTest plan
NEW_VERSION=99.99.99 BRANCH=test/... DRY_RUN=true— commit created with correct author/message, no pushNEW_VERSION=99.99.0 BRANCH=test/... WORKFLOW=minor DRY_RUN=true— creates9.4branch, bumps upstream to99.99.0, no pushNEW_VERSION/BRANCHfail with clear errors; non-existent branch fails at checkoutelasticsearchmachineadded to bypass list onmain,9.3,9.2,9.1,8.18[org] Require a PRhas no bypass actors. Coordinate with Release Engineering.mainand org-level bypass resolved)