Skip fork PRs in Grumpy PR Reviewer instead of treating them as failures - #16702
Skip fork PRs in Grumpy PR Reviewer instead of treating them as failures#16702Jacobjeevan with Copilot wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Jacobjeevan <40040905+Jacobjeevan@users.noreply.github.com>
Deploying care-preview with
|
| Latest commit: |
c142de8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://02334783.care-preview-a7w.pages.dev |
| Branch Preview URL: | https://copilot-feat14322home-page-r.care-preview-a7w.pages.dev |
|
@claude[agent] Alternatively, is there a way to include fork PRs as well? Adjust the security policy. |
Good question. It's possible, but I'd advise against simply loosening the guard, and here's why. The block isn't a policy I hand-wrote in The safer way to cover forks is the two-workflow split GitHub recommends: a Given that, my recommendation is to keep this PR's same-repo-only fix (it stops the spurious failure issues today) and track fork coverage via the |
There was a problem hiding this comment.
CARE Review — Gate the Grumpy PR Reviewer to same-repo PRs so fork PRs skip cleanly instead of filing failure issues
Intent (high confidence): stop the spurious "missing data" failure issues on fork PRs by never activating on them, since gh-aw's pull_request_target lockdown makes the fork diff unreadable anyway. Lens 3 (UI/UX) skipped — no .tsx touched.
Approach: proportionate. The if gate is the smallest thing that fixes #16669, the comment rewrite explains why rather than what, and the lock file is a faithful recompile with the matching compiler version (v0.85.4, body_hash unchanged — only frontmatter_hash moved, which is exactly right for a frontmatter-only edit).
Two notes:
- One inline finding on dropping
roles: all— it's a second, independent change riding along with the fork gate, and thepre_activationmembership check it re-enables may skip bot-authored same-repo PRs (including this one's own author). Worth confirming or splitting. - The
ifgate'sgithub.event.pull_request == nullarm correctly keepsworkflow_dispatchworking. Good.
Nothing else on the changed lines. The security reasoning in the new comment block is accurate and matches the workflow_run-split answer already given in the conversation thread.
Generated by CARE PR Reviewer for #16702 · opus50 · 77.5 AIC · ⌖ 5.37 AIC · ⊞ 19.4K
| # issue) instead of a spurious "missing data" failure. | ||
| # `pull_request_target` runs in the base-repository context, so a same-repo PR's | ||
| # author already has write access; the default role gate ([admin, maintainer, | ||
| # write]) covers them without needing `roles: all`. |
There was a problem hiding this comment.
Is the roles revert safe for bot-authored same-repo PRs?
The comment asserts a same-repo PR author "already has write access", but that is only reliably true for humans. Same-repo branches are also pushed by app/bot actors — the Copilot coding agent (which authored this very PR, head copilot/feat14322home-page-redesign) and Renovate. The recompiled lock adds a pre_activation job that gates on check_membership.cjs with admin,maintainer,write, and a GitHub App bot actor does not generally resolve to a repository collaborator permission level.
If that check resolves false, the reviewer silently skips exactly the PRs that most benefit from review — and the skip is invisible (no failure, no comment), which is the same failure mode this PR is fixing, just quieter.
The fork gate alone fixes #16669; dropping roles: all is a separate change riding along. Worth either keeping roles: all (the fork gate now makes it harmless, since untrusted heads never activate) or confirming a bot-authored same-repo PR still passes check_membership before merging.
|
Conflicts have been detected against the base branch. Please merge the base branch into your branch.
|
|
@copilot resolve the merge conflicts in this pull request Recent PR was merged that recompiled the workflows. |
…ome-page-redesign # Conflicts: # .github/workflows/grumpy-reviewer.lock.yml Co-authored-by: Jacobjeevan <40040905+Jacobjeevan@users.noreply.github.com>
Resolved the merge conflict in |
There was a problem hiding this comment.
Well. I came here expecting to sharpen my knives over a home page redesign branch name, and instead got a workflow YAML gating fix. Fine.
The change itself is... actually reasonable. Skipping fork PRs at the activation if instead of letting the engine spin up, fail on the MCP integrity policy, and file a garbage issue on every community PR is the right call. The github.event.pull_request == null escape hatch for workflow_dispatch is correctly handled, and the comment block explaining why is unusually thorough — I begrudgingly approve of people who document their gating conditions.
Two things stopping me from a clean approval:
- Dropping
roles: allmeans every run now goes throughcheck_membershipongithub.actor. Same-repo human authors are fine, but bot/app authors (like the one that opened this very PR) are a coin flip, and a failed membership check is a silent skip. Silent skips are how you end up with a reviewer bot that quietly stopped working three months ago and nobody noticed. - The description says v0.85.4, the lock header says v0.86.2. Pick one.
Nothing here is merge-blocking. Just do not make me come back and read a bug report about the bot mysteriously not running.
Generated by Grumpy PR Reviewer for #16702 · opus50 · 44.3 AIC · ⌖ 2.48 AIC · ⊞ 8.7K
| # issue) instead of a spurious "missing data" failure. | ||
| # `pull_request_target` runs in the base-repository context, so a same-repo PR's | ||
| # author already has write access; the default role gate ([admin, maintainer, | ||
| # write]) covers them without needing `roles: all`. |
There was a problem hiding this comment.
Dropping roles: all swaps one silent failure mode for another: the membership gate now runs against github.actor, and PRs opened by bots/apps (this very PR was authored by the Copilot app) are not guaranteed to resolve to admin/maintainer/write. When that check says no, the run is silently skipped with zero output — which is exactly the kind of thing someone will spend an afternoon debugging six months from now. Worth confirming the bot actors you care about actually pass check_membership.
| @@ -1,4 +1,4 @@ | |||
| # gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"62d210b9cc5b49b94f709043e5c5b41cf7e106cbb1484efd12aaa4ca785d96c1","body_hash":"c0c142c9e7e4d9a4b63f4f086983066c6a20792a28fd6956df215e445e9e1526","compiler_version":"v0.86.2","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.79"}} | |||
| # gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"3fd61dc673f0cff55470b3fa77e5646bbd2853a4ffa18152c83bfba011411577","body_hash":"c0c142c9e7e4d9a4b63f4f086983066c6a20792a28fd6956df215e445e9e1526","compiler_version":"v0.86.2","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.79"}} | |||
There was a problem hiding this comment.
Generated file, so I will not yell about the contents — but the PR description says it was recompiled with gh aw v0.85.4 while this header says compiler_version: v0.86.2. One of the two is wrong, and stale-lockfile archaeology is nobody idea of a good time. Fix the description (or the recompile) so the next person can reproduce this diff.
There was a problem hiding this comment.
CARE Review — gate Grumpy PR Reviewer to same-repository PRs
Intent (high confidence): stop the reviewer from activating on fork PRs, where the MCP integrity policy blocks reading the diff and the agent files a spurious failure issue. Implemented as an added head.repo.full_name == github.repository clause on the top-level if:, plus removal of roles: all. The lock file is a faithful recompile of that frontmatter (v0.86.2) — no hand edits, and the extra hunks (pre_activation job, trace-id plumbing, GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED) are all compiler-generated consequences of dropping roles: all.
Approach: proportionate. The fix is one condition in the source file and a recompile; nothing new is abstracted, and the pull_request == null guard correctly keeps workflow_dispatch working.
Lens 3 (UI/UX): skipped — no .tsx changed.
The one thing worth confirming before merge
Dropping roles: all is a second, separable change riding along with the fork gate, and it is the only part of this diff that can change behavior on PRs you want reviewed. It reintroduces the pre_activation / check_membership gate with admin,maintainer,write — and the new source comment justifies it with "a same-repo PR's author already has write access", which holds for humans but not necessarily for GitHub App actors that push same-repo branches (the Copilot coding agent — which authored this very PR — and Renovate). If check_membership resolves false for those, the reviewer silently skips them: no failure, no comment, no signal. That is the same invisible-skip failure mode this PR is fixing, just quieter.
This was already raised in an existing review thread on grumpy-reviewer.md, so I won't duplicate it inline — flagging it here only because it is the single merge-blocking-ish question in the diff, and it is still open. Either keep roles: all (the fork gate now makes it harmless, since untrusted heads never activate at all) or verify one bot-authored same-repo PR actually activates after this lands.
Nothing else in the changed lines needs work. The prose comment in grumpy-reviewer.md is a genuine improvement — it now explains why fork PRs can't be reviewed rather than just asserting the repo check.
Generated by CARE PR Reviewer for #16702 · opus50 · 87.6 AIC · ⌖ 3.96 AIC · ⊞ 19.6K
Proposed Changes
The Grumpy PR Reviewer ran on fork PRs via
pull_request_target+roles: all, but the GitHub MCP server's integrity policy blocks reading a fork PR's diff (lower integrity than agent requires). The agent reported this blocked read as "missing data" and filed a failure issue on every fork PR.Gate to same-repository PRs: the activation
ifnow requires the PR branch to live in the base repo, so fork PRs become a clean skipped no-op (no billed run, no error issue) instead of a spurious failure:Dropped
roles: all: its only rationale was reviewing community/fork PRs; reverting to the default[admin, maintainer, write]gate (which same-repo authors already satisfy) is now coherent. The compiler re-adds this via apre_activationmembership-check job.Updated description/comments in
grumpy-reviewer.mdto reflect same-repo-only scope.Recompiled
grumpy-reviewer.lock.ymlwith the matchinggh awv0.85.4, so the generated diff contains only the intended changes.Tagging: @ohcnetwork/care-fe-code-reviewers
Merge Checklist