Repository navigation
docs: describe the Builds API operations and parameters - #31538
Closed
nickvigilante wants to merge 2 commits into
Closed
nickvigilante wants to merge 2 commits into
nickvigilante wants to merge 2 commits into
Conversation
The REST API reference renders these routes from swagger.json, and they had no description. Part of DOCS-1439. Assisted-by: AI
Part of DOCS-1439. Assisted-by: AI
Collaborator
Author
|
Combined into #31562, where this PR's changes are the commit Generated by Coder Agents on behalf of @nickvigilante. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This describes the eleven Builds routes that had no
@Descriptionand improves the thin or wrong parameter text on them, so the REST API reference renders more than a title.The reference comes from
swagger.json, whichmake genbuilds from these annotations.Merge notes
This PR doesn't touch #31473's exemption lists.
If #31473 merges first,
TestEndpointsDocumentednames each route on this PR to remove from those lists.Existing text I corrected on routes in this list:
usersaid "User ID, name, or me".httpmw.ExtractUserParamtakes an ID, a username, orme, so it now uses the shared wording.after_idonGET /api/v2/workspaces/{workspace}/buildsnow says what the query does, which is to return builds with a higher build number than the build it names.beforeonGET /api/v2/workspacebuilds/{workspacebuild}/logsnow says it has no effect, because the handler never reads it.followon the same route now says that any value turns streaming on, because the handler checks only that the parameter is present.Verification
A JSON diff of
swagger.jsonagainstmainshows 23 changes, all adding or editingdescriptionvalues on these routes and their parameters, and nothing else.The 11 remaining thin parameters are all path IDs (
workspacebuildandworkspace) that accept only a UUID, soWorkspace build IDandWorkspace IDare complete.check_routes.pywas run against the fresh list for this branch, which matches the shared list except that it reflects these edits.doc-checkran in author self-check mode on the branch diff, persona by persona.The Fact Checker found two wrong or incomplete claims, which the Skeptic confirmed.
POST .../buildssaid the workspace owner has start, stop, and delete permission, but that comes from the Organization Workspace Access role, so the text now names it.GET .../resourcessaid it fails while the job is running, but it fails until the job completes, which includes a pending job.The Copy Editor found one rule violation, "whose" for a thing in
GET .../resources, which the Skeptic confirmed and which is rewritten.The Continuity Editor found nothing.
The fixes are in the follow-up commit, and the swagger tests,
check_routes.py, and theswagger.jsondiff were run again.Claims checked against the code
POST /api/v2/workspaces/{workspace}/buildstransitionisstart,stop, ordeletecodersdk/workspaces.go:123(validate:"oneof=start stop delete,required")POST /api/v2/workspaces/{workspace}/buildscoderd/wsbuilder/wsbuilder.go:1369to:1390,coderd/rbac/roles.go:236to:244(orgWorkspaceAccessMemberPerms, not part of the member floor),:414(Owner),:587(Organization Admin),docs/admin/users/groups-roles.md:36to:38POST /api/v2/workspaces/{workspace}/buildsstartbuild clears dormancycoderd/workspacebuilds.go:453POST /api/v2/workspaces/{workspace}/buildsorphanonly withdeletecoderd/workspacebuilds.go:498POST /api/v2/workspaces/{workspace}/buildsstateororphanneeds template update permissioncoderd/wsbuilder/wsbuilder.go:1433to:1436,coderd/rbac/roles.go:414,:512,:587,:679PATCH /api/v2/workspacebuilds/{workspacebuild}/cancelexpect_statusispendingcoderd/workspacebuilds.go:893,:992to:1012PATCH /api/v2/workspacebuilds/{workspacebuild}/cancelcoderd/workspacebuilds.go:918,:924GET /api/v2/workspacebuilds/{workspacebuild}/logsafteris a log IDcoderd/database/queries/provisionerjoblogs.sql:9to:10(id > @created_after ... ORDER BY id ASC)GET /api/v2/workspacebuilds/{workspacebuild}/logsfollowupgrades to a WebSocket, any value counts, one JSONProvisionerJobLogper message, closes when the job finishescoderd/provisionerjobs.go:158,:585,:599,:700GET /api/v2/workspacebuilds/{workspacebuild}/logsbeforeis ignoredcoderd/provisionerjobs.go:154to:180(the handler reads onlyfollow,after, andformat)GET /api/v2/workspacebuilds/{workspacebuild}/statecoderd/database/dbauthz/dbauthz.go:6128,coderd/database/modelmethods.go:450,coderd/rbac/roles.go:414,:512,:587,:679PUT /api/v2/workspacebuilds/{workspacebuild}/statecoderd/workspacebuilds.go:1134,codersdk/workspacebuilds.go:222GET /api/v2/workspacebuilds/{workspacebuild}/resources400until the job completes, including while it is pendingcoderd/provisionerjobs.go:217GET /api/v2/workspacebuilds/{workspacebuild}/resourcesGET /api/v2/workspacebuilds/{workspacebuild}carriesresourcescodersdk/workspacebuilds.go:87GET /api/v2/workspaces/{workspace}/buildssinceis an RFC 3339 lower bound,after_idreturns higher build numberscoderd/database/queries/workspacebuilds.sql:40,:49,:61,coderd/workspacebuilds.go:135GET /api/v2/workspaces/{workspace}/buildslimitandoffsetdefault to0coderd/workspacebuilds.go:129(ParsePagination),coderd/pagination.go:19to:23GET /api/v2/workspacebuilds/{workspacebuild}/timingscoderd/workspacebuilds.go:1669to:1700{user}path parametercoderd/httpmw/userparam.go:51to:110Writing rules applied
coderd/rbac/roles.go.RequireFeatureMW.@Deprecatedand names its replacement by full path.user,limit, andoffset, copied exactly, and parameter text that follows what the handler does.Part of DOCS-1439.
Generated by Coder Agents on behalf of @nickvigilante.