Skip to content

Commit 32239b2

Browse files
authored
chore: add AI-tasks-specific fields to codersdk.WorkspaceBuild (#18436)
This will be needed by the frontend on the `/task/$id` page to display the app in the sidebar. Related to #18158
1 parent d788ab9 commit 32239b2

File tree

8 files changed

+60
-0
lines changed

8 files changed

+60
-0
lines changed

coderd/apidoc/docs.go

Lines changed: 7 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: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/workspacebuilds.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,14 @@ func (api *API) convertWorkspaceBuild(
10781078
if build.TemplateVersionPresetID.Valid {
10791079
presetID = &build.TemplateVersionPresetID.UUID
10801080
}
1081+
var hasAITask *bool
1082+
if build.HasAITask.Valid {
1083+
hasAITask = &build.HasAITask.Bool
1084+
}
1085+
var aiTasksSidebarAppID *uuid.UUID
1086+
if build.AITasksSidebarAppID.Valid {
1087+
aiTasksSidebarAppID = &build.AITasksSidebarAppID.UUID
1088+
}
10811089

10821090
apiJob := convertProvisionerJob(job)
10831091
transition := codersdk.WorkspaceTransition(build.Transition)
@@ -1105,6 +1113,8 @@ func (api *API) convertWorkspaceBuild(
11051113
DailyCost: build.DailyCost,
11061114
MatchedProvisioners: &matchedProvisioners,
11071115
TemplateVersionPresetID: presetID,
1116+
HasAITask: hasAITask,
1117+
AITaskSidebarAppID: aiTasksSidebarAppID,
11081118
}, nil
11091119
}
11101120

codersdk/workspacebuilds.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ type WorkspaceBuild struct {
7575
DailyCost int32 `json:"daily_cost"`
7676
MatchedProvisioners *MatchedProvisioners `json:"matched_provisioners,omitempty"`
7777
TemplateVersionPresetID *uuid.UUID `json:"template_version_preset_id" format:"uuid"`
78+
HasAITask *bool `json:"has_ai_task,omitempty"`
79+
AITaskSidebarAppID *uuid.UUID `json:"ai_task_sidebar_app_id,omitempty" format:"uuid"`
7880
}
7981

8082
// WorkspaceResource describes resources used to create a workspace, for instance:

docs/reference/api/builds.md

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

docs/reference/api/schemas.md

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

docs/reference/api/workspaces.md

Lines changed: 12 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: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy