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

Skip to content

fix(coderd/templatebuilder): prompt for DigitalOcean base variables - #27268

Merged
jeremyruppel merged 1 commit into
mainfrom
jeremy/devex-591-fix-missing-variable-prompts-in-the-digitalocean-base
Jul 15, 2026
Merged

fix(coderd/templatebuilder): prompt for DigitalOcean base variables#27268
jeremyruppel merged 1 commit into
mainfrom
jeremy/devex-591-fix-missing-variable-prompts-in-the-digitalocean-base

Conversation

@jeremyruppel

@jeremyruppel jeremyruppel commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

The DigitalOcean template builder base declared Terraform variable blocks for project_uuid and ssh_key_id that the template builder never filled. project_uuid was 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:

  • Declare project_uuid (required) and ssh_key_id (optional, default 0) in base.json so the wizard prompts for them on the first step.
  • Inject the entered values via default = {{ .Variables.* }} in main.tf.tmpl, keeping the existing variable blocks and validation.
  • Drop the sensitive flags. 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.
  • Update the README now that the values are prompted rather than manually edited.
  • Regenerate the digitalocean-linux.tf.golden snapshot.

Testing

  • go test ./coderd/templatebuilder/
Screenshot 2026-07-15 at 12 44 42 PM
Audit of all template builder bases for unfilled variables
Base Variable status Verdict
aws-linux no HCL variable blocks; provider env auth OK
aws-windows same OK
azure-linux same OK
digitalocean-linux project_uuid (required, no default) + ssh_key_id; absent from base.json Fixed here
docker docker_socket has default = ""; container_image via {{ .Variables }} + declared OK
gcp-linux fixed in #27015 OK
gcp-windows fixed in #27015 OK
kubernetes namespace (required), use_kubeconfig, container_image all via {{ .Variables }} + declared OK
scratch no variables OK

DigitalOcean was the only broken base; all others either have safe defaults or already declare their variables.

Mechanism note: base.json variables[] 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 the sensitive flags were removed here.


This PR was generated by Coder Agents on behalf of @jeremyruppel.

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.
@linear-code

linear-code Bot commented Jul 15, 2026

Copy link
Copy Markdown

DEVEX-591

@jeremyruppel
jeremyruppel marked this pull request as ready for review July 15, 2026 16:40
@jeremyruppel
jeremyruppel requested review from aqandrew and aslilac July 15, 2026 16:40
@jeremyruppel
jeremyruppel merged commit d0982e3 into main Jul 15, 2026
59 of 60 checks passed
@jeremyruppel
jeremyruppel deleted the jeremy/devex-591-fix-missing-variable-prompts-in-the-digitalocean-base branch July 15, 2026 18:05
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 15, 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