[ML] Automate version bump in CI pipeline#3018
[ML] Automate version bump in CI pipeline#3018edsavage wants to merge 2 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. |
|
Gap analysis vs version bump automation specReviewed the full Version Bump Automation PSI spec. This PR covers the patch workflow basics. Here's what's done and what's still needed: Done
Gaps to address1. Minor version workflow not implemented
2. 3. DRA builds not explicitly triggered 4. No retry loop for push failures 5. Branch protection blocker 6. SLSA 0.1 compliance check needed 7. Team failure notifications 8. Skip ITs/E2E for version bump commits Not applicable
|
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
Status update — testing completeTesting resultsAll local and remote testing has been completed successfully:
Changes since initial commitAdded
Also fixed:
Branch protection statusRepo-level bypass — configured
Org-level ruleset blocker — the Elastic org has an This is a shared blocker — any team automating version bumps via direct push will hit the same issue. Recommend coordinating with Release Engineering to add What's ready to mergeThe code is functionally complete and tested for the patch version bump workflow. It can be merged once the org-level bypass is resolved, or if the decision is made to accept the blocker and address it separately (since the pipeline will simply fail at the push step with a clear error until the bypass is in place). Remaining gaps (from earlier analysis)See the gap analysis comment above for items like minor workflow, DRA trigger confirmation, and retry logic — these are follow-up work, not blockers for the initial patch workflow. |
Summary
Replaces the manual block step in the version-bump pipeline with automated version bump logic.
Flow
$BRANCH, updateselasticsearchVersioningradle.propertiesto$NEW_VERSION, commits aselasticsearchmachine, pushes directly to the branchPattern
Follows the established Elasticsearch repo pattern for automated commits from CI:
elasticsearchmachine/infra-root+elasticsearchmachine@elastic.coas committergit diff-index --quiet HEADfor idempotencygit pull --ff-onlybefore push to handle concurrent commitsNew file
dev-tools/bump_version.sh— standalone script withDRY_RUN=truesupport for safe testingPipeline changes
bump-versioninstead of the blockPortability
sed -ihandles both macOS (BSD) and Linux (GNU) variantsgit configuses local scope (not--global)Test plan
NEW_VERSION=99.99.99 BRANCH=test/version-bump-dry-run DRY_RUN=true— commit created with correct author/message, no pushNEW_VERSION/BRANCHfail with clear errors; non-existent branch fails at checkoutjob-version-bump.json.pygenerates correct step structure withbump-version→fetch-dra-artifactsdependencyelasticsearchmachineadded to bypass list onmain,9.3,9.2,9.1,8.18[org] Require a PRapplies tomainand versioned branches (via glob patterns likerefs/heads/[0-9].[0-9]) and has no bypass actors. Only org admins can update this. Other teams automating version bumps will hit the same issue — coordinate with Release Engineering.mainand org-level bypass resolved)