feat: add POST /api/v2/templatebuilder/compose endpoint - #26351
Merged
Conversation
Docs preview📖 View docs preview for |
This was referenced Jun 12, 2026
Contributor
Author
This was referenced Jun 12, 2026
jeremyruppel
marked this pull request as ready for review
June 12, 2026 20:42
jeremyruppel
force-pushed
the
jeremy/devex-277-phase3-sdk
branch
from
June 12, 2026 21:20
f94ec5a to
fb866aa
Compare
jeremyruppel
force-pushed
the
jeremy/devex-277-phase4-endpoint
branch
2 times, most recently
from
June 12, 2026 21:42
7173c89 to
4ba96fb
Compare
jeremyruppel
force-pushed
the
jeremy/devex-277-phase3-sdk
branch
from
June 12, 2026 21:42
fb866aa to
79ca213
Compare
jeremyruppel
force-pushed
the
jeremy/devex-277-phase4-endpoint
branch
from
June 12, 2026 22:00
4ba96fb to
4bbb94c
Compare
jeremyruppel
force-pushed
the
jeremy/devex-277-phase3-sdk
branch
from
June 12, 2026 22:01
79ca213 to
1e7157e
Compare
zenithwolf1000
approved these changes
Jun 15, 2026
jeremyruppel
changed the base branch from
jeremy/devex-277-phase3-sdk
to
graphite-base/26351
June 15, 2026 13:29
Add the compose endpoint that accepts a base template ID and optional modules with variable overrides, renders them into Terraform source files via Compose/BundleTar, and returns the tar archive directly. The handler reads the registry URL from the deployment config (CODER_TEMPLATE_BUILDER_REGISTRY_URL), validates the request, and returns the rendered tar with Content-Type: application/x-tar. Includes swagger annotations, route wiring, and integration tests covering happy path, error cases, and feature-disabled behavior.
The TestEndpointsDocumented test derives expected IDs from summaries. The @id 'compose-template-builder' did not match the kebab-cased summary 'Compose template from base and modules'.
jeremyruppel
force-pushed
the
graphite-base/26351
branch
from
June 15, 2026 13:29
1e7157e to
ce21a56
Compare
jeremyruppel
force-pushed
the
jeremy/devex-277-phase4-endpoint
branch
from
June 15, 2026 13:29
1bace30 to
6e8038b
Compare
…l exceptions The POST /api/v2/templatebuilder/compose endpoint returns application/x-tar with no structured response model. TestEndpointsDocumented requires endpoints with @produce to have a response model defined. Add it to the exception list alongside other endpoints that return raw binary content.
jeremyruppel
force-pushed
the
jeremy/devex-277-phase4-endpoint
branch
from
June 15, 2026 13:30
6e8038b to
33609e0
Compare
jeremyruppel
commented
Jun 15, 2026
| (comment.router == "/api/v2/workspaces/{workspace}/acl" && comment.method == "patch") || | ||
| (comment.router == "/api/v2/init-script/{os}/{arch}" && comment.method == "get") { | ||
| (comment.router == "/api/v2/init-script/{os}/{arch}" && comment.method == "get") || | ||
| (comment.router == "/api/v2/templatebuilder/compose" && comment.method == "post") { |
Contributor
Author
There was a problem hiding this comment.
this is necessary because the compose endpoint return the template tarball. may change this in a future PR
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.

Note
This PR was authored by Coder Agents on behalf of @jeremyruppel.
Part 4 of DEVEX-277 (POST /api/v2/templatebuilder/compose).
Adds the HTTP handler, route wiring, and integration tests for the compose endpoint.
The handler accepts a JSON request with a base template ID and optional modules with variable overrides, renders them via
Compose/BundleTar, and returns the tar archive directly withContent-Type: application/x-tar. The registry URL comes from the deployment config (CODER_TEMPLATE_BUILDER_REGISTRY_URL).RBAC uses
policy.ActionCreateonrbac.ResourceTemplate.AnyOrganization().Integration tests cover: base-only compose, base with modules, unknown base/module errors, missing base template ID, and feature-disabled 404.