Skip to content

Review agent: do not auto-apply ready-for-merge label to fork PRs from new contributors #1464

@fullsend-ai-retro

Description

@fullsend-ai-retro

What happened

On PR #1202, an external contributor (GHX5T-SOL) opened a fork-based PR for issue #1148. The account had zero prior contributions to the repo, the fork was created minutes before the PR, and the commit was authored under a pseudonym. The review bot approved the PR with "No findings" and applied the ready-for-merge label within 5 minutes of PR creation. Two days later, a second external contributor (resolvicomai) opened PR #1277 for the same issue, and the review bot again approved and labeled it ready-for-merge. Neither PR was merged. The maintainer closed both and triggered /fs-code to have the code agent redo the work.

The ready-for-merge label signals to maintainers that a PR is safe to merge. Applying it automatically to fork PRs from unknown contributors undermines this signal — the label implies trust that hasn't been established.

What could go better

The review bot should distinguish between PRs from trusted sources (org members, known contributors, the code agent itself) and PRs from unknown external contributors when deciding whether to apply the ready-for-merge label.

Confidence: High. This happened on two separate PRs in the same week. The maintainer's action (closing both and re-triggering the code agent) is a clear signal that the bot's approval alone was insufficient for these PRs. The repo's own threat model prioritizes external injection risks, which makes auto-approving unknown external code particularly concerning.

What I could be wrong about: The maintainer may have closed the PRs for reasons unrelated to contributor trust (e.g., preferring agent-generated code for consistency, or subtle code quality issues). However, the pattern of closing approved-and-labeled PRs without comment suggests the label itself was premature.

Proposed change

Modify the review agent's post-review logic (in the pr-review skill or the review workflow's post-processing) to check whether the PR is from a fork and whether the author has prior merged PRs in the repo before applying the ready-for-merge label.

Specifically, in the pr-review skill (skills/pr-review/SKILL.md in the scaffold or .fullsend repo):

  1. After completing the code review, check pr.head.repo.fork (or equivalent) to determine if the PR is fork-based.
  2. If fork-based, check contributor history: gh api repos/{owner}/{repo}/commits?author={pr_author}&per_page=1 to see if the author has any prior merged commits.
  3. If the author is a first-time contributor from a fork, do NOT apply ready-for-merge. Instead, add an informational note in the review comment: "This PR is from a first-time contributor. A maintainer should verify before merging."
  4. The review verdict (approve/request changes) should still be based on code quality — only the label application changes.

This keeps the review bot's code analysis useful while preventing it from signaling merge-readiness for untrusted sources.

Validation criteria

Over the next 10 fork-based PRs from first-time contributors:

  • The ready-for-merge label should NOT be auto-applied to any of them.
  • The review comment should include a note about first-time contributor status.
  • PRs from org members or contributors with prior merged commits should still receive ready-for-merge when approved.
  • No regression in review quality for internal PRs.

Generated by retro agent from #1202

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions