mirror of
https://github.com/coder/coder.git
synced 2025-07-10 23:53:15 +00:00
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 https://github.com/coder/coder/issues/18158
This commit is contained in:
7
coderd/apidoc/docs.go
generated
7
coderd/apidoc/docs.go
generated
@ -18091,6 +18091,10 @@ const docTemplate = `{
|
||||
"codersdk.WorkspaceBuild": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ai_task_sidebar_app_id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"build_number": {
|
||||
"type": "integer"
|
||||
},
|
||||
@ -18105,6 +18109,9 @@ const docTemplate = `{
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"has_ai_task": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
|
7
coderd/apidoc/swagger.json
generated
7
coderd/apidoc/swagger.json
generated
@ -16530,6 +16530,10 @@
|
||||
"codersdk.WorkspaceBuild": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ai_task_sidebar_app_id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"build_number": {
|
||||
"type": "integer"
|
||||
},
|
||||
@ -16544,6 +16548,9 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"has_ai_task": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
|
@ -1078,6 +1078,14 @@ func (api *API) convertWorkspaceBuild(
|
||||
if build.TemplateVersionPresetID.Valid {
|
||||
presetID = &build.TemplateVersionPresetID.UUID
|
||||
}
|
||||
var hasAITask *bool
|
||||
if build.HasAITask.Valid {
|
||||
hasAITask = &build.HasAITask.Bool
|
||||
}
|
||||
var aiTasksSidebarAppID *uuid.UUID
|
||||
if build.AITasksSidebarAppID.Valid {
|
||||
aiTasksSidebarAppID = &build.AITasksSidebarAppID.UUID
|
||||
}
|
||||
|
||||
apiJob := convertProvisionerJob(job)
|
||||
transition := codersdk.WorkspaceTransition(build.Transition)
|
||||
@ -1105,6 +1113,8 @@ func (api *API) convertWorkspaceBuild(
|
||||
DailyCost: build.DailyCost,
|
||||
MatchedProvisioners: &matchedProvisioners,
|
||||
TemplateVersionPresetID: presetID,
|
||||
HasAITask: hasAITask,
|
||||
AITaskSidebarAppID: aiTasksSidebarAppID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user