Snapshot version-bump helpers before release-branch checkout - #3083
Conversation
Patch bumps start from main then git checkout the target branch tip, which replaced create_github_pull_request.sh with an older copy that rejects --label. Keep pipeline-revision helpers in a temp snapshot instead. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Pinging @elastic/ml-core (Team:ML) |
There was a problem hiding this comment.
Pull request overview
This PR hardens the Buildkite version-bump automation by ensuring the pipeline always runs the current helper scripts from main, even after the workflow checks out an older release branch tip (which may contain outdated helper implementations).
Changes:
- Add
version_bump_snapshot_helpersto copy selected helper scripts into a temp directory for stable execution after branch checkouts. - Update patch and minor-freeze bump scripts to snapshot validation/PR-creation helpers before switching branches, and clean up via
trap. - Add unit tests covering helper snapshot behavior and a regression check for
--labelparsing support.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/changelog/3082.yaml | Adds a changelog entry for this pipeline/scripts fix. |
| dev-tools/version_bump_lib.sh | Introduces a helper-snapshot function used by version bump workflows. |
| dev-tools/unittest/test_version_bump_lib.py | Adds tests validating the snapshot helper behavior and regression coverage. |
| dev-tools/bump_version.sh | Snapshots helper scripts before release-branch checkout for patch bumps. |
| dev-tools/bump_main_minor_freeze.sh | Snapshots helper scripts before any checkout for minor-freeze leg B. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Remove docs/changelog/3082.yaml: this is a CI/tooling change that does not need a changelog entry, and the filename/pr field mismatched anyway. - Harden version_bump_snapshot_helpers: handle cp/chmod failure explicitly so a copy error removes the temp dir and returns non-zero instead of aborting under set -e before the caller installs its cleanup trap. Co-authored-by: Cursor <cursoragent@cursor.com>
Test plan item 2 — verified non-destructivelyThe literal "complete the patch bumps" is destructive (rewrites version metadata, opens PRs), so instead I verified — with the real helper scripts — that this PR resolves the exact blocker, using a The simulation mirrors the pipeline: 1) Pre-fix failure reproduced — the release branch's own This is the builds 60–62 failure. 2) Fix proven — snapshot taken before the checkout; worktree copy
Coverage: the The three topic branches are already pushed and can be completed through the normal |
Summary
ml-cpp-version-bump) start frommain, thengit checkoutthe target release branch tip before opening the PR.#3064, main'sbump_version.shpasses--label ci:skip-es-tests, but oldercreate_github_pull_request.shon8.19/9.3/9.4rejects unknown--label→ERROR: unknown argument: --label(builds 60–62).bump_main_minor_freeze.sh).Test plan
pytest dev-tools/unittest/test_version_bump_lib.py--labelrejection using the9.3/9.4/8.19copy ofcreate_github_pull_request.sh, and confirm the snapshotted (pipeline-revision) helper accepts--labelafter the release-branch checkout. The 9.3.9 / 9.4.5 / 8.19.20 patch bumps were blocked by exactly thisunknown argument: --labelerror (builds 60–62); topic branches are pushed and can be completed via the normal pipeline once merged.Made with Cursor