Skip to content

feat: return templates that are building for the first time#1406

Merged
dobrac merged 1 commit into
mainfrom
return-also-templates-that-are-building-for-the-first-time-eng-3222
Oct 27, 2025
Merged

feat: return templates that are building for the first time#1406
dobrac merged 1 commit into
mainfrom
return-also-templates-that-are-building-for-the-first-time-eng-3222

Conversation

@dobrac
Copy link
Copy Markdown
Contributor

@dobrac dobrac commented Oct 27, 2025

Note

Adds buildStatus to Template API and updates listing to include templates with the latest build (including in-progress).

  • API/schema:
    • Add buildStatus to Template and define reusable TemplateBuildStatus enum; reference it in TemplateBuild.status.
    • Regenerate OpenAPI spec and client/server models (spec.gen.go, types.gen.go, test models).
  • DB:
    • Update get_team_templates to return eb.status AS build_status and remove status = 'uploaded' filter to select the latest build.
  • Handlers:
    • Populate Template.buildStatus in GetTemplates from query result.

Written by Cursor Bugbot for commit f359e53. This will update automatically on new commits. Configure here.

@dobrac dobrac added the feature New feature label Oct 27, 2025
@linear
Copy link
Copy Markdown

linear Bot commented Oct 27, 2025

@dobrac dobrac marked this pull request as ready for review October 27, 2025 15:03
cursor[bot]

This comment was marked as outdated.

@dobrac dobrac force-pushed the return-also-templates-that-are-building-for-the-first-time-eng-3222 branch from 45534fd to f359e53 Compare October 27, 2025 15:05
LastSpawnedAt: item.Env.LastSpawnedAt,
SpawnCount: item.Env.SpawnCount,
BuildCount: item.Env.BuildCount,
BuildStatus: api.TemplateBuildStatus(item.BuildStatus),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Status Mapping Error in API Response

Direct casting of database status to API status without proper mapping. The database uses status values like 'uploaded', 'failed', 'success', 'snapshotting' which don't match the API enum values ('ready', 'error', 'building', 'waiting'). This will cause invalid enum values to be returned in the API response. The code should use the existing getCorrespondingTemplateBuildStatus function from template_build_status.go to properly map database status values to API status values.

Fix in Cursor Fix in Web

@jakubno jakubno assigned jakubno and unassigned sitole Oct 27, 2025
Copy link
Copy Markdown
Member

@jakubno jakubno left a comment

Choose a reason for hiding this comment

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

Isn't this a

Comment thread packages/api/internal/handlers/templates_list.go
@dobrac dobrac requested a review from jakubno October 27, 2025 18:50
@dobrac dobrac merged commit 00895b1 into main Oct 27, 2025
47 of 48 checks passed
@dobrac dobrac deleted the return-also-templates-that-are-building-for-the-first-time-eng-3222 branch October 27, 2025 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants