feat(coderd/templatebuilder): validation extraction, static file bundling, Windows OS#26633
Open
jeremyruppel wants to merge 3 commits into
Open
feat(coderd/templatebuilder): validation extraction, static file bundling, Windows OS#26633jeremyruppel wants to merge 3 commits into
jeremyruppel wants to merge 3 commits into
Conversation
329443f to
57750bf
Compare
jeremyruppel
commented
Jun 23, 2026
| return false | ||
| } | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
this all moved to validate.go and accounts for a huge chunk of the 🟥
jeremyruppel
commented
Jun 24, 2026
| const ( | ||
| BaseOSLinux BaseOS = "linux" | ||
| BaseOSLinux BaseOS = "linux" | ||
| BaseOSWindows BaseOS = "windows" |
Contributor
Author
There was a problem hiding this comment.
this is in preparation for #26634 where we'll add windows bases
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
…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.
57750bf to
9d5497c
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

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.goMove
validateVariableValue,validateStringValue,validateNumberValue,validateBoolValue,toHCLLiteral,hclQuote, andisSimpleJSONValuefromcompose.gointovalidate.go. Corresponding tests move tovalidate_internal_test.go. This keepscompose.gofocused on the compose pipeline.Commit 2: Static file bundling
Add
StaticFilesfield toComposeResultand acollectStaticFileshelper that walks the base template FS to collect non-template files (e.g. cloud-init.tftplinputs).BundleTarnow writes these files into the output archive in sorted order for deterministic output. This fixesaws-linux, whose cloud-init files were embedded but never included in the tar.Commit 3: Windows OS support
Add
BaseOSWindowsconstant and register"windows"invalidBaseOSso that base templates withos="windows"can be loaded and used for module compatibility filtering.Note
This PR was authored by Coder Agents on behalf of @jeremyruppel.