From 278163c6bec86d4d92bf75d8e3b91dc300c8bc17 Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Thu, 30 Jul 2026 11:28:54 -0600 Subject: [PATCH 1/3] feat(vscode): add Go extension by default, DRY the extensions list across templates Enables golang.go by default in all three templates and pre-installs gopls via Homebrew alongside the existing go/golangci-lint so the extension doesn't need to fetch it on first use. The vscode_extensions variable was identical in all three template.tf files. Extracted it into shared/vscode-extensions.tf, vendored into each template directory the same way modules/claude-remote-control already is (coder templates push and CI only ever see one template directory, so a relative ../shared reference wouldn't survive. make push-template-* / validate / test-templates now depend on a new sync-shared target so the vendoring happens automatically. Co-Authored-By: Claude Sonnet 5 EOF ) --- CLAUDE.md | 22 +++++++++++++--------- Makefile | 20 +++++++++++++++----- drupal-contrib/template.tf | 25 ------------------------- drupal-contrib/vscode-extensions.tf | 25 +++++++++++++++++++++++++ drupal-core/template.tf | 25 ------------------------- drupal-core/vscode-extensions.tf | 25 +++++++++++++++++++++++++ freeform/template.tf | 25 ------------------------- freeform/vscode-extensions.tf | 25 +++++++++++++++++++++++++ image/Dockerfile | 1 + shared/vscode-extensions.tf | 25 +++++++++++++++++++++++++ 10 files changed, 129 insertions(+), 89 deletions(-) create mode 100644 drupal-contrib/vscode-extensions.tf create mode 100644 drupal-core/vscode-extensions.tf create mode 100644 freeform/vscode-extensions.tf create mode 100644 shared/vscode-extensions.tf diff --git a/CLAUDE.md b/CLAUDE.md index 8a8cdca..4c91225 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -59,19 +59,23 @@ Run these before every push to avoid CI failures: # Terraform formatting (CI runs terraform fmt -check -recursive) terraform fmt -recursive -# Terraform validation for each template you touched -terraform -chdir=drupal-core init -backend=false && terraform -chdir=drupal-core validate -terraform -chdir=drupal-contrib init -backend=false && terraform -chdir=drupal-contrib validate -terraform -chdir=freeform init -backend=false && terraform -chdir=freeform validate - -# Terraform tests (plan-level, no real infrastructure) -terraform -chdir=drupal-core test -terraform -chdir=drupal-contrib test -terraform -chdir=freeform test +# Vendor shared assets, then validate + test every template +make validate +make test-templates ``` `terraform fmt -recursive` must be run from the repo root. It is non-destructive (rewrites in place) and the CI check fails with exit code 3 if any file is not formatted. +**Always use `make validate` / `make test-templates`, not raw `terraform validate`/`terraform test` run directly in a template directory.** Both targets depend on `make sync-shared`, which vendors `modules/claude-remote-control` and `shared/vscode-extensions.tf` into each template directory first (see "Shared Terraform Assets" below). Running `terraform validate`/`test` directly against a template dir will happily validate against a stale vendored copy and miss the fact that it's out of sync with the canonical source. + +## Shared Terraform Assets + +Some Terraform config (currently `modules/claude-remote-control` and `shared/vscode-extensions.tf`) is shared across all three templates but must exist as a **physical copy inside each template directory** — `coder templates push` and CI's `terraform validate`/`test` only ever operate on a single template directory, so a relative `../modules` or `../shared` reference would not survive the push and would not be visible to CI. + +- **Edit only the canonical source**: `modules/claude-remote-control/` or `shared/vscode-extensions.tf` at the repo root. Never hand-edit the vendored copies (`