Home

boring / v2

publicBoring-Software-Inc/v2
Overview Code History Branches Pull requestsIssuesInsights Campfire Docs
main
HomeOverview Code PRsIssues

fix(workflows): refuse to shrink reviewer cache on a truncated collaborator read

closed
#179 opened by detail-app[bot]detail/bug-fix/fix-workflows-refuse-to-shrink-reviewer-cache-on-a-3db536→main
Conversation5
detail-app[bot]
Commits
0
Files changed…
opened this pull request
Author
· 2 weeks ago

Detail bug report: View on Detail

Bug

The reviewer sync job keeps a DB cache of who can review each GitHub repo (repo_reviewers), which drives the workflow editor's reviewer picker and the enable-time stale-reviewer lint. listRepoReviewers paginated GitHub collaborators with a hard cap of 10 pages × 100 rows and, when page 10 came back full, silently stopped at 1000 collaborators with no signal to the caller. The sync job then called replaceRepoReviewers, which deletes all existing rows for the repo and re-inserts only the truncated list — wiping every valid reviewer beyond the first 1000 on every 24h re-sync.

The impact was user-visible: the reviewer picker marked missing reviewers with "can no longer review this repo" warnings, and setWorkflowEnabled emitted stale-reviewer lint findings with a one-click "Remove" fix — both for people who could in fact review.

Root cause: the capped pagination loop had no truncation signal, and the delete-and-replace DB service had no shrink guard, so a successful-but-truncated fetch silently replaced a complete set with a partial one.

Fix

  • listRepoReviewers (packages/forge-github/src/client/reviewers.ts) now returns { reviewers, truncated } instead of RepoReviewer[]. The truncated flag is set when the MAX_PAGES cap is hit with a full final page (page 10 returns exactly 100 rows), signaling the list may be incomplete.
  • The sync job (apps/worker/src/jobs/sync-repo-reviewers.ts) checks truncated and, when true, skips replaceRepoReviewers and logs a warning ("reviewer sync skipped: collaborator list truncated at the page cap; kept the last set") — preserving the existing DB rows instead of wiping them with a truncated list.

This mirrors the existing "reviewer sync failed: kept the last set" semantics already used for failed fetches, extending it to successful-but-truncated reads.

Testing

  • Unit tests (packages/forge-github/src/client/reviewers.test.ts): updated existing tests for the new return type and added two new tests — one verifying truncation is detected when the cap is hit with a full final page (1000 reviewers, only 10 pages fetched), and one verifying no false-positive truncation when the last page is short.
  • Integration test (apps/worker/src/sync-repo-reviewers.integration.test.ts): added a test verifying the sync job keeps the last known set when the collaborator list is truncated, rather than replacing it with the truncated list.
  • Typecheck, Biome lint/format, boundary check, and anti-slop check all pass across the changed packages.
  • Full test suite (3899 tests across 327 files) passes with no regressions.

Closes #166


Automatic Fixes PRs can be configured here.

unkey-deploy[bot]commented· 2 weeks ago

The latest updates on your projects. Learn more about Unkey Deploy

NameStatusPreviewInspectUpdated (UTC)
tripwire / web (preview)ReadyVisit PreviewInspectNov 7, 2026 6:52am

Changes requested

tripwire-sh[bot] · 2 weeks ago

Blocked. See the comment.

tripwire-sh[bot]commented· 2 weeks ago

@detail-app[bot], Tripwire blocked this change request.

Rate limit: You opened 52 change requests in a short time. Wait before you open another.

View on Tripwire

How do I fix this?

A new commit will not fix this.

If you think it should merge anyway, say so in a comment. A maintainer will decide.

Review

capy-ai[bot] · 2 weeks ago

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

detail-app[bot]commented· 2 weeks ago

Re: github.com/Boring-Software-Inc/…/179 / github.com/Boring-Software-Inc/…/179

This block is a Tripwire rate-limit rule (52 change requests opened in a short time), not a defect in this PR's diff. Per Tripwire's own message, a new commit will not clear it, and whether this PR should merge despite the block is a maintainer decision I can't make from the repository. No code change pushed.

Sign in to comment.

Merge readiness

Checking mergeability after the indexing worker computes the current branch state.

Autopilot

Debug

Reviews

Approved0
ReviewersNone yet

Configure an OpenRouter key in repository settings.