feat: add list of builds per template#1408
Merged
Merged
Conversation
9011e0f to
9c8e858
Compare
9c8e858 to
42b8067
Compare
Base automatically changed from
return-also-templates-that-are-building-for-the-first-time-eng-3222
to
main
October 27, 2025 19:05
42b8067 to
28469c3
Compare
28469c3 to
7b3d08d
Compare
7b3d08d to
b399ec4
Compare
sitole
requested changes
Oct 29, 2025
b399ec4 to
98d653e
Compare
9a22c03 to
b04127d
Compare
sitole
approved these changes
Nov 3, 2025
| SELECT eb.* | ||
| FROM public.env_builds eb | ||
| WHERE eb.env_id = sqlc.arg(template_id) | ||
| AND (eb.created_at, eb.id::text) < (@cursor_time, @cursor_id::text) |
Member
There was a problem hiding this comment.
I think use of uuidv7 can can help here a lot
Contributor
Author
There was a problem hiding this comment.
maybe, but only if we're generating them all from the database. Otherwise it's not guaranteed that the uuidv7 generated in one place is always preceeding uuid generated in another afaik
Member
There was a problem hiding this comment.
Yep, but as it's part of B-tree, I think it will still benefit from only local arrangements (because you insert newer UUID and then older) than reworking the whole tree because of UUIDv4 use.
ValentaTomas
pushed a commit
that referenced
this pull request
May 4, 2026
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.
Summary
Adds the ability to list all builds for a template via the
GET /templates/{templateID}endpoint.Changes
buildsarray containing complete build historybuildID- unique identifier for the buildstatus- current build statuscreatedAt,updatedAt,finishedAt- timestampscpuCount,memoryMB,diskSizeMB- resource configurationenvdVersion- version of the envd usedNote
Adds GET
/templates/{templateID}to return a template with its paginated build history and introduces shared cursor-based pagination, updating schemas, handlers, DB queries, and clients.GET /templates/{templateID}withnextToken/limitto returnTemplateWithBuilds(template + paginatedbuilds).paginationNextToken,paginationLimit) and apply tov2/sandboxes.TemplateBuild(metadata) vsTemplateBuildInfo(status/logs); update build-status endpoint to returnTemplateBuildInfo.GetTemplatesTemplateIDto authorize, fetch template + builds via cursor, and setX-Next-Token.GetV2Sandboxesto use new pagination utility.GetTemplateByIDWithAliasesandGetTemplateBuilds(cursor on(created_at, id)), with generated sqlc code.NewPagination,ProcessResultsWithHeader) and exportMaxSandboxID; addCastPtr.TemplateBuildnow includesbuildID (uuid), timestamps, resources; logging moved toTemplateBuildInfo.Written by Cursor Bugbot for commit 6dbcfb8. This will update automatically on new commits. Configure here.