Skip to content

Fix reviewer bot never re-approving after blockers are addressed#473

Merged
awinogradov merged 1 commit into
mainfrom
hotfix-react-reverdict-repo-resolution
Jul 22, 2026
Merged

Fix reviewer bot never re-approving after blockers are addressed#473
awinogradov merged 1 commit into
mainfrom
hotfix-react-reverdict-repo-resolution

Conversation

@awinogradov

Copy link
Copy Markdown
Owner

Context

The reviewer bot could never lift its own CHANGES_REQUESTED after a PR author addressed a blocker via discussion — the react-mode verdict re-evaluation shipped in #275 never fired in production.

Root cause

Three gh pr view calls in code-review-action/action.yml run before actions/checkout, in a workspace that has no .git yet. Without -R, gh pr view resolves the target repo from the local git remote, so each call fails with fatal: not a git repository.

Confirmed on a live react run — both pre-checkout reads failed in the same job, before checkout:

Run gh pr view <n> --json reviewDecision
  fatal: not a git repository (or any of the parent directories): .git
  ::warning:: treating bot as not blocking (issue #275 re-verdict will not arm)
  bot_blocking=false
Run gh pr view <n> --json headRefOid
  fatal: not a git repository ...
Checkout repository (actions/checkout@v7)   <- .git first exists here
classify: NEEDS_REVERDICT=false             <- because bot_blocking=false
pr-answer: "updatedVerdict": null           <- reply only; verdict never re-evaluated

Because bot_blocking is always false in react mode, authorAcknowledgesWhileBlocking in classifyReaction.ts can never arm the re-verdict, so CHANGES_REQUESTED is never lifted.

What / Solution

Pass the repo explicitly to the three pre-checkout gh pr view calls:

  • reviewDecision (ctx step) — the damaging one; its failure disarmed the re-verdict. Adjacent comment refreshed to explain the pre-checkout -R requirement.
  • headRefOid (resolve-sha step) — was silently degrading the react checkout to the merge ref.
  • isDraft (ctx step) — was failing open to "not draft".

Post-checkout gh pr view calls already have a git remote and are unchanged.

Scope

  • The fail-open direction (a genuine query failure → bot_blocking=false) is intentionally kept; with the repo resolved, the deterministic pre-checkout failure no longer occurs, so no retry is added.
  • The authorAcknowledgesWhileBlocking acknowledgement vocabulary (which phrasings auto-arm) is unchanged — a separate concern. An explicit "re-review"/"PTAL" arms regardless.

Testing

action.yml shell is not unit-testable (the composite action is not covered by actionlint, which is gated by the CI Validate Actions job). Verify on a live blocking PR: an author acknowledgement (or "PTAL") should now log bot_blocking=true, NEEDS_REVERDICT: true, and a non-null updatedVerdict, with no "re-verdict will not arm" warning.

Related to #275

Three `gh pr view` calls run before `actions/checkout`, in a workspace
that has no `.git` yet. Without `-R`, gh resolves the target repo from
the local git remote, so each call fails with "not a git repository".

The reviewDecision read is the damaging one: its failure degrades to
`bot_blocking=false`, which permanently disarms the react-mode verdict
re-evaluation — the bot can never lift its own CHANGES_REQUESTED after
an author addresses a blocker via discussion. The headRefOid read
silently degrades the react checkout to the merge ref, and the isDraft
read fails open to "not draft".

Pass the repo explicitly with `-R "$GITHUB_REPOSITORY"` (and the
`${{ github.repository }}` expression form for the resolve-sha step) so
these pre-checkout queries resolve reliably.
@symbiot-bot symbiot-bot added the code-assistants/code-review-action Auto-applied: PR touches code-assistants/code-review-action label Jul 22, 2026
@symbiot-bot
symbiot-bot self-requested a review July 22, 2026 22:18

@symbiot-bot symbiot-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues found.


Review run summary 🤖
Metric Value
Mode review
Model claude-sonnet-5
Model time 122.7s
Tool round-trips 20
Assistant turns 21
Tokens in / out 1489727 / 9499
Cache read / write 1392385 / 97313
Cost (USD) $0.93

@awinogradov
awinogradov merged commit ce6d406 into main Jul 22, 2026
9 checks passed
@awinogradov
awinogradov deleted the hotfix-react-reverdict-repo-resolution branch July 22, 2026 22:21
symbiot-bot added a commit that referenced this pull request Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-assistants/code-review-action Auto-applied: PR touches code-assistants/code-review-action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants