Skip to content

feat(coderd/templatebuilder): validation extraction, static file bundling, Windows OS#26633

Open
jeremyruppel wants to merge 3 commits into
mainfrom
jeremy/devex-515-infrastructure
Open

feat(coderd/templatebuilder): validation extraction, static file bundling, Windows OS#26633
jeremyruppel wants to merge 3 commits into
mainfrom
jeremy/devex-515-infrastructure

Conversation

@jeremyruppel

Copy link
Copy Markdown
Contributor

Extract validation helpers to a dedicated file, add static file bundling for base templates, and add Windows OS support.

Commit 1: Extract validation to validate.go
Move validateVariableValue, validateStringValue, validateNumberValue, validateBoolValue, toHCLLiteral, hclQuote, and isSimpleJSONValue from compose.go into validate.go. Corresponding tests move to validate_internal_test.go. This keeps compose.go focused on the compose pipeline.

Commit 2: Static file bundling
Add StaticFiles field to ComposeResult and a collectStaticFiles helper that walks the base template FS to collect non-template files (e.g. cloud-init .tftpl inputs). BundleTar now writes these files into the output archive in sorted order for deterministic output. This fixes aws-linux, whose cloud-init files were embedded but never included in the tar.

Commit 3: Windows OS support
Add BaseOSWindows constant and register "windows" in validBaseOS so that base templates with os="windows" can be loaded and used for module compatibility filtering.

Note

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

@linear-code

linear-code Bot commented Jun 23, 2026

Copy link
Copy Markdown

DEVEX-515

return false
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this all moved to validate.go and accounts for a huge chunk of the 🟥

@jeremyruppel jeremyruppel marked this pull request as ready for review June 23, 2026 17:50
const (
BaseOSLinux BaseOS = "linux"
BaseOSLinux BaseOS = "linux"
BaseOSWindows BaseOS = "windows"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is in preparation for #26634 where we'll add windows bases

jeremyruppel commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

…ate.go

Move validation, HCL quoting, and type-checking functions from compose.go
into a dedicated validate.go file to keep compose.go focused on the
compose pipeline. Corresponding tests move to validate_internal_test.go.

No functional changes.
Collect static files (e.g. cloud-init .tftpl inputs) at embed load time
in parseBasesFromFS, alongside template parsing and README loading. Add
BaseStaticFiles accessor and StaticFiles field to ComposeResult.
BundleTar writes static files in sorted key order for deterministic
archives.

This fixes aws-linux, whose cloud-init files were embedded but never
included in the tar output.
Add BaseOSWindows constant and register "windows" in validBaseOS so
that base templates with os="windows" can be loaded and used for
module compatibility filtering.
@jeremyruppel jeremyruppel force-pushed the jeremy/devex-515-infrastructure branch from 57750bf to 9d5497c Compare June 24, 2026 19:23
@jeremyruppel jeremyruppel requested a review from jakehwll June 24, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant