Repository navigation
refactor(infra): remove update campaign test constructor seam - #138398
Conversation
Use the default UUID, clock, and timer boundaries directly while retaining per-instance UUID function capture and campaign lifecycle behavior. Drive the owner fixture through a partial crypto mock and existing fake timers, removing the constructor dependency bag without changing the 21 owner cases.
|
🦞👀 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 4, 2026, 8:51 PM ET / September 5, 2026, 00:51 UTC. ClawSweeper reviewWhat this changesRemoves test-only clock, timer, and ID constructor inputs from automatic-update scheduling, using test mocks instead without intended scheduling changes. Merge readiness✅ Ready for maintainer review Keep open: this is useful, bounded cleanup that is absent from fetched main and v2026.9.1. No blocking correctness or security finding was identified, and the verified test merge preserves newer base-branch behavior. Priority: P3 Review scores
Verification
How this fits togetherThe update-campaign controller coordinates the waiting period between discovering an available update and starting installation. It combines active-work inspection, deadlines, and administrator actions, then publishes campaign state and invokes the existing updater. flowchart TD
A[Available update] --> C[Update campaign controller]
B[Active work and clock] --> C
D[Hold or update now] --> C
C --> E{Wait or apply}
E -->|Wait| F[Schedule next check]
F --> C
E -->|Apply| G[Existing updater]
C --> H[Published update status]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -15, Tests +7. Total -8 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Preserve the single campaign owner and its timing, adoption, and cleanup contracts without retaining a test-only constructor API or introducing a replacement abstraction. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR removes a source-confirmed test-only construction path rather than fixing a reported runtime failure; no new failing behavior was reproduced. Is this the best way to solve the issue? Yes: production already uses the default constructor, so deleting the unused injection bag is simpler than preserving or replacing it, while the existing behavioral cases remain intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4d132d8cbd47. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…aw#138398) Use the default UUID, clock, and timer boundaries directly while retaining per-instance UUID function capture and campaign lifecycle behavior. Drive the owner fixture through a partial crypto mock and existing fake timers, removing the constructor dependency bag without changing the 21 owner cases.
What Problem This Solves
Maintainer-requested cleanup of automatic-update campaign ownership. The production controller carried UUID, clock, and timer injection options used only by its test fixture, leaving an unnecessary alternate construction path.
Why This Change Was Made
Use the existing default constructor, Node UUID function, and global clock/timer boundaries directly. Keep per-instance UUID function capture, campaign transitions, observer ordering, holds, stale-settlement protection, timer cancellation, and the distinct
resetForTest()behavior unchanged. The fixture uses a partial crypto mock and its existing fake timers; all 21 case bodies and literal expectations are retained.Production: +9/−24 (net −15). Tests: +14/−7 (net +7). No new dependency, configuration, schema, or public RPC surface.
User Impact
No intended user-facing behavior change. Automatic-update scheduling and manual campaign adoption keep the same owner and lifecycle.
Evidence
85d3f1a39fbb1fc06808874aa29bca0f6750387a.cf349c0cfound the 12 campaign/startup/RPC/schema owner and test files unchanged from the tested base. This is source evidence, not a fresh integration test.The first original sibling run timed out in a hold test and then observed a twice-called mock. Unchanged warm hold and complete sibling runs subsequently passed; the precise cold scheduling cause remains unproved, and that failure is not waived. Startup/RPC coverage mocks updater/service/network boundaries; no real upgrade or native Windows run is claimed. The changed gate retained a post-success portal-sync timeout warning. Exact-head hosted PR CI 33895229104, attempt 1 passed on
85d3f1a39fbb1fc06808874aa29bca0f6750387a(110 successful jobs, 17 skipped).