mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(coderd): introduce TaskAppID and deprecate AITaskSidebarAppID (#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.
This commit is contained in:
+5
-5
@@ -635,9 +635,9 @@ func (api *API) taskDelete(rw http.ResponseWriter, r *http.Request) {
|
||||
// @Router /api/experimental/tasks/{user}/{task}/send [post]
|
||||
//
|
||||
// EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
|
||||
// taskSend submits task input to the tasks sidebar app by dialing the agent
|
||||
// taskSend submits task input to the task app by dialing the agent
|
||||
// directly over the tailnet. We enforce ApplicationConnect RBAC on the
|
||||
// workspace and validate the sidebar app health.
|
||||
// workspace and validate the task app health.
|
||||
func (api *API) taskSend(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
task := httpmw.TaskParam(r)
|
||||
@@ -709,7 +709,7 @@ func (api *API) taskSend(rw http.ResponseWriter, r *http.Request) {
|
||||
//
|
||||
// EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
|
||||
// taskLogs reads task output by dialing the agent directly over the tailnet.
|
||||
// We enforce ApplicationConnect RBAC on the workspace and validate the sidebar app health.
|
||||
// We enforce ApplicationConnect RBAC on the workspace and validate the task app health.
|
||||
func (api *API) taskLogs(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
task := httpmw.TaskParam(r)
|
||||
@@ -767,7 +767,7 @@ func (api *API) taskLogs(rw http.ResponseWriter, r *http.Request) {
|
||||
//
|
||||
// - Fetch the task workspace
|
||||
// - Authorize ApplicationConnect on the workspace
|
||||
// - Validate the AI task and sidebar app health
|
||||
// - Validate the AI task and task app health
|
||||
// - Dial the agent and construct an HTTP client to the apps loopback URL
|
||||
//
|
||||
// The provided callback receives the context, an HTTP client that dials via the
|
||||
@@ -832,7 +832,7 @@ func (api *API) authAndDoWithTaskAppClient(
|
||||
appURL := app.Url.String
|
||||
if appURL == "" {
|
||||
return httperror.NewResponseError(http.StatusInternalServerError, codersdk.Response{
|
||||
Message: "Task sidebar app URL is not configured.",
|
||||
Message: "Task app URL is not configured.",
|
||||
})
|
||||
}
|
||||
parsedURL, err := url.Parse(appURL)
|
||||
|
||||
Generated
+5
@@ -20462,6 +20462,7 @@ const docTemplate = `{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ai_task_sidebar_app_id": {
|
||||
"description": "Deprecated: This field has been replaced with ` + "`" + `TaskAppID` + "`" + `",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
@@ -20543,6 +20544,10 @@ const docTemplate = `{
|
||||
}
|
||||
]
|
||||
},
|
||||
"task_app_id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"template_version_id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
|
||||
Generated
+5
@@ -18796,6 +18796,7 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ai_task_sidebar_app_id": {
|
||||
"description": "Deprecated: This field has been replaced with `TaskAppID`",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
@@ -18873,6 +18874,10 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"task_app_id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"template_version_id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
|
||||
@@ -1181,9 +1181,9 @@ func (api *API) convertWorkspaceBuild(
|
||||
if build.HasAITask.Valid {
|
||||
hasAITask = &build.HasAITask.Bool
|
||||
}
|
||||
var aiTasksSidebarAppID *uuid.UUID
|
||||
var taskAppID *uuid.UUID
|
||||
if build.AITaskSidebarAppID.Valid {
|
||||
aiTasksSidebarAppID = &build.AITaskSidebarAppID.UUID
|
||||
taskAppID = &build.AITaskSidebarAppID.UUID
|
||||
}
|
||||
|
||||
var hasExternalAgent *bool
|
||||
@@ -1218,7 +1218,8 @@ func (api *API) convertWorkspaceBuild(
|
||||
MatchedProvisioners: &matchedProvisioners,
|
||||
TemplateVersionPresetID: presetID,
|
||||
HasAITask: hasAITask,
|
||||
AITaskSidebarAppID: aiTasksSidebarAppID,
|
||||
AITaskSidebarAppID: taskAppID,
|
||||
TaskAppID: taskAppID,
|
||||
HasExternalAgent: hasExternalAgent,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user