Skip to content

feat: review open pull requests when reviews turn on - #33

Merged
hyochan merged 3 commits into
mainfrom
feat/review-open-prs-on-connect
Nov 18, 2026
Merged

hyochan merged 3 commits into
mainfrom
feat/review-open-prs-on-connect

Conversation

@hyochan

@hyochan hyochan commented Nov 18, 2026

Copy link
Copy Markdown
Member

Why

Reviews start on pull request events, so a pull request opened before reviews were on never gets reviewed. hyochan/react-native-nitro-sound#857 was opened on 2026-10-23, before that repository was connected on 2026-11-04, and Gitdog never saw an event for it.

What changes

When pull request reviews turn on, up to five open pull requests updated in the last 30 days that were never reviewed get their first review. "Turn on" covers:

  • the web settings;
  • the CLI or a project API key;
  • reactivating, reconnecting, or regaining GitHub access for a repository that already has reviews on.

The limits:

  • drafts and bot pull requests are skipped;
  • reviews are spaced 12 minutes apart, because an account runs one review at a time;
  • the catch-up runs at most once an hour per repository (new optional repositories.pullRequestCatchUpAt);
  • nothing is scheduled when the account has no tokens and no usable key of its own, so old pull requests don't collect quota-failure comments.

Each pull request still goes through the same observe path as a webhook: the first-review rule, bot checks, legal eligibility and settings all apply.

Production impact

  • Schema: one optional field on repositories.
  • Cost: at most five first reviews per repository per enable, on the owner's tokens or key.

Verification

  • bun run lint, typecheck, build, test (2080 tests), format:check, check:api, typecheck:cli, test:cli
  • Tests cover:
    • enable via settings and via a project key;
    • the cooldown across toggles;
    • reactivation;
    • filtering of drafts, bots, stale, reviewed and malformed entries;
    • the no-tokens skip;
    • 12-minute spacing;
    • repositories with reviews off.
  • Independent Opus and Fable reviews found one blocker (the API-key path never scheduled the catch-up), now fixed, and confirmed the head clean.

🤖 Generated with Claude Code

Reviews start on pull request events, so a pull request opened before
reviews were on, or before the repository was connected, never got one.
Turning pull request reviews on, or reactivating or reconnecting a
repository with them on, now reviews up to five open pull requests
updated in the last 30 days, ten minutes apart, skipping drafts and bot
pull requests. Each still gets only its first review.
…requests

A project key turning reviews on patched settings inline and never
scheduled the catch-up; it now shares one helper with the web settings,
reactivation, reconnect and GitHub access restore. The helper runs at
most once an hour per repository. The catch-up skips pull requests that
already have a review, malformed list entries, and accounts with no
tokens and no usable key of their own, and spaces reviews 12 minutes
apart.
@gitdogai

gitdogai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Reviewed 4d20e7c · see the review

@hyochan hyochan left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

1 issue found while reviewing this change, fixed in cb6ac60

Not a merge approval. Tests were not run. Gitdog

Comment thread convex/apiKeys/gateway.ts Resolved
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 4d20e7c):

https://codeyou-df251--pr33-feat-review-open-prs-grf2lh0a.web.app

(expires Wed, 25 Nov 2026 02:32:44 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 844dad9c62537d028cabc21008e4e2e4031ce4e5

@gitdogai gitdogai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found in 4d20e7c

Approved because no issues were found in fully reviewed changes. Tests were not run. Gitdog

@hyochan
hyochan merged commit 2fe33b4 into main Nov 18, 2026
9 checks passed
@hyochan
hyochan deleted the feat/review-open-prs-on-connect branch November 18, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant