fix(sync): PR hydration fails on overlapping check-run pages - #201
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 13, 2026, 4:50 PM ET / 20:50 UTC. ClawSweeper reviewWhat this changesConsolidate repeated GitHub check-run IDs before saving PR details, retaining first-seen order and the latest fetched observation, with regression coverage and a changelog entry. Merge readiness⛔ Blocked before merge - 1 item remains This repair remains useful: current main and v0.9.6 still pass repeated check-run observations to storage. No blocking defect was found in the introduced patch. Priority: P2 Review scores
Verification
How this fits togetherGitcrawl fetches GitHub pull-request details into a local SQLite archive for search and review. Check-run ingestion converts paginated API responses into the check snapshots saved with each PR. flowchart LR
A[PR detail sync] --> B[GitHub check-run pages]
B --> C[Lossless ID decoding]
C --> D[Consolidate repeated IDs]
D --> E[Atomic SQLite write]
E --> F[Local PR review and search]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep identity consolidation at check ingestion and preserve atomic failure handling; any broader storage-identity migration should remain separate. Do we have a high-confidence way to reproduce the issue? Yes, for the duplicate-observation mechanism: advancing pages containing the same named check ID and nonempty URL reach conflicting SQLite inserts on main. Source and the supplied regression establish that path; this review did not execute it or establish the original incident's cause. Is this the best way to solve the issue? Yes. Consolidating by the existing lossless provider ID is a narrow repair that avoids weakening database constraints or changing unrelated pagination behavior. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against b132e5b7816a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Maintainer decision for ClawSweeper's merge-risk item, at unchanged head The native regression proves that repeated observations cause the SQLite collision on the base and that this ingestion repair fixes that trigger. The original failed payload was not retained, so its historical cause remains unproven. This PR does not claim to fix distinct provider IDs sharing the legacy name/details-URL key. Those collisions still roll back atomically and retain failure-ledger evidence, as the regression verifies. Named follow-up: check-run storage identity for distinct provider IDs sharing the legacy key. Any broader storage-contract migration requires separate review and acceptance; it is not being folded into this repair. This is the mitigation recommended by the review: consolidate identity at ingestion and preserve atomic failure handling. Exact-tree CI and Docker passed, as did native branch and independent source reviews. The risk decision is explicit; no check or review is waived. |
What Problem This Solves
Fixes PR hydration failing when overlapping GitHub check-run pages contain the same provider ID more than once.
User Impact
PR hydration retains each observed check-run identity once, in first-seen API order, using its latest fetched observation. No schema migration, rebuild, configuration change, or portable-profile change is required.
Distinct provider IDs sharing the same stored name/details URL can still violate the existing SQL key. They are not silently collapsed: the item rolls back and remains retryable. Supporting that separate case requires a reviewed storage-contract migration.
Why This Change Was Made
Consolidation belongs at check ingestion, where the lossless provider ID is available. Replacing the entire repeated observation avoids mixing old and later fetched fields; missing IDs remain separate. Generic pagination and database conflict behavior are unchanged.
The name/details-URL uniqueness key dates to the May 5, 2026 PR-cache implementation. This is storage-contract context, not proof of the original incident's cause.
Evidence
b132e5b7816ae622646ba4745682510f854d26b0with SQLite 2067 onpull_request_checks(thread_id, name, details_url), then passes with this change.-race.0763805b97f8c90780498029e437a8e0701943cb; its treeba588163befa415c0edfb60543c3ef7e627d10dcexactly matches head1ceae73a8b9fa33224108ed1858872f446a329e9.