{{ message }}
chore: purge identified terraform modules via dbpurge (#28802) - #28814
Merged
Conversation
Contributor
Emyrk
marked this pull request as ready for review
September 1, 2026 00:54
cstyan
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Cherry-pick of #28802 (
e2a856d42b), matching #28810 forrelease/2.37.Deletes cached Terraform module archives ingested during the identified window and clears the template version references to them. Runs from
dbpurgerather than a migration, because migrations cannot be backported: the version table records a single high-water mark, so a migration cherry-picked here would cause later upgrades to skip every migration in between.Conflict resolution
The commit did not apply cleanly. This branch predates the chat search work on
main, so the incoming hunks carried unrelated context that was dropped:dbpurge.go: took only the module cache block, theranModuleCachePurgelatch, the window constants, theidentified_module_fileslog field and metric, and theidentifiedModuleCachePurgedinstance field. Dropped thechat_messages.search_tsvbackfill and stale reindex, along withstaleDrainedand thechatSearch*fields, none of which exist on this branch.dbpurge_test.go: tookTestDeleteIdentifiedModuleCacheFilesand theawaitDoTickshelper it depends on. DroppedTestBackfillChatMessagesSearchTsv. In the twoTestMetricsmock setups, added only theDeleteCachedModuleFilesCreatedBetweenexpectation.querier.go,queries.sql.go,dbmetrics,dbmock, and thedbauthzstub) were reset to the branch state and regenerated fromqueries/files.sql, rather than taking the diff frommain. Takingmain's versions would have introduced methods for queries that do not exist on this branch.Testing
coderd/database/dbpurgeandTestMethodTestSuiteincoderd/database/dbauthzpass against Postgres.make genis clean and pre-commit hooks pass.Opened by Coder Agents on behalf of @Emyrk.