feat(code-review): add opt-in block_on_severity merge gate - #2
Merged
Conversation
Reviews are advisory here: the only failure paths are a missing config file and a codex CLI crash, so a [CRITICAL] finding lands as a comment and the build stays green. Repos migrating off hand-rolled review jobs lose a gate they had — game-components' inline jobs ran `grep -qE '\[(CRITICAL|HIGH)\]' && exit 1`. Adds block_on_severity (default false) so a caller can opt back in without imposing it on the repos that are happy with advisory reviews. Applies to both reviewers. The gate runs after the comment upsert, so a blocking finding is posted before the job goes red, and guards on a non-empty review file so an errored or empty review cannot block on its own. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
starknetdev
added a commit
to Provable-Games/game-components
that referenced
this pull request
Jul 29, 2026
Both depend on shared-workflow changes that have now landed at v1. review-agents.json: the general agent goes back to the documented diff_paths ["."] + exclude_paths ["packages/"]. The enumerated top-level list was a workaround for the prefix matcher treating "." as a dotfile prefix (fixed in Provable-Games/.github#1), and it silently missed any new root file — LICENSE and docs/** matched no agent at all. pr-ci.yml: block_on_severity: true restores the merge gate the inline review jobs had (Provable-Games/.github#2). Without it a [CRITICAL] finding would only post a comment. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
starknetdev
added a commit
to Provable-Games/game-components
that referenced
this pull request
Jul 29, 2026
* chore(ci): delegate AI review to the org-shared reusable workflow Replaces four hand-rolled review jobs (claude/codex x packages/general) with a single call to Provable-Games/.github code-review.yml@v1. Review logic, prompt assembly, comment upserting and model config now live in one place, so a model deprecation is an org-variable change rather than an edit here. This repo supplies only .github/review-agents.json plus the existing .github/prompts/*.md. Net -577 lines. Also drops the local AI-availability gate: the shared workflow owns fork skipping, so the `changes` job no longer computes can_run_ai_reviews and the pr-ci aggregate is back to a plain did-any-job-fail check. The general agent enumerates top-level paths rather than using the documented ["."] catch-all: the shared workflow's matcher is prefix based, so ["."] only matches dotfiles and would silently skip review on README.md / Scarb.toml / codecov.yml-only PRs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * chore(ci): use the documented catch-all and restore the severity gate Both depend on shared-workflow changes that have now landed at v1. review-agents.json: the general agent goes back to the documented diff_paths ["."] + exclude_paths ["packages/"]. The enumerated top-level list was a workaround for the prefix matcher treating "." as a dotfile prefix (fixed in Provable-Games/.github#1), and it silently missed any new root file — LICENSE and docs/** matched no agent at all. pr-ci.yml: block_on_severity: true restores the merge gate the inline review jobs had (Provable-Games/.github#2). Without it a [CRITICAL] finding would only post a comment. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * docs(ci): record why the review job pins @v1 and inherits secrets Both were flagged as reproducibility/least-privilege risks in review. Keeping them, deliberately: @v1 is the org convention every caller uses and is what makes an upstream model change a one-place fix, and the callee is first-party and declares exactly the two secrets it uses. Pinning a SHA or enumerating secrets here would diverge from the other six callers for no practical gain. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Summary
Reviews are advisory in this workflow: the only
exit 1paths are a missing config file and a non-zero exit from the codex CLI. A[CRITICAL]finding is posted as a comment and the build stays green.That's a reasonable default, but it's a regression for repos migrating off hand-rolled review jobs.
game-components' inline jobs ended with:So its port (Provable-Games/game-components#122) silently trades "a CRITICAL blocks merge" for "a CRITICAL is a comment".
Adds
block_on_severity(defaultfalse) so a caller can opt back in, without imposing a gate on the four SDK repos that are happy with advisory reviews.Behavior
false→ no change for any existing caller. The step isif: always() && inputs.block_on_severity, so it doesn't even run unless opted in.true→ the review job fails when/tmp/review.txtcontains[CRITICAL]or[HIGH]. Applies to both reviewers.Verification
Gate logic exercised against realistic reviewer output:
[HIGH] src/a.ts:1 - bad[CRITICAL] a:1 - boom[MEDIUM] …/[LOW] …lgtmNo review output was captured from Claude.The word HIGH appears but not bracketedThe last row is the one worth calling out: matching is on the bracketed severity token, so prose mentioning "high severity" doesn't trip the gate.
Parsed with
js-yamlto confirm the step lands inclaude-reviewandcodex-reviewand nowhere else.npx yaml@2.8.1 validpasses.After merge
Backward-compatible, so
v1should move forward again — callers pin@v1and won't see the input until it does.Note the ordering constraint: passing an input a reusable workflow doesn't declare is a hard workflow error, so
game-components#122 cannot setblock_on_severity: trueuntilv1includes this. I'll wire it up once the tag moves.🤖 Generated with Claude Code