Skip to content

pre-review: dismiss the review bot's stale approval at review run start (follow-up to #1719) #1720

Open

Description

@waynesun09

Problem

Follow-up to fullsend-ai/fullsend#5417 and #1719. #1719 removes ready-for-merge at review run start. The review bot's own GitHub APPROVED review still has the same gap: after a push, it stays in effect until the next review run finishes.

The dismissal exists, but it only runs at the end. fullsend post-review calls dismissStaleApprovals after it posts the new verdict (fullsend internal/cli/postreview.go, around lines 446-483). Between the push and the end of the next review, a repo whose branch rules count the bot's approval can merge the new head on the old approval.

Change (minimum, same layer as #1719)

  1. In scripts/pre-review.src.sh, right after the ready-for-merge removal, dismiss APPROVED reviews on the PR that were submitted by the review bot identity using REVIEW_TOKEN. Do not touch reviews by other users. Use a message like "Superseded: new review run started".
    • Add a forge helper in scripts/lib/github-review-ops.lib.sh, for example forge_dismiss_own_approvals.
    • Find the bot login the same way post-review does, from the token's own identity. Do not hard-code app names.
    • GitLab: no-op unless the review app's approval maps to a GitLab MR approval. If it does, revoke it with the same token. Otherwise document the no-op.
  2. Fail closed in the same way as fix(#1718): clear ready-for-merge at review run start #1719. A failed list or dismiss logs a ::warning:: and does not block the review. Print a notice only when a dismissal succeeds.
  3. make script-build, and commit the bundles. make check-bundle must pass.
  4. Tests in scripts/pre-review-test.sh:
    • a bot APPROVED review is dismissed;
    • an APPROVED review by another user is left alone;
    • there are no reviews, so no dismissal call is made;
    • a failed dismissal produces a warning and no success notice.
  5. Add one sentence to docs/review.md next to the ready-for-merge sentence.

Out of scope

Acceptance

  • make script-test and make check-bundle pass.
  • On a test repo, a push to a PR the bot approved: the review run's pre-script dismisses the bot's approval before the sandbox starts. A new approval appears only if the new run approves.

Activity

  1. fullsend-ai-triage commented on Oct 20, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 8:17 PM UTC · Completed 8:19 PM UTC

    Commit: 4fca9ba · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.23

  2. fullsend-ai-triage commented on Oct 20, 2026

    @fullsend-ai-triage

    Triage found this issue ready to implement. #1719 is merged, so nothing blocks it, and no open PR addresses it.

    Notes for the implementer

    • The existing forge_remove_label_checked helper and the ready-for-merge block in scripts/pre-review.src.sh are the patterns to follow for the new helper and its fail-closed handling.
    • Deriving the bot login from the token's own identity mirrors logic that lives in the fullsend repo (postreview.go), not here. If the login cannot be resolved, warn and skip rather than dismissing anything. Only dismiss reviews in state APPROVED authored by that login.
    • Edge cases worth covering beyond the four requested tests: non-approval bot reviews are left alone, and a failed list call warns without blocking.
    • No workflow files are involved, so the code agent can proceed.

    Proposed test case

    stub gh reviews API; run the pre-review block:
     1. bot APPROVED review          -> 1 dismiss call, success notice
     2. other-user APPROVED review   -> no dismiss call
     3. no reviews                   -> no dismiss call
     4. dismiss call fails           -> ::warning::, no success notice, exit 0
    

    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  3. fullsend-ai-coder commented on Oct 20, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 8:20 PM UTC · Completed 8:29 PM UTC

    Commit: 4fca9ba · View workflow run →

    Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $2.24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-to-codeTriggers code agent dispatch

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions