chore: purge identified terraform modules via dbpurge by Emyrk · Pull Request #28802 · coder/coder · GitHub
Skip to content

chore: purge identified terraform modules via dbpurge - #28802

Merged
Emyrk merged 4 commits into
mainfrom
stevenmasley/dbpurge-modules
Sep 1, 2026
Merged

chore: purge identified terraform modules via dbpurge#28802
Emyrk merged 4 commits into
mainfrom
stevenmasley/dbpurge-modules

Conversation

@Emyrk

@Emyrk Emyrk commented Aug 31, 2026

Copy link
Copy Markdown
Member

No description provided.

@Emyrk

Emyrk commented Aug 31, 2026

Copy link
Copy Markdown
Member Author

@coder-agents-review

coder-agents-review Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Chat: Review posted | View chat
Requested: 2026-08-31 23:44 UTC by @Emyrk

Review history
  • R1 (2026-08-31), 1 Nit, 2 Note, 1 P0, 1 P2, 1 P3, COMMENT. Review

deep-review v0.9.0 | Round 1 | a93b225..99c52af

Last posted: Round 1, 6 findings (1 P0, 1 P2, 1 P3, 1 Nit, 2 Note), COMMENT. Review

Finding inventory

Finding inventory - PR #28802

Findings

# Sev Status Location Summary Round Reviewer Posted
CRF-1 P0 Open dbpurge_test.go:3439 Test window does not match production constants; test deterministically fails (the CI failure) R1 Netero Yes
CRF-2 P2 Open files.sql:70 INNER JOIN limits purge to referenced archives; unreferenced identified copies survive R1 Netero Yes
CRF-3 P3 Open files.sql:75 mimetype predicate has no test coverage R1 Netero Yes
CRF-4 Nit Open dbpurge_test.go:3450 Doc comment sits on mkFile but describes mkVersion R1 Netero Yes
CRF-5 Note Open dbpurge.go:73 Per-process latch: coderd started inside the window sweeps only elapsed part R1 Netero Yes
CRF-6 Note Open files.sql:74 Identifying literals duplicated from Go into SQL with no link R1 Netero Yes

Round log

Round 1

Netero-only first-pass gate. P0 (test window mismatch, matches the CI failure), 1 P2, 1 P3, 1 Nit, 2 Notes. Panel not yet run; deferred until mechanical floor is clean. Reviewed against a93b225..99c52af.

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Komugi flake/determinism
Kurapika security
Law decomposition
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

…t window

The test copied the ingest window from the production constants. Widening
those constants to 08:00-22:00 left the copy at 08:35:52-09:09, so the
fixture placed at the exclusive upper bound fell inside the real window
and was deleted, failing the boundary assertion.

Pass the window through a WithIdentifiedModuleCacheWindow option instead,
matching WithChatSearchBackfillLimits. The test then asserts the boundary
behavior it is actually about, and revising the incident timestamps
cannot invalidate it. An internal test guards the constants themselves.

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First-pass review only. These are mechanical findings from Netero; the full review panel has not yet reviewed this PR. The panel will review once the first-pass findings, particularly the P0, are addressed.

The change is well-scoped: a one-off dbpurge cleanup guarded by a per-process latch, with a data-modifying CTE that clears the FK reference before deleting the file, and a thorough integration test covering both bounds, the negative cases, and the latch. The rationale comments on why this lives in dbpurge rather than a migration are genuinely useful.

One blocker: the integration test's window constants do not match the production constants, so the test deletes fixtures it asserts should survive and fails deterministically. This is the red CI (test-go-pg, test-go-pg-17). As Netero put it, the boundary assertions are "worthless as written: neither windowStart nor windowEnd is a boundary of the code under test." Deriving the fixtures from the production constants (export them, or make the window an instance field set by an option) fixes the failure and stops the test from drifting from the code again.

Severity count: 1 P0, 1 P2, 1 P3, 1 Nit, 2 Notes.

🤖 This review was automatically generated with Coder Agents.

Comment thread coderd/database/dbpurge/dbpurge_test.go Outdated
Comment thread coderd/database/queries/files.sql
Comment thread coderd/database/queries/files.sql
Comment thread coderd/database/dbpurge/dbpurge_test.go Outdated
Comment thread coderd/database/dbpurge/dbpurge.go
Comment thread coderd/database/queries/files.sql
@Emyrk
Emyrk marked this pull request as ready for review September 1, 2026 00:05
@Emyrk
Emyrk requested a review from cstyan September 1, 2026 00:11
@Emyrk
Emyrk merged commit dc1a54c into main Sep 1, 2026
28 checks passed
@Emyrk
Emyrk deleted the stevenmasley/dbpurge-modules branch September 1, 2026 00:24
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants