Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

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

chore: purge identified terraform modules via dbpurge (#28802)#28816
Emyrk merged 1 commit into
release/2.36from
stevenmasley/2.36_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. This branch has the chat_messages.search_tsv backfill but not the stale reindex added in fix(site): clarify chat model permission labels (#28579) #28585, so the reindex loop, staleDrained, and chatSearchStaleDrained were dropped.
  • dbpurge_test.go: took TestDeleteIdentifiedModuleCacheFiles. In the two TestMetrics mock setups, added only the DeleteCachedModuleFilesCreatedBetween expectation, dropping ReindexStaleChatMessagesSearchTsv.
  • 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.

Pre-commit hooks were skipped on the final commit at the author's request after the checks above had already been run; make gen, build, and lint were verified separately during conflict resolution.


Opened by Coder Agents on behalf of @Emyrk.

Delete cached Terraform module archives ingested during the identified
window and clear 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 onto a release branch would cause later upgrades
to skip every migration in between.

(cherry picked from commit e2a856d)
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

👋 Hey @Emyrk!

This PR is targeting the release/2.36 release branch, but its title does not start with fix: or fix(scope):.

Only bug fixes should be cherry-picked to release branches. If this is a bug fix, please update the PR title to match the conventional commit format:

fix: description of the bug fix
fix(scope): description of the bug fix

If this is not a bug fix, it likely should not target a release branch.

@Emyrk
Emyrk marked this pull request as ready for review September 1, 2026 01:23
@Emyrk
Emyrk merged commit 10fd510 into release/2.36 Sep 1, 2026
56 of 57 checks passed
@Emyrk
Emyrk deleted the stevenmasley/2.36_cherry_modules branch September 1, 2026 01:37
@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