Repository navigation
feat(automation): merge stable core bumps that change no proto - #60
Conversation
SDAChess
left a comment
There was a problem hiding this comment.
I’d keep auto-merge off and hold off on granting the App a main-integrity bypass until we can verify who produced the exact commit and what it changes.
The bump commits are unsigned today. The script checks the author and committer emails, which anyone who can push to the branch can set. A simpler option than adding commit signing would be a dedicated ruleset for core/* in sdk-go that lets only the App create, update, or delete those branches. We could limit auto-merge to branches created under that rule and keep --match-head-commit so the merge uses the SHA we checked. If we want to preserve the ability for humans to push fixes directly to bump branches, bot-signed commits would give us that flexibility.
I’d also compare the full patch against the expected pin and README edits. Buf can execute a local plugin without changing proto/, so checking the tag field and changed filenames leaves a gap.
Before granting bypass, I’d fix the PR-body renderer so upstream diff text can’t expand environment variables, and enforce CI and E2E in a separate ruleset the merge identity can’t bypass. The branch ruleset would establish who controls the bump branch. A merge-only App would separately limit which workflows can bypass review on main.
|
Thanks, these are good points, and I agree with all of them. Auto-merge stays off (it defaults to off anyway), and we don't grant the bypass until the pieces below are in place. Plan:
I'll ping you again once the renderer fix is merged and this PR is updated. |
A stable core release whose regenerated bindings are identical needs no SDK work, so core-watch can merge its proposal and release-tag.yml tags the SDK release right away. merge-bump-pr.sh merges such a proposal only when it is still one bot commit touching nothing but buf.gen.yaml and README.md, its required checks are green, and no one added the hold label. A release that changes anything under proto/ always waits for review, so the SDK release may lag until the new features are wrapped. Off by default: the CORE_AUTO_MERGE repository variable switches it on, and the bot needs a pull-request bypass on the main-integrity ruleset. Signed-off-by: Roland Huß <rhuss@redhat.com>
Compare the bump commit's tree with the tree pin_bump_tree rebuilds from the merge base (pin in buf.gen.yaml, README line, nothing else), instead of allowing any change to buf.gen.yaml and README.md. Another edit inside buf.gen.yaml, such as a local Buf plugin, now sends the proposal to review. open-bump-pr.sh makes the same edits through the shared pin_bump_edit, so producer and checker cannot drift apart. Move the merge into a separate core-watch job that mints its token from a merge-only App (SDK_MERGE_CLIENT_ID, SDK_MERGE_PRIVATE_KEY). Only that App needs the main-integrity bypass, the bump App that pushes core/* branches does not get it, and the job runs no generator or other code from core. The watch job passes the bump bot's email, which merge-bump-pr.sh now reads from BUMP_BOT_EMAIL. Document the rulesets an admin sets up before turning auto-merge on. Signed-off-by: Roland Huß <rhuss@redhat.com>
62de893 to
89d1bd8
Compare
|
@SDAChess updated, and rebased on
Could you take another look? |
Signed-off-by: Simon Scatton <sscatton@nvidia.com>
|
@SDAChess thanks for pushing this yourself. A provenance check run from the bump App is a much better anchor than the commit emails: only the App can create it, the app ID filter rules out look-alikes from other Apps, and any other push produces a new SHA without it. One small thing to watch after merge: with auto-merge off, If the PR looks good to you now, could you re-review and lift the change request? Step 1 of the rollout, #77, also needs an infra review, if you have a moment. |
When two stable proposals were open from the same base, the second one still passed every check after the first merged, failed with a conflict on the pin line, and set -e ended the run. It failed the same way every hour, and the 'Merged without review' comment was already posted before the refused merge. Nothing checked that the tag was newer than the pin either, so a dispatched older tag could land a downgrade unreviewed. merge-bump-pr.sh now fetches main for each proposal and leaves it for review unless main still pins the tag the proposal was cut from and the proposal's tag is newer. It merges first and comments only after the merge succeeded. A refused merge leaves that proposal for review, the run goes on with the others, and the script exits non-zero at the end so the failure is reported. older moves to pin-bump.sh so both scripts share it. Signed-off-by: Roland Huß <rhuss@redhat.com>
merge-bump-pr-test.sh checks pin_bump_tree and older in a scratch Git repository and runs merge-bump-pr.sh against scratch repositories with a gh stub that serves PR lists, check runs and checks from files and squash-merges into a local bare origin. The cases cover two proposals from the same base, a refused merge, a downgrade, provenance from another App, a failed run or another SHA, a plugin or proto change, missing, skipped, pending and failed checks, and the hold, draft, fork and pre-release filters. workflows:check runs it in CI. The rollout list gains a dry run against the real proposals before an admin turns auto-merge on. Signed-off-by: Roland Huß <rhuss@redhat.com>
|
@SDAChess Your provenance commit looks good; a full re-review found nothing there. It did find two problems in my merge loop, fixed in c4f0c00:
59159cf adds Could you take another look? |
SDAChess
left a comment
There was a problem hiding this comment.
Re-reviewed at 59159cf. The exact-head provenance check, full-tree comparison, and separate merge App address my earlier change request. Approved with CORE_AUTO_MERGE off. The preview-mode gap and the batch stopping on a missing branch can be follow-ups. Keep auto-merge off until #77 and the rollout protections are in place.
Summary
A stable core release whose regenerated bindings are identical needs no SDK work. core-watch can then merge its bump proposal without review, and
release-tag.ymltags the lockstep SDK release right away. A release that changes anything underproto/keeps waiting for review, so the SDK release may lag until the new features are wrapped and usable (see #59 for the coverage issues).How it works
core-watch gets a second job,
merge, that runs afterwatchonly when the repository variableCORE_AUTO_MERGEison. It runshack/automation/merge-bump-pr.sh(mise taskcore:merge) with the token of a separate merge-only App, and runs no generator or other code from core. On each run it checks every open stablecore-bumpproposal again and merges only when all of these hold:core/vX.Y.Zof this repository intomain, noholdlabelmain, with a successfulcore-bump/provenancecheck from the bump App for the exact head SHApin_bump_tree(hack/automation/pin-bump.sh) rebuilds from the merge base: the pin inbuf.gen.yamland the README line changed, nothing else. Nothing underproto/and no conformance fixture can change, and no other edit insidebuf.gen.yaml(such as a plugin) is allowed.open-bump-pr.shmakes the same edits through the sharedpin_bump_edit.ci,e2e / e2e, andDCOpassed, and no other check failed or is pendingWith auto-merge enabled, the bump App records the check on the local commit SHA it generated. A different head, missing check, or check from another App sends the proposal to human review. CI also publishes
e2e-gateon every PR so the repository can require a stable check name and still allow intentional E2E skips.It merges with
--squash --match-head-commit <sha>, so a push after the checks blocks the merge, and it comments on the PR why it merged without review.Rollout
Off by default. Before an admin sets
CORE_AUTO_MERGE=on, in this order:core/*that lets only theai-openshell-sdk-goApp and maintainers create, update, or delete those branches.e2e-gateis visible on a PR targetingmain, add a ruleset that requires it andcifrom GitHub Actions with no bypass actors. Keep the separate DCO rule in force.core-watchrequests that permission only whenCORE_AUTO_MERGEison.SDK_MERGE_CLIENT_IDandSDK_MERGE_PRIVATE_KEYin thesdk-botenvironment.main-integritybypass for SDK Go. KeepCORE_AUTO_MERGEoff until the rollout is ready.Testing