Snapshot version-bump helpers before release-branch checkout#3083
Snapshot version-bump helpers before release-branch checkout#3083edsavage wants to merge 3 commits into
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.
| @@ -0,0 +1,5 @@ | |||
| area: Build | |||
| issues: [] | |||
| pr: 3083 | |||
There was a problem hiding this comment.
Good catch. Rather than reconcile the filename/pr field, I've removed the changelog entry entirely (4a0aae2): this is a CI/dev-tools tooling change (>build), which doesn't warrant a user-facing changelog. With no changelog files left in the PR, validate-changelogs.sh soft-passes.
| dest="$(mktemp -d "${TMPDIR:-/tmp}/ml-cpp-version-bump-helpers.XXXXXX")" | ||
| for name in "$@"; do | ||
| if [[ ! -f "${src_dir}/${name}" ]]; then | ||
| echo "ERROR: missing helper to snapshot: ${src_dir}/${name}" >&2 | ||
| rm -rf "${dest}" | ||
| return 1 | ||
| fi | ||
| cp "${src_dir}/${name}" "${dest}/${name}" | ||
| chmod +x "${dest}/${name}" | ||
| done |
There was a problem hiding this comment.
Agreed — under set -e a failed cp/chmod would abort before the caller installs its cleanup trap, leaking the temp dir. Fixed in 4a0aae2 by handling cp/chmod failure explicitly: on error it now removes ${dest} and return 1 instead of relying on set -e.
- 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>
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.pyMade with Cursor