Repository navigation
refactor(team-reports): await persistence and drain shutdown - #144646
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: needs maintainer review before merge. Reviewed September 11, 2026, 12:23 AM ET / 04:23 UTC. ClawSweeper reviewWhat this changesTeam Reports makes storage operations awaitable and drains admitted report work before closing its database during shutdown. Merge readiness✅ Ready for maintainer review Keep open: this focused storage-boundary conversion remains useful and follows the linked maintainer coordination issue. No blocking defect was found in the introduced changes. Priority: P2 Review scores
Verification
How this fits togetherTeam Reports collects GitHub activity and optional Discord discussion, stores reports in SQLite, and serves them through authenticated HTTP pages and Gateway commands. Its scheduler coordinates collection, summarization, persistence, and shutdown. flowchart TD
A[Schedule or manual request] --> B[Reserve and record run]
B --> C[Collect activity and summarize]
C --> D[SQLite report storage]
D --> E[Authenticated pages and commands]
F[Service shutdown] --> G[Stop admission and drain work]
G --> D
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +65, Tests +188, Docs +2. Total +255 across 11 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one scheduler responsible for report admission and database disposal, with callers awaiting durable outcomes and cancellation confined to external work. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a coordinated storage-contract refactor rather than a reported current-main failure; source inspection confirms the synchronous baseline. Is this the best way to solve the issue? Yes: the patch converts the existing owner and its callers together while preserving SQLite transactions, stored formats, and public response shapes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 068318110aec. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Related: #144592
What Problem This Solves
Team Reports owns synchronous database operations across startup, scheduling, HTTP handlers and shutdown. Awaiting these operations requires shutdown to account for work admitted before it stops, including a run record that is still being created.
Why This Change Was Made
Convert the store factory, queries, mutations and close operation to asynchronous contracts and migrate all callers. The scheduler reserves a run before awaiting persistence and drains admitted database work before closing the store. Cancellation interrupts external collection and model work; final database outcomes are allowed to settle. Startup publishes one scheduler/store owner only after initialization succeeds and closes an instance retired during startup.
Remove the duplicate store-closing owner. Prepared in-memory organization and people accessors stay synchronous. The SQLite schema, transaction callbacks and retention policy are unchanged.
User Impact
Reports keep their existing API and scheduling behavior. Startup and shutdown consistently own pending persistence, preventing store closure underneath an admitted report run.
Evidence
CI initially timed out in the unchanged managed-update refusal process test. The exact candidate case passed locally in 1.60 seconds with its original 60-second deadline and journal-immutability assertions; the same-head failed-job rerun is green. No Team Reports or test changes were needed.