Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
Clean, well-structured PR that adds snapshot eviction, lifecycle cleanup, and merge-triggered invalidation. The implementation closely follows the existing orphan-cleanup pattern, tests are thorough, and all CI checks pass. LGTM.
Minor Observations (non-blocking)
-
Misleading log value in Phase 2 eviction (
src/router/snapshot-manager.ts:179): ThesnapshotCountfield logged during max-count eviction usessnapshots.size + (toRemove - i), but since the delete has already happened on line 174, this produces an inflated value rather than the pre-eviction count. For example, if you start with 8 snapshots and maxCount=5 (toRemove=3), the first eviction logs snapshotCount=10 instead of 8. Consider usingsnapshots.size + 1to log the count just before this deletion, or remove the field sincemaxCountalready communicates the threshold. Cosmetic-only — doesn't affect behavior. -
imageSizeBytesnot yet plumbed in production:registerSnapshotincontainer-manager.ts(line 91) is called without the newimageSizeBytesparameter, so all production snapshots will haveimageSizeBytes: undefinedand contribute 0 to the size budget. This means the max-size eviction phase is effectively a no-op until a follow-up PR wires the image size through. The code is correct as-is (gracefully handlesundefined), just worth noting for future work.
🕵️ claude-code · claude-opus-4-6 · run details
Summary
snapshot-manager.tswithevictSnapshots()enforcing per-project TTL plus global max-count and max-size budget limits (oldest-first eviction order)snapshot-cleanup.tsmodule withstartSnapshotCleanup()/stopSnapshotCleanup()running every 5 minutes alongside the existing orphan cleanup loopworker-manager.tsstarts and stops snapshot cleanup alongside orphan cleanup with no timer leaksPRMergedTriggerandTrelloStatusChangedMergedTriggercallinvalidateSnapshot()fire-and-forget when a work item reaches merged statusTest plan
evictSnapshots— TTL eviction, max-count eviction, max-size eviction, combined phase ordering, no-op when under budget, graceful handling of snapshots with no sizestartSnapshotCleanup/stopSnapshotCleanup— idempotent start, safe stop when not started, multiple start/stop cyclesrunSnapshotCleanup— callsevictSnapshotswith routerConfig valuesstartWorkerProcessorstarts snapshot cleanup;stopWorkerProcessorstops itPRMergedTrigger— invalidates snapshot on merged PR, skips when PR not merged, skips when no work item linkedTrelloStatusChangedMergedTrigger— invalidates snapshot on card moved to merged, skips when trigger disabledCard
https://trello.com/c/69c2921d5515c7e2c229b00b
🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details