ci: add the team-gated Cursor review caller - #67
Conversation
Thin caller for the reusable cursor-review workflow in Comfy-Org/github-workflows, which owns the panel, judge, prompts and scripts. Every other actively-developed repo in the org has one; this repo did not, so its PRs got no automated review pass. Triggered by the 'cursor-review' label, which already exists here. Gated two ways: applying a label in a public repo needs triage permission or higher, and the reusable workflow's secret-bearing jobs do not run on fork PRs. diff_excludes restates the reusable default (overriding it replaces the default wholesale rather than extending it) and adds this repo's lockfile, assets, and GENERATED client code — the generated tree is the important one, since a regeneration would otherwise swamp a review with machine-written diff.
|
Important Approval pendingCodeRabbit has no unresolved comments, but it has not reviewed the latest commit. Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.
Comment |
The hygiene check is default-deny on Comfy-Org repo references, so the new cursor-review caller's two `Comfy-Org/github-workflows` references failed it. That repo is public -- `gh repo view` reports visibility=PUBLIC -- and it has to be, because a `uses:` reference to a private reusable workflow cannot resolve from this repo at all. So this is the false positive the error message invites resolving by extending the allowlist, not a leak to scrub. Default-deny is the right posture and is left intact: this adds one confirmed entry with the verification recorded, rather than loosening the rule.
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @mattmillerai.
Found 6 finding(s).
| Severity | Count |
|---|---|
| 🟡 Medium | 2 |
| 🟢 Low | 4 |
Panel: 8/8 reviewers contributed findings.
Addresses the cursor-review panel findings on #67, verified against the reusable workflow at the pinned SHA (6a374b7). - Replace `diff_excludes` with `extra_generated_globs`. `diff_excludes` filters only the patch handed to the panel, NOT the `diff_size_cap` count, so a `_generated.py` regeneration or a large `assets/` commit was hidden from reviewers yet still counted -- tripping the cap and skipping the whole review. `extra_generated_globs` feeds the shared check-pr-size classifier, which drives both. - Drop the four lockfile entries: package-lock.json, yarn.lock, pnpm-lock.yaml and uv.lock are all classifier built-ins already. - Narrow `src/comfy_low/models/**` to `src/comfy_low/models/_generated.py`. Only that file is emitted by scripts/gen_models.sh; the sibling __init__.py is hand-written and must stay visible to the panel. - Drop the `.claude/**` entry. As a git pathspec `:!**/.claude/**` never matched a root-level `.claude/` anyway (no `:(glob)` magic, so the literal `/` before `.claude` is still required), and hand-authored agent instructions are prose worth reviewing. - Fix the stale comment: `diff_excludes` defaults to empty upstream, so nothing was being "replaced wholesale". `extra_generated_globs` is the input that does replace its default, and its defaults are now restated. - Remove the job-level `if`. It rejected every `unlabeled` event before the reusable's Gate saw it, killing the documented unblock path where removing `skip-cursor-review` while `cursor-review` is still applied re-triggers the review. It also hardcoded a label name the reusable owns via its `review_label` input. Every downstream job is already gated on `needs.gate.outputs.should_run`, so the only cost is a seconds-long Gate no-op on unrelated label events. - check_public_repo_hygiene.py: drop the circular justification for the github-workflows allowlist entry. A private repo can share reusable workflows org-internally, so a resolving `uses:` proves nothing; the `gh repo view` visibility check is the only valid basis.
|
🤖 The reviews loop filed Linear follow-up ticket(s) for review thread(s) deferred as out of scope for this PR:
The following carry
|
ELI-5
Every actively-developed repo in the org gets an automated code review when you put a
cursor-reviewlabel on a PR. This repo was missing the file that switches that on, so its PRs never got one. This adds it.What this is
A thin caller for the reusable
cursor-reviewworkflow inComfy-Org/github-workflows, which owns the review panel, the judge, the prompts and the scripts. The caller carries no logic of its own — it pins a SHA and passes repo-specific settings.Copied from the callers in
comfy-cli/comfy-toolbox/evalsand adjusted for this repo. Thecursor-reviewlabel already exists here, so nothing else needs creating.Why now
This repo was just made routable for automated code work, and it is about to receive its first agent-authored PRs. Landing the review caller before that work arrives means those PRs get a review pass from the outset rather than retroactively — and this PR is itself a deliberately small first change to prove the path.
Repo-specific tuning
Generated and heavy paths are passed via
extra_generated_globs, notdiff_excludes. The distinction is load-bearing:diff_excludesfilters only the patch handed to the review panel, whileextra_generated_globsfeeds the sharedcheck-pr-sizeclassifier that drives both the reviewed diff and thediff_size_capcount. Listing a generated path underdiff_excludeswould hide it from the reviewers and still count it toward the cap — so a routine regeneration would trip the cap and skip the entire review.extra_generated_globsdoes replace its upstream default wholesale, so the shared defaults (node_modules,dist,vendor,*.generated.*, minified output) are restated verbatim, plus:src/comfy_low/models/_generated.py— the pydantic models emitted fromspec/openapi.yamlbyscripts/gen_models.sh. Scoped to that one file, not the package: the sibling__init__.pyis hand-written (re-export list and__all__) and must stay visible to the panel.assets/**Dependency lockfiles including
uv.lockare not restated — the classifier covers eight of them as built-ins.The generated file is the one that matters. Without it, a routine regeneration would bury a review in machine-written diff and the signal would be lost.
Label filtering is delegated entirely to the reusable workflow's Gate — the caller carries no job-level
if. The Gate owns thereview_labelinput and implements the unblock path (removingskip-cursor-reviewwhilecursor-reviewis still applied re-triggers the review), and every downstream job is already gated onneeds.gate.outputs.should_run, so filtering in the caller would only break those behaviours.Access control
Two layers, both inherited from the reusable workflow's design:
CURSOR_API_KEYis only reachable from internal branches.Permissions are
contents: read+pull-requests: write— no write access to code.Verification
The workflow YAML parses, the pin is the current
github-workflowsmain(6a374b7), andworkflows_refmatches theuses:SHA so prompts and scripts load from the same commit as the definition.The open question is answered. The original concern was that
CURSOR_API_KEYis an org-level secret whose visibility (all repositories vs. a selected list) could not be read withoutadmin:org. Applying the label to this PR settled it empirically: the full panel ran green here — 8 review cells across 4 labs, plus preflight, ledger, consolidate and the Slack notifications — so the secret is visible to this repo and no org-admin change is needed.Provenance
Authored by: agent-work loop
Verified:
ruff check .,ruff format --check .,mypy srcandpytestall pass locally (140 passed, 4 skipped);python3 scripts/check_public_repo_hygiene.pyreports no internal-only references; the workflow YAML parses underyaml.safe_load;gh repo view Comfy-Org/github-workflows --json visibilityreturnsPUBLIC, which is the sole basis for the hygiene allowlist entry. Theextra_generated_globs/diff_excludessemantics, the Gate's label and unblock branches, and theneeds.gate.outputs.should_runguard on every downstream job were each read directly from the reusable workflow at the pinned SHA6a374b7, not assumed. The full PR check rollup is green.Deviations: One review finding was deferred rather than fixed. A PR opened with the
cursor-reviewlabel already applied may never be reviewed, because the Gate only acceptsaction == labeled. There is no caller-side fix — addingopenedtotypesreaches the Gate with an emptylabel.nameand falls through — so closing it requires a change to the shared reusable workflow that affects every consumer repo. It is proposed as a follow-up for triage; the workaround is to remove and re-add the label. All other findings from the review panel were fixed in5033278.