Skip to content

[Fix] Review-state label on fork PRs does not update after a new review - #2134

Open
zoomote[bot] wants to merge 2 commits into
mainfrom
fix/fork-review-followup-dispatch-231cpcxmgn41i
Open

zoomote[bot] wants to merge 2 commits into
mainfrom
fix/fork-review-followup-dispatch-231cpcxmgn41i

Conversation

@zoomote

@zoomote zoomote Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

​Created by Roomote. Follow up by mentioning @roomote, in the web UI, or in Discord.

Related GitHub Issue

Closes: #2133

Description

The fork review follow-up workflow never dispatched a reconciliation run, so a review on a fork PR did not update the review-state label until another event reconciled the PR.

GitHub reports the base repository as workflow_run.head_repository on every pull_request_review run, even for fork PRs. Two defects followed:

  • The fork === false early return matched every review run, so the follow-up skipped all of them. This change removes the guard. A dispatch for a same-repo PR is idempotent, and the event check still stops the chain after one hop.
  • The fallback lookup queried head=<head_repository.owner>:<head_branch>, which is the base owner on review runs. It returned zero PRs. This change lists open PRs and matches head.sha, head.ref, and the base repository instead.

The resolve job of label-pr-review-state.yml keeps its owner-and-branch query. Its workflow_run triggers are CI runs from pull_request events, where head_repository is the real fork (verified on run 39534658962 and the CI runs of PR #1662). The comment there now records this difference, because the old note told both copies to stay identical.

Reviewers should check the fallback filter with care: it matches on exact head SHA and branch, so it can only resolve the PR that the review run targeted.

Test Procedure

cd src
pnpm run test:workflow
pnpm run check-types
pnpm exec eslint --max-warnings=0 services/__tests__/fork-review-followup-workflow.test.ts
  • pnpm run test:workflow passes 305 tests in 4 files, including the rewritten follow-up suite.
  • fork-review-followup-workflow.test.ts now builds its workflow_run payload from a real run (39534658962, the review run for PR fix(openai): count compatible cache reads #1662): head_repository is the base repository with fork: false, and pull_requests is empty for the fork PR.
  • The old "ignores a same-repository review run" test now expects a dispatch, because every review run reports fork: false.
  • Full pnpm test from the repository root passes (13/13 turbo tasks).
  • After merge, a CHANGES_REQUESTED review on a fork PR should flip the label to awaiting-author within one workflow cycle.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I reviewed my own code with care.
  • Writing Style: The PR title and description use Simplified Technical English (ASD-STE100): short sentences, plain words, active voice, one idea per sentence, no contractions.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Visual Snapshot: N/A — no UI changes.
  • Documentation Impact: I checked if my changes need documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I read and agree to the Contributor Guidelines.

Visual Snapshots

N/A — no UI changes.

Videos (interaction / animation only)

N/A.

Documentation Updates

  • No documentation updates are required.

Additional Notes

  • The fallback lookup costs three paginated pages at the current open-PR count (229). It runs once per completed review run, not per PR.
  • Dispatching for same-repo review runs adds one reconciliation run per review. The reconciliation is idempotent, and its own completion never re-enters this workflow.

Get in Touch

0x7777777_

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: Zoo-Code-Org/Zoo-Code/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d9e81793-4557-4ed2-a65b-2b635c9c5be0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review status

This PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging.

Current step: Required CI passed. Waiting for automated review of the latest commit.

If automated review does not start, a maintainer must restart it.

Review-state labels are managed by this workflow; do not edit them manually. community-approved is managed the same way — do not add or remove it manually. It signals a fresh community code approval for the current head as an advisory priority only; maintainer review is still required.

@edelauna
edelauna marked this pull request as ready for review October 21, 2026 04:11
@github-actions github-actions Bot added coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit labels Oct 21, 2026

This branch has not been deployed

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

Labels

awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit coderabbit-review-active Required CI passed; CodeRabbit review is active

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fork review follow-up never dispatches: GitHub reports base repo as head_repository

2 participants