🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

feat: add POST /api/v2/templatebuilder/compose endpoint - #26351

Merged
jeremyruppel merged 3 commits into
mainfrom
jeremy/devex-277-phase4-endpoint
Jun 15, 2026
Merged

feat: add POST /api/v2/templatebuilder/compose endpoint#26351
jeremyruppel merged 3 commits into
mainfrom
jeremy/devex-277-phase4-endpoint

Conversation

@jeremyruppel

Copy link
Copy Markdown
Contributor

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 with Content-Type: application/x-tar. The registry URL comes from the deployment config (CODER_TEMPLATE_BUILDER_REGISTRY_URL).

RBAC uses policy.ActionCreate on rbac.ResourceTemplate.AnyOrganization().

Integration tests cover: base-only compose, base with modules, unknown base/module errors, missing base template ID, and feature-disabled 404.

@linear-code

linear-code Bot commented Jun 12, 2026

Copy link
Copy Markdown

DEVEX-277

@github-actions

Copy link
Copy Markdown

Docs preview

📖 View docs preview for docs/reference/api/schemas.md

@jeremyruppel jeremyruppel changed the title feat(coderd): add POST /api/v2/templatebuilder/compose endpoint feat: add POST /api/v2/templatebuilder/compose endpoint Jun 12, 2026
@jeremyruppel
jeremyruppel marked this pull request as ready for review June 12, 2026 20:42
@jeremyruppel
jeremyruppel force-pushed the jeremy/devex-277-phase3-sdk branch from f94ec5a to fb866aa Compare June 12, 2026 21:20
@jeremyruppel
jeremyruppel force-pushed the jeremy/devex-277-phase4-endpoint branch 2 times, most recently from 7173c89 to 4ba96fb Compare June 12, 2026 21:42
@jeremyruppel
jeremyruppel force-pushed the jeremy/devex-277-phase3-sdk branch from fb866aa to 79ca213 Compare June 12, 2026 21:42
@jeremyruppel
jeremyruppel force-pushed the jeremy/devex-277-phase4-endpoint branch from 4ba96fb to 4bbb94c Compare June 12, 2026 22:00
@jeremyruppel
jeremyruppel force-pushed the jeremy/devex-277-phase3-sdk branch from 79ca213 to 1e7157e Compare June 12, 2026 22:01
@jeremyruppel
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
jeremyruppel force-pushed the graphite-base/26351 branch from 1e7157e to ce21a56 Compare June 15, 2026 13:29
@jeremyruppel
jeremyruppel force-pushed the jeremy/devex-277-phase4-endpoint branch from 1bace30 to 6e8038b Compare June 15, 2026 13:29
@graphite-app
graphite-app Bot changed the base branch from graphite-base/26351 to main June 15, 2026 13:30
…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
jeremyruppel force-pushed the jeremy/devex-277-phase4-endpoint branch from 6e8038b to 33609e0 Compare June 15, 2026 13:30
(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") {

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 necessary because the compose endpoint return the template tarball. may change this in a future PR

@jeremyruppel
jeremyruppel merged commit b61b62f into main Jun 15, 2026
68 of 70 checks passed
@jeremyruppel
jeremyruppel deleted the jeremy/devex-277-phase4-endpoint branch June 15, 2026 15:07
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 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