[ML] Auto-approve automated version-bump PRs - #3137
Conversation
The automated version-bump PRs already arm auto-merge but stalled on the single required review. Add a workflow that approves them as github-actions[bot] (a distinct identity from the vault-app author, mirroring the Backport workflow), gated to the bump topic branch + author and to a diff that only touches gradle.properties. Auto-merge then lands them on green CI. Co-authored-by: Cursor <[email protected]>
|
Pinging @elastic/ml-core (Team:ML) |
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow to automatically approve automated version-bump pull requests so that already-armed auto-merge can complete once required CI is green. This targets only the version-bump automation path and uses pull_request_target with minimal permissions to avoid executing PR code.
Changes:
- Introduces
.github/workflows/auto-approve-version-bump.ymlto auto-approve version-bump PRs authored byelastic-vault-github-plugin-prod[bot]. - Guards approval by requiring the head branch prefix
ci/ml-cpp-version-bump-and restricting the diff to onlygradle.properties. - Avoids stacking duplicate approvals by checking for an existing
github-actions[bot]approval before approving.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Query the PR reviews endpoint with --paginate --slurp so the "already approved by github-actions[bot]" check counts across all pages, not just the first 30. Co-authored-by: Cursor <[email protected]>
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
The automated version-bump PRs already arm auto-merge but stalled on the single required review. Add a workflow that approves them as github-actions[bot] (a distinct identity from the vault-app author, mirroring the Backport workflow), gated to the bump topic branch + author and to a diff that only touches gradle.properties. Auto-merge then lands them on green CI. --------- (cherry picked from commit 68fb7cc) Co-authored-by: Ed Savage <[email protected]> Co-authored-by: Cursor <[email protected]>
The automated version-bump PRs already arm auto-merge but stalled on the single required review. Add a workflow that approves them as github-actions[bot] (a distinct identity from the vault-app author, mirroring the Backport workflow), gated to the bump topic branch + author and to a diff that only touches gradle.properties. Auto-merge then lands them on green CI. --------- (cherry picked from commit 68fb7cc) Co-authored-by: Ed Savage <[email protected]> Co-authored-by: Cursor <[email protected]>
The automated version-bump PRs already arm auto-merge but stalled on the single required review. Add a workflow that approves them as github-actions[bot] (a distinct identity from the vault-app author, mirroring the Backport workflow), gated to the bump topic branch + author and to a diff that only touches gradle.properties. Auto-merge then lands them on green CI. --------- (cherry picked from commit 68fb7cc) Co-authored-by: Ed Savage <[email protected]> Co-authored-by: Cursor <[email protected]>
|
Test-plan status (2026-08-10): the post-merge verification items here are pending the next automated version bump — none has run since this merged (the last bump, #3135 for 9.5.1, was on 2026-08-04, before this landed). Not forgotten; they'll be exercised and confirmed on the next bump. |
Summary
The automated version-bump PRs (
dev-tools/bump_version.sh, e.g. #3135) already arm auto-merge, but stalled on the single required approving review — a human still had to click Approve. This adds a workflow that supplies that approval automatically.github-actions[bot](this workflow'sGITHUB_TOKEN) approves the PR. Because the PR was authored byelastic-vault-github-plugin-prod[bot],github-actions[bot]is a distinct identity and its approval counts — GitHub forbids self-approval. This is the same mechanism the Backport workflow already uses, and the repo has "Allow GitHub Actions to approve pull requests" enabled. The armed auto-merge then lands the PR once required CI (buildkite/ml-cpp-pr-builds) is green — CI still gates the merge.Guards / safety
elastic-vault-github-plugin-prod[bot]and head branch matchesci/ml-cpp-version-bump-*(the topic branch frombump_version.sh).gradle.properties; anything broader is skipped and left for a human.github-actions[bot]already approved (reopened PRs re-trigger).contents,pull-requests: write; does not check out or run PR code (safe underpull_request_target).Backport note
pull_request_targetreads the workflow from the PR's base branch, and bump PRs target release branches — so this file must also live on each active release branch (9.5,9.4,8.19). Version labels will be added to backport it there. Until then, release-branch bump PRs still need a manual approval.Test plan
bash -ncleanmain(minor freeze) or a backported branch:github-actions[bot]approves automatically and auto-merge lands it on green CI (pending next automated version bump — per the Elastic release schedule the next patch cycle is 8.19.21 / 9.4.6: Feature Freeze Tue 25 Aug 2026, GA Tue 01 Sep 2026; then 9.5.2 FF 8 Sep 2026)ci/ml-cpp-version-bump-*branch touching a file other thangradle.propertiesis not auto-approved (not schedule-dependent — can be verified manually at any time)Made with Cursor