Skip to content

feat: add GET /templates/{templateID}/tags endpoint#1904

Merged
dobrac merged 4 commits intomainfrom
template-tags-list-api
Feb 12, 2026
Merged

feat: add GET /templates/{templateID}/tags endpoint#1904
dobrac merged 4 commits intomainfrom
template-tags-list-api

Conversation

@beran-t
Copy link
Copy Markdown
Contributor

@beran-t beran-t commented Feb 12, 2026

Summary

  • Adds a new GET /templates/{templateID}/tags API endpoint that returns all tags assigned to a template, each with its associated build ID and creation timestamp
  • Creates the underlying ListTemplateTags SQL query and updates the OpenAPI spec with a TemplateTag response schema
  • Complements the existing POST /templates/tags (assign) and DELETE /templates/tags (delete) endpoints so the SDK can list tags

…tags

The SDK needs a way to list all tags for a template. This adds the missing
list endpoint alongside the existing assign (POST) and delete (DELETE) ones.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74d68ad24e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +321 to +324
case template.TeamID != team.ID:
telemetry.ReportError(ctx, "user doesn't have access to the template", nil, telemetry.WithTemplateID(templateID))
a.sendAPIStoreError(c, http.StatusForbidden, fmt.Sprintf("You don't have access to this sandbox template (%s)", templateID))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Declare 403 for unauthorized template tag reads

When a caller from a different team requests this endpoint, the handler returns 403 (template.TeamID != team.ID), but the new OpenAPI operation and generated client response type only model 200/401/404/500 (spec/openapi.yml and GetTemplatesTemplateIDTagsResponse in api.gen.go). In that cross-team scenario, SDK users lose typed error handling for a normal authorization outcome, which is a contract mismatch introduced with this endpoint.

Useful? React with 👍 / 👎.

beran-t and others added 2 commits February 12, 2026 11:14
- Deduplicate tags using DISTINCT ON to return only the latest assignment per tag
- Support template names/aliases via ResolveAlias instead of direct ID lookup
- Add 403 response to OpenAPI spec for cross-team access denial
@dobrac dobrac merged commit fed7348 into main Feb 12, 2026
33 checks passed
@dobrac dobrac deleted the template-tags-list-api branch February 12, 2026 23:08
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.

3 participants