-
Notifications
You must be signed in to change notification settings - Fork 219
feat: add list of builds per template #1408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9011e0f to
9c8e858
Compare
9c8e858 to
42b8067
Compare
42b8067 to
28469c3
Compare
28469c3 to
7b3d08d
Compare
7b3d08d to
b399ec4
Compare
b399ec4 to
98d653e
Compare
9a22c03 to
b04127d
Compare
| 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think use of uuidv7 can can help here a lot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.