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

chore: purge identified terraform modules via dbpurge (#28802) - #28814

Merged
Emyrk merged 1 commit into
release/2.35from
stevenmasley/2.35_cherry_modules
Sep 1, 2026
Merged

chore: purge identified terraform modules via dbpurge (#28802)#28814
Emyrk merged 1 commit into
release/2.35from
stevenmasley/2.35_cherry_modules

Conversation

@Emyrk

@Emyrk Emyrk commented Sep 1, 2026

Copy link
Copy Markdown
Member

Cherry-pick of #28802 (e2a856d42b), matching #28810 for release/2.37.

Deletes cached Terraform module archives ingested during the identified window and clears the template version references to them. Runs from dbpurge rather 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, the ranModuleCachePurge latch, the window constants, the identified_module_files log field and metric, and the identifiedModuleCachePurged instance field. Dropped the chat_messages.search_tsv backfill and stale reindex, along with staleDrained and the chatSearch* fields, none of which exist on this branch.
  • dbpurge_test.go: took TestDeleteIdentifiedModuleCacheFiles and the awaitDoTicks helper it depends on. Dropped TestBackfillChatMessagesSearchTsv. In the two TestMetrics mock setups, added only the DeleteCachedModuleFilesCreatedBetween expectation.
  • Generated files (querier.go, queries.sql.go, dbmetrics, dbmock, and the dbauthz stub) were reset to the branch state and regenerated from queries/files.sql, rather than taking the diff from main. Taking main's versions would have introduced methods for queries that do not exist on this branch.

Testing

coderd/database/dbpurge and TestMethodTestSuite in coderd/database/dbauthz pass against Postgres. make gen is clean and pre-commit hooks pass.


Opened by Coder Agents on behalf of @Emyrk.

(cherry picked from commit dc1a54c)
(cherry picked from commit e2a856d)
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@Emyrk
Emyrk marked this pull request as ready for review September 1, 2026 00:54
@Emyrk
Emyrk merged commit 7b95f85 into release/2.35 Sep 1, 2026
54 checks passed
@Emyrk
Emyrk deleted the stevenmasley/2.35_cherry_modules branch September 1, 2026 01: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