fix(coderd/templatebuilder): prompt for DigitalOcean base variables - #27268
Merged
jeremyruppel merged 1 commit intoJul 15, 2026
Conversation
The DigitalOcean base declared Terraform variable blocks for
project_uuid and ssh_key_id that the template builder never filled,
leaving project_uuid without a value and breaking the build.
Declare both variables in base.json so the wizard prompts for them on
the first step, and inject the values via {{ .Variables.* }} defaults,
mirroring the GCP bases. Drop the sensitive flags so the injection
mechanism (which skips sensitive variables) can supply the values, and
update the README now that the values are prompted rather than manually
edited.
aslilac
approved these changes
Jul 15, 2026
jeremyruppel
deleted the
jeremy/devex-591-fix-missing-variable-prompts-in-the-digitalocean-base
branch
July 15, 2026 18:05
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.
Summary
The DigitalOcean template builder base declared Terraform
variableblocks forproject_uuidandssh_key_idthat the template builder never filled.project_uuidwas required with no default, so the build broke with no way to supply a value from the wizard (DEVEX-591).This brings the DigitalOcean base to parity with the GCP bases fixed in #27015:
project_uuid(required) andssh_key_id(optional, default0) inbase.jsonso the wizard prompts for them on the first step.default = {{ .Variables.* }}inmain.tf.tmpl, keeping the existingvariableblocks and validation.sensitiveflags. The variable-injection path (mergeBaseVariables,DefaultBaseRenderContext, and the snapshot test helper) skips sensitive variables, so a sensitive base variable renders empty. A project UUID / SSH key ID are not secrets.digitalocean-linux.tf.goldensnapshot.Testing
go test ./coderd/templatebuilder/Audit of all template builder bases for unfilled variables
variableblocks; provider env authproject_uuid(required, no default) +ssh_key_id; absent frombase.jsondocker_sockethasdefault = "";container_imagevia{{ .Variables }}+ declarednamespace(required),use_kubeconfig,container_imageall via{{ .Variables }}+ declaredDigitalOcean was the only broken base; all others either have safe defaults or already declare their variables.
Mechanism note:
base.jsonvariables[]drives the first-step prompts and values are injected as HCL literals via{{ .Variables.<name> }}(strings quoted, numbers/bools raw; supported types: string, number, bool). Sensitive/computed variables are intentionally skipped everywhere the injection map is built, so they cannot currently be injected. That is why thesensitiveflags were removed here.This PR was generated by Coder Agents on behalf of @jeremyruppel.