chore: add template toggle to disable module caching#21931
Conversation
| @@ -0,0 +1,16 @@ | |||
| DROP VIEW template_with_names; | |||
| ALTER TABLE templates ADD COLUMN disable_module_cache BOOL NOT NULL DEFAULT false; | |||
There was a problem hiding this comment.
Make users opt into the legacy behavior.
There was a problem hiding this comment.
TBH I prefer having configuration flags being positive as opposed to negative, so enable_module_cache with default true would be my suggestion. Not a blocker though.
Documentation CheckNew Documentation NeededThis PR adds a new template setting that allows disabling Terraform module caching. Documentation should be added to help template admins understand when and why to use this feature.
Why Documentation is Needed
Automated review via Coder Tasks |
| @@ -0,0 +1,16 @@ | |||
| DROP VIEW template_with_names; | |||
| ALTER TABLE templates ADD COLUMN disable_module_cache BOOL NOT NULL DEFAULT false; | |||
There was a problem hiding this comment.
TBH I prefer having configuration flags being positive as opposed to negative, so enable_module_cache with default true would be my suggestion. Not a blocker though.
| } | ||
| if err == nil && tfvals.CachedModuleFiles.Valid { | ||
| versionModulesFile = tfvals.CachedModuleFiles.UUID.String() | ||
| if !template.DisableModuleCache { |
There was a problem hiding this comment.
This is what I mean, the other way round it would be
if template.EnableModuleCache { ... }
Aside, the below comment is also a bit confusing as it implies that the logic is related to DisableModuleCache being true?
There was a problem hiding this comment.
I will delete that comment, it provides no help.
I do agree the inversion is not great. But I like that the zero value in golang is the correct default
site/src/pages/TemplateSettingsPage/TemplateGeneralSettingsPage/TemplateSettingsForm.tsx
Outdated
Show resolved
Hide resolved
I agree, but I also want the Golang zero value to be the default |
johnstcn
left a comment
There was a problem hiding this comment.
I'm OK with this change, besides the things I've already mentioned.
(Also, the unrelated golden file changes)
| "id": "eb9b7f18-c277-48af-af7c-2a8e5fb42bab" | ||
| }, | ||
| { | ||
| "workspace_folder": "/workspace2", | ||
| "config_path": "/workspace2/.devcontainer/devcontainer.json", | ||
| "name": "dev2", | ||
| "id": "964430ff-f0d9-4fcb-b645-6333cf6ba9f2", | ||
| "subagent_id": "40a59d56-d3df-488f-b07d-331c0b774bac" | ||
| "id": "964430ff-f0d9-4fcb-b645-6333cf6ba9f2" | ||
| } |
There was a problem hiding this comment.
I don't know what is going on. Fresh workspace, git clean -xfd, make gen -B 🤔
Documentation CheckUpdates Needed
ContextThis PR adds a The API documentation and audit logs are already updated in this PR. User-facing documentation should explain:
Automated review via Coder Tasks |
I'm not going to document a feature I don't want people to use. The warning label in the product is enough imo. How I tell the tasks bot "No"? |
|
The chromatic failures are unrelated to my change |
I think you can just ignore it? |
Ah, it is not required. I'm merging in spite of docs and chromatic |
There exists use cases to disable the new module caching behavior of workspace builds. This was the legacy behavior.