Skip to content

Commit e60112e

Browse files
chore(coderd): introduce TaskAppID and deprecate AITaskSidebarAppID (coder#20336)
As we're moving away from the SidebarAppID nomenclature, this PR introduces a new `TaskAppID` field to `codersdk.WorkspaceBuild` and deprecates the `AITaskSidebarAppID` field. They both contain the same value.
1 parent e8e31dc commit e60112e

File tree

12 files changed

+49
-16
lines changed

12 files changed

+49
-16
lines changed

coderd/aitasks.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -635,9 +635,9 @@ func (api *API) taskDelete(rw http.ResponseWriter, r *http.Request) {
635635
// @Router /api/experimental/tasks/{user}/{task}/send [post]
636636
//
637637
// EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
638-
// taskSend submits task input to the tasks sidebar app by dialing the agent
638+
// taskSend submits task input to the task app by dialing the agent
639639
// directly over the tailnet. We enforce ApplicationConnect RBAC on the
640-
// workspace and validate the sidebar app health.
640+
// workspace and validate the task app health.
641641
func (api *API) taskSend(rw http.ResponseWriter, r *http.Request) {
642642
ctx := r.Context()
643643
task := httpmw.TaskParam(r)
@@ -709,7 +709,7 @@ func (api *API) taskSend(rw http.ResponseWriter, r *http.Request) {
709709
//
710710
// EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
711711
// taskLogs reads task output by dialing the agent directly over the tailnet.
712-
// We enforce ApplicationConnect RBAC on the workspace and validate the sidebar app health.
712+
// We enforce ApplicationConnect RBAC on the workspace and validate the task app health.
713713
func (api *API) taskLogs(rw http.ResponseWriter, r *http.Request) {
714714
ctx := r.Context()
715715
task := httpmw.TaskParam(r)
@@ -767,7 +767,7 @@ func (api *API) taskLogs(rw http.ResponseWriter, r *http.Request) {
767767
//
768768
// - Fetch the task workspace
769769
// - Authorize ApplicationConnect on the workspace
770-
// - Validate the AI task and sidebar app health
770+
// - Validate the AI task and task app health
771771
// - Dial the agent and construct an HTTP client to the apps loopback URL
772772
//
773773
// The provided callback receives the context, an HTTP client that dials via the
@@ -832,7 +832,7 @@ func (api *API) authAndDoWithTaskAppClient(
832832
appURL := app.Url.String
833833
if appURL == "" {
834834
return httperror.NewResponseError(http.StatusInternalServerError, codersdk.Response{
835-
Message: "Task sidebar app URL is not configured.",
835+
Message: "Task app URL is not configured.",
836836
})
837837
}
838838
parsedURL, err := url.Parse(appURL)

coderd/apidoc/docs.go

Lines changed: 5 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: 5 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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,9 +1181,9 @@ func (api *API) convertWorkspaceBuild(
11811181
if build.HasAITask.Valid {
11821182
hasAITask = &build.HasAITask.Bool
11831183
}
1184-
var aiTasksSidebarAppID *uuid.UUID
1184+
var taskAppID *uuid.UUID
11851185
if build.AITaskSidebarAppID.Valid {
1186-
aiTasksSidebarAppID = &build.AITaskSidebarAppID.UUID
1186+
taskAppID = &build.AITaskSidebarAppID.UUID
11871187
}
11881188

11891189
var hasExternalAgent *bool
@@ -1218,7 +1218,8 @@ func (api *API) convertWorkspaceBuild(
12181218
MatchedProvisioners: &matchedProvisioners,
12191219
TemplateVersionPresetID: presetID,
12201220
HasAITask: hasAITask,
1221-
AITaskSidebarAppID: aiTasksSidebarAppID,
1221+
AITaskSidebarAppID: taskAppID,
1222+
TaskAppID: taskAppID,
12221223
HasExternalAgent: hasExternalAgent,
12231224
}, nil
12241225
}

codersdk/workspacebuilds.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ type WorkspaceBuild struct {
8989
MatchedProvisioners *MatchedProvisioners `json:"matched_provisioners,omitempty"`
9090
TemplateVersionPresetID *uuid.UUID `json:"template_version_preset_id" format:"uuid"`
9191
HasAITask *bool `json:"has_ai_task,omitempty"`
92-
AITaskSidebarAppID *uuid.UUID `json:"ai_task_sidebar_app_id,omitempty" format:"uuid"`
93-
HasExternalAgent *bool `json:"has_external_agent,omitempty"`
92+
// Deprecated: This field has been replaced with `TaskAppID`
93+
AITaskSidebarAppID *uuid.UUID `json:"ai_task_sidebar_app_id,omitempty" format:"uuid"`
94+
TaskAppID *uuid.UUID `json:"task_app_id,omitempty" format:"uuid"`
95+
HasExternalAgent *bool `json:"has_external_agent,omitempty"`
9496
}
9597

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

docs/reference/api/builds.md

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

site/src/pages/TaskPage/TaskApps.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const TaskApps: FC<TaskAppsProps> = ({ task }) => {
3434
// The Chat UI app will be displayed in the sidebar, so we don't want to
3535
// show it as a web app.
3636
(app) =>
37-
app.id !== task.workspace.latest_build.ai_task_sidebar_app_id &&
37+
app.id !== task.workspace.latest_build.task_app_id &&
3838
app.health !== "disabled",
3939
);
4040
const [embeddedApps, externalApps] = splitEmbeddedAndExternalApps(apps);

0 commit comments

Comments
 (0)