ci(automerge): restrict openapi auto-merge to generator-only PRs - #726
Merged
LinoGiger merged 1 commit intoJul 28, 2026
Merged
Conversation
The auto-merge gate trusted the branch name alone ("only a write-access
actor can push openapi-generation-main"), but that's every human and every
Poseidon vessel — a hand-written push to that branch could turn pyright
green and merge to main with no review. Before merging, re-verify the PR is
genuinely generator-only: every commit authored by the generator identity
and no files changed outside the generated paths. If either fails, skip the
merge and comment on the PR so it's clear it needs a human.
Co-Authored-By: lino <68745352+LinoGiger@users.noreply.github.com>
LinoGiger
marked this pull request as ready for review
July 28, 2026 08:21
LinoGiger
deleted the
ci(automerge)/restrict-openapi-auto-merge-to-generator-commits
branch
July 28, 2026 08:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The OpenAPI client auto-merge gate (automerge-openapi-client.yml) trusted the branch name as its only trust anchor — its comment read "only a write-access actor can push
openapi-generation-main, so the branch name is a sufficient trust anchor."But that set includes every human and every Poseidon vessel. A hand-written push to that branch can turn the pyright check green and get squash-merged to
mainwith no human review — the gate only asks "is pyright green?", not "is this actually only generated code?".This exact thing just happened: a Poseidon session pushed a hand-written fix to the branch to unblock a genuinely-broken pyright run, and it auto-merged. The change was correct, but it reached
mainunreviewed — which is not what auto-merge is supposed to allow.Notably, pushing a commit to the branch does not change the PR author (it stays the generator app), so an author-of-PR check would not catch this.
What
Before merging, re-verify the PR is genuinely generator-only:
login@rapidata.ai). A push from a human or a Poseidon vessel shows up as a foreign commit author.openapi/schemas/,src/rapidata/api_client/,src/rapidata/api_client_README.md) — exactly theadd-pathsthe generator writes.If either guard fails, the workflow skips the merge and comments on the PR explaining it needs a human — which also fixes the "why is this PR silently stuck on my board?" confusion.
Legitimate generator PRs (generator-authored commits, generated paths only) still auto-merge unchanged, so this adds no false negatives for the normal case.
Testing
🔗 Session: https://poseidon.rapidata.internal/chat/session-c6c9db5e
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.