Skip to content

[BUG] Backfill marks PRs mentor_verified even when the mentor didn't approve #888

Description

@Kirtan-pc

Describe the Bug

The PR backfill pipeline (pr-backfill → upsertReviews) flips pull_requests.mentor_verified to true for any substantive review from a higher-level reviewer — including changes_requested reviews (even with an empty body) and commented reviews with a body of 20+ characters. The live webhook path (process-review-event) only sets mentor_verified: true when the review state is exactly approved. As a result, PRs that a mentor actually requested changes on are shown as "mentor verified" in the maintainer queue, analytics, and contributor reports.

Steps to Reproduce

  1. Install the app on a repo and run pr-backfill (or trigger it from the maintainer "Refresh PRs" button).
  2. Have a PR in that repo whose highest-level reviewer left a CHANGES_REQUESTED review (no body needed).
  3. Query pull_requests for that PR.
  4. See mentor_verified = true, even though the mentor never approved.

Expected Behavior

mentor_verified should only become true when the highest-level reviewer's review state is approved, matching the webhook handler (process-review-event.ts:265).

Screenshots (If applicable)

N/A

💻 Environment Details

  • OS: N/A (server-side logic)
  • Browser: N/A
  • Version: main

Activity

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 working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions