Skip to content

fix(review): close review-thread and claim-time gaps - #1791

Merged
JSONbored merged 1 commit into
mainfrom
codex/review-blocker-followup
Jun 29, 2026
Merged

fix(review): close review-thread and claim-time gaps#1791
JSONbored merged 1 commit into
mainfrom
codex/review-blocker-followup

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Fixes the two review blockers left after #1781:

  • paginates live review-thread GraphQL reads so unresolved blockers beyond the first 50 threads still block
  • preserves linked-issue claim time when a PR expands an existing linked issue set, while resetting disjoint or cleared sets

What changed

  • Added reviewThreads cursor pagination and cursor-loop guards in src/github/backfill.ts.
  • Added overlap-aware linkedIssueClaimedAt resolution in src/db/repositories.ts.
  • Added regressions for second-page review threads, repeated/missing cursors, and linked-issue claim-time transitions.

Why

The review gate could miss unresolved review threads after the first GraphQL page, and duplicate-winner election could lose the original claim timestamp when a PR added another linked issue.

Validation

  • git diff --check
  • npx vitest run test/unit/backfill.test.ts test/unit/db-parsers.test.ts
  • npm run validate

@dosubot dosubot Bot added the size:L label Jun 29, 2026
@loopover-orb

loopover-orb Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-06-29 23:43:15 UTC

4 files · 1 AI reviewer · 1 blocker · readiness 68/100 · CI pending · unknown

⏸️ Suggested Action - Manual Review

  • The AI review flagged a possible must-fix defect below the automatic close-confidence floor, so the gate is held for a human reviewer instead of passed automatically.

Review summary
The diff correctly moves live review-thread reads toward cursor pagination and centralizes linked-issue claim-time resolution, with useful regression coverage for second-page threads and basic claim transitions. The review-thread loop still treats incomplete pagination as a successful read, and the database change regresses the previous atomic conflict update by computing the timestamp from a stale pre-upsert snapshot.

Blockers

  • src/github/backfill.ts:2287 and src/github/backfill.ts:2297 silently stop pagination on a failed/malformed next page, missing cursor, or repeated cursor after GitHub has reported `hasNextPage: true`, so a PR whose only unresolved review thread is on the unread page returns `[]` from incomplete live data.
  • src/db/repositories.ts:355 replaces the conflict-time SQL `CASE` with a value computed before the upsert, so concurrent upserts can overwrite the row's current `linkedIssueClaimedAt` with a later observed timestamp when the row changes between the SELECT and `ON CONFLICT` update.
Nits — 7 non-blocking
  • nit: test/unit/db-parsers.test.ts:92 covers same, expansion, disjoint, and cleared sets, but it does not cover the partial-overlap policy such as `[1,2] -> [2,3]`; add that case or tighten `resolveLinkedIssueClaimedAt` if only strict expansion should preserve the timestamp.
  • nit: test/unit/backfill.test.ts:3454 asserts a missing cursor still returns an already-fetched blocker, but it does not exercise the more dangerous no-prior-blocker case where the current code returns an empty list from an incomplete read.
  • In `src/github/backfill.ts`, distinguish incomplete pagination from an empty result and either propagate an error or return a synthetic review-thread blocker when `hasNextPage` is true but the next cursor/connection cannot be trusted.
  • In `src/db/repositories.ts`, keep the overlap-aware claim-time resolution inside the `ON CONFLICT` update using the current `pullRequests.linkedIssuesJson` and `pullRequests.linkedIssueClaimedAt`, or serialize the read/write in a transaction.
  • Add regressions for a second-page fetch failure with no first-page blockers and for stale/concurrent existing-row state during `upsertPullRequestFromGitHub`.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
  • AI reviewers agree on a likely critical defect: src/github/backfill.ts:2287 and src/github/backfill.ts:2297 silently stop pagination on a failed/malformed next page, missing cursor, or repeated cursor after GitHub has reported `hasNextPage: true`, so a PR whose only unresolved review thread is on the unread page returns `[]` from incomplete live data. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Concerns raised — review before merging

  • src/github/backfill.ts:2287 and src/github/backfill.ts:2297 silently stop pagination on a failed/malformed next page, missing cursor, or repeated cursor after GitHub has reported `hasNextPage: true`, so a PR whose only unresolved review thread is on the unread page returns `[]` from incomplete live data.
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ⚠️ 1 scoped overlap Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (size label size:L; no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 2 registered-repo PR(s), 2 merged, 278 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 2 PR(s), 278 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 2 PR(s), 278 issue(s).
  • Related work: Titles/paths share 6 meaningful terms. (PR #1765)
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Triage stale or unlinked PRs.
  • No action.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
  • Check active issues and PRs before submitting.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.65%. Comparing base (791d95d) to head (8b5286b).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1791      +/-   ##
==========================================
- Coverage   95.75%   95.65%   -0.11%     
==========================================
  Files         212      214       +2     
  Lines       23112    23236     +124     
  Branches     8350     8394      +44     
==========================================
+ Hits        22132    22227      +95     
- Misses        401      417      +16     
- Partials      579      592      +13     
Files with missing lines Coverage Δ
src/db/repositories.ts 96.19% <100.00%> (+0.03%) ⬆️
src/github/backfill.ts 93.52% <100.00%> (-0.03%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored force-pushed the codex/review-blocker-followup branch from 8e84eb6 to 8b5286b Compare June 29, 2026 23:42
@JSONbored
JSONbored merged commit 582a72c into main Jun 29, 2026
16 checks passed
@JSONbored
JSONbored deleted the codex/review-blocker-followup branch June 29, 2026 23:44
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant