Skip to content

Commit c3ac55f

Browse files
authored
feat: add template_active_version_id to workspaces (#9226)
* feat: add `template_active_version_id` to workspaces This reduces a fetch in the VS Code extension when getting the active version update message! * Fix entities.ts * Fix golden gen
1 parent 54032cc commit c3ac55f

File tree

9 files changed

+21
-0
lines changed

9 files changed

+21
-0
lines changed

cli/testdata/coder_list_--output_json.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"template_display_name": "",
1212
"template_icon": "",
1313
"template_allow_user_cancel_workspace_jobs": false,
14+
"template_active_version_id": "[version ID]",
1415
"latest_build": {
1516
"id": "[workspace build ID]",
1617
"created_at": "[timestamp]",

coderd/apidoc/docs.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/workspaces.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,7 @@ func convertWorkspace(
11871187
TemplateIcon: template.Icon,
11881188
TemplateDisplayName: template.DisplayName,
11891189
TemplateAllowUserCancelWorkspaceJobs: template.AllowUserCancelWorkspaceJobs,
1190+
TemplateActiveVersionID: template.ActiveVersionID,
11901191
Outdated: workspaceBuild.TemplateVersionID.String() != template.ActiveVersionID.String(),
11911192
Name: workspace.Name,
11921193
AutostartSchedule: autostartSchedule,

codersdk/workspaces.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type Workspace struct {
2828
TemplateDisplayName string `json:"template_display_name"`
2929
TemplateIcon string `json:"template_icon"`
3030
TemplateAllowUserCancelWorkspaceJobs bool `json:"template_allow_user_cancel_workspace_jobs"`
31+
TemplateActiveVersionID uuid.UUID `json:"template_active_version_id" format:"uuid"`
3132
LatestBuild WorkspaceBuild `json:"latest_build"`
3233
Outdated bool `json:"outdated"`
3334
Name string `json:"name"`

docs/api/schemas.md

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/workspaces.md

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/api/typesGenerated.ts

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/testHelpers/entities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,7 @@ export const MockWorkspace: TypesGen.Workspace = {
848848
template_display_name: MockTemplate.display_name,
849849
template_allow_user_cancel_workspace_jobs:
850850
MockTemplate.allow_user_cancel_workspace_jobs,
851+
template_active_version_id: MockTemplate.active_version_id,
851852
outdated: false,
852853
owner_id: MockUser.id,
853854
organization_id: MockOrganization.id,

0 commit comments

Comments
 (0)