From 975a32cf5bc6142addba184dcbc0797d88af6686 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Fri, 11 Apr 2025 10:56:36 +0100 Subject: [PATCH] chore(codersdk): deprecate unused WorkspaceAppStatus fields --- coderd/apidoc/docs.go | 5 ++- coderd/apidoc/swagger.json | 5 ++- coderd/database/db2sdk/db2sdk.go | 18 ++++----- coderd/database/dbmem/dbmem.go | 18 ++++----- coderd/database/dump.sql | 4 +- ..._workspace_app_status_drop_fields.down.sql | 3 ++ ...17_workspace_app_status_drop_fields.up.sql | 3 ++ coderd/database/models.go | 18 ++++----- coderd/database/queries.sql.go | 38 +++++++----------- coderd/database/queries/workspaceapps.sql | 6 +-- coderd/workspaceagents.go | 5 --- coderd/workspaceagents_test.go | 7 +++- codersdk/agentsdk/agentsdk.go | 14 ++++--- codersdk/toolsdk/toolsdk.go | 20 +++------- codersdk/toolsdk/toolsdk_test.go | 1 - codersdk/workspaceapps.go | 20 ++++++---- docs/reference/api/builds.md | 8 ++-- docs/reference/api/schemas.md | 40 +++++++++---------- docs/reference/api/templates.md | 8 ++-- site/src/api/typesGenerated.ts | 2 +- site/src/testHelpers/entities.ts | 5 ++- 21 files changed, 119 insertions(+), 129 deletions(-) create mode 100644 coderd/database/migrations/000317_workspace_app_status_drop_fields.down.sql create mode 100644 coderd/database/migrations/000317_workspace_app_status_drop_fields.up.sql diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 6ad75b2d65a26..04b0a93cfb12e 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -10242,12 +10242,14 @@ const docTemplate = `{ "type": "string" }, "icon": { + "description": "Deprecated: this field is unused and will be removed in a future version.", "type": "string" }, "message": { "type": "string" }, "needs_user_attention": { + "description": "Deprecated: this field is unused and will be removed in a future version.", "type": "boolean" }, "state": { @@ -16925,7 +16927,7 @@ const docTemplate = `{ "format": "date-time" }, "icon": { - "description": "Icon is an external URL to an icon that will be rendered in the UI.", + "description": "Deprecated: This field is unused and will be removed in a future version.\nIcon is an external URL to an icon that will be rendered in the UI.", "type": "string" }, "id": { @@ -16936,6 +16938,7 @@ const docTemplate = `{ "type": "string" }, "needs_user_attention": { + "description": "Deprecated: This field is unused and will be removed in a future version.\nNeedsUserAttention specifies whether the status needs user attention.", "type": "boolean" }, "state": { diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 77758feb75c70..1cea2c58f7255 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -9079,12 +9079,14 @@ "type": "string" }, "icon": { + "description": "Deprecated: this field is unused and will be removed in a future version.", "type": "string" }, "message": { "type": "string" }, "needs_user_attention": { + "description": "Deprecated: this field is unused and will be removed in a future version.", "type": "boolean" }, "state": { @@ -15444,7 +15446,7 @@ "format": "date-time" }, "icon": { - "description": "Icon is an external URL to an icon that will be rendered in the UI.", + "description": "Deprecated: This field is unused and will be removed in a future version.\nIcon is an external URL to an icon that will be rendered in the UI.", "type": "string" }, "id": { @@ -15455,6 +15457,7 @@ "type": "string" }, "needs_user_attention": { + "description": "Deprecated: This field is unused and will be removed in a future version.\nNeedsUserAttention specifies whether the status needs user attention.", "type": "boolean" }, "state": { diff --git a/coderd/database/db2sdk/db2sdk.go b/coderd/database/db2sdk/db2sdk.go index e6d529ddadbfe..7efcd009c6ef9 100644 --- a/coderd/database/db2sdk/db2sdk.go +++ b/coderd/database/db2sdk/db2sdk.go @@ -537,16 +537,14 @@ func WorkspaceAppStatuses(statuses []database.WorkspaceAppStatus) []codersdk.Wor func WorkspaceAppStatus(status database.WorkspaceAppStatus) codersdk.WorkspaceAppStatus { return codersdk.WorkspaceAppStatus{ - ID: status.ID, - CreatedAt: status.CreatedAt, - WorkspaceID: status.WorkspaceID, - AgentID: status.AgentID, - AppID: status.AppID, - NeedsUserAttention: status.NeedsUserAttention, - URI: status.Uri.String, - Icon: status.Icon.String, - Message: status.Message, - State: codersdk.WorkspaceAppStatusState(status.State), + ID: status.ID, + CreatedAt: status.CreatedAt, + WorkspaceID: status.WorkspaceID, + AgentID: status.AgentID, + AppID: status.AppID, + URI: status.Uri.String, + Message: status.Message, + State: codersdk.WorkspaceAppStatusState(status.State), } } diff --git a/coderd/database/dbmem/dbmem.go b/coderd/database/dbmem/dbmem.go index 7fa583489a32e..ed9f098c00e3c 100644 --- a/coderd/database/dbmem/dbmem.go +++ b/coderd/database/dbmem/dbmem.go @@ -9764,16 +9764,14 @@ func (q *FakeQuerier) InsertWorkspaceAppStatus(_ context.Context, arg database.I defer q.mutex.Unlock() status := database.WorkspaceAppStatus{ - ID: arg.ID, - CreatedAt: arg.CreatedAt, - WorkspaceID: arg.WorkspaceID, - AgentID: arg.AgentID, - AppID: arg.AppID, - NeedsUserAttention: arg.NeedsUserAttention, - State: arg.State, - Message: arg.Message, - Uri: arg.Uri, - Icon: arg.Icon, + ID: arg.ID, + CreatedAt: arg.CreatedAt, + WorkspaceID: arg.WorkspaceID, + AgentID: arg.AgentID, + AppID: arg.AppID, + State: arg.State, + Message: arg.Message, + Uri: arg.Uri, } q.workspaceAppStatuses = append(q.workspaceAppStatuses, status) return status, nil diff --git a/coderd/database/dump.sql b/coderd/database/dump.sql index 8d9ac8186be85..83d998b2b9a3e 100644 --- a/coderd/database/dump.sql +++ b/coderd/database/dump.sql @@ -1911,10 +1911,8 @@ CREATE TABLE workspace_app_statuses ( app_id uuid NOT NULL, workspace_id uuid NOT NULL, state workspace_app_status_state NOT NULL, - needs_user_attention boolean NOT NULL, message text NOT NULL, - uri text, - icon text + uri text ); CREATE TABLE workspace_apps ( diff --git a/coderd/database/migrations/000317_workspace_app_status_drop_fields.down.sql b/coderd/database/migrations/000317_workspace_app_status_drop_fields.down.sql new file mode 100644 index 0000000000000..169cafe5830db --- /dev/null +++ b/coderd/database/migrations/000317_workspace_app_status_drop_fields.down.sql @@ -0,0 +1,3 @@ +ALTER TABLE ONLY workspace_app_statuses + ADD COLUMN IF NOT EXISTS needs_user_attention BOOLEAN NOT NULL DEFAULT FALSE, + ADD COLUMN IF NOT EXISTS icon TEXT; diff --git a/coderd/database/migrations/000317_workspace_app_status_drop_fields.up.sql b/coderd/database/migrations/000317_workspace_app_status_drop_fields.up.sql new file mode 100644 index 0000000000000..135f89d7c4f3c --- /dev/null +++ b/coderd/database/migrations/000317_workspace_app_status_drop_fields.up.sql @@ -0,0 +1,3 @@ +ALTER TABLE ONLY workspace_app_statuses + DROP COLUMN IF EXISTS needs_user_attention, + DROP COLUMN IF EXISTS icon; diff --git a/coderd/database/models.go b/coderd/database/models.go index 208b11cb26e71..f817ff2712d54 100644 --- a/coderd/database/models.go +++ b/coderd/database/models.go @@ -3579,16 +3579,14 @@ type WorkspaceAppStat struct { } type WorkspaceAppStatus struct { - ID uuid.UUID `db:"id" json:"id"` - CreatedAt time.Time `db:"created_at" json:"created_at"` - AgentID uuid.UUID `db:"agent_id" json:"agent_id"` - AppID uuid.UUID `db:"app_id" json:"app_id"` - WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` - State WorkspaceAppStatusState `db:"state" json:"state"` - NeedsUserAttention bool `db:"needs_user_attention" json:"needs_user_attention"` - Message string `db:"message" json:"message"` - Uri sql.NullString `db:"uri" json:"uri"` - Icon sql.NullString `db:"icon" json:"icon"` + ID uuid.UUID `db:"id" json:"id"` + CreatedAt time.Time `db:"created_at" json:"created_at"` + AgentID uuid.UUID `db:"agent_id" json:"agent_id"` + AppID uuid.UUID `db:"app_id" json:"app_id"` + WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` + State WorkspaceAppStatusState `db:"state" json:"state"` + Message string `db:"message" json:"message"` + Uri sql.NullString `db:"uri" json:"uri"` } // Joins in the username + avatar url of the initiated by user. diff --git a/coderd/database/queries.sql.go b/coderd/database/queries.sql.go index 0d5fa1bb7f060..ab5f27892749f 100644 --- a/coderd/database/queries.sql.go +++ b/coderd/database/queries.sql.go @@ -15598,8 +15598,8 @@ func (q *sqlQuerier) UpsertWorkspaceAppAuditSession(ctx context.Context, arg Ups const getLatestWorkspaceAppStatusesByWorkspaceIDs = `-- name: GetLatestWorkspaceAppStatusesByWorkspaceIDs :many SELECT DISTINCT ON (workspace_id) - id, created_at, agent_id, app_id, workspace_id, state, needs_user_attention, message, uri, icon -FROM workspace_app_statuses + id, created_at, agent_id, app_id, workspace_id, state, message, uri +FROM workspace_app_statuses WHERE workspace_id = ANY($1 :: uuid[]) ORDER BY workspace_id, created_at DESC ` @@ -15620,10 +15620,8 @@ func (q *sqlQuerier) GetLatestWorkspaceAppStatusesByWorkspaceIDs(ctx context.Con &i.AppID, &i.WorkspaceID, &i.State, - &i.NeedsUserAttention, &i.Message, &i.Uri, - &i.Icon, ); err != nil { return nil, err } @@ -15674,7 +15672,7 @@ func (q *sqlQuerier) GetWorkspaceAppByAgentIDAndSlug(ctx context.Context, arg Ge } const getWorkspaceAppStatusesByAppIDs = `-- name: GetWorkspaceAppStatusesByAppIDs :many -SELECT id, created_at, agent_id, app_id, workspace_id, state, needs_user_attention, message, uri, icon FROM workspace_app_statuses WHERE app_id = ANY($1 :: uuid [ ]) +SELECT id, created_at, agent_id, app_id, workspace_id, state, message, uri FROM workspace_app_statuses WHERE app_id = ANY($1 :: uuid [ ]) ` func (q *sqlQuerier) GetWorkspaceAppStatusesByAppIDs(ctx context.Context, ids []uuid.UUID) ([]WorkspaceAppStatus, error) { @@ -15693,10 +15691,8 @@ func (q *sqlQuerier) GetWorkspaceAppStatusesByAppIDs(ctx context.Context, ids [] &i.AppID, &i.WorkspaceID, &i.State, - &i.NeedsUserAttention, &i.Message, &i.Uri, - &i.Icon, ); err != nil { return nil, err } @@ -15942,22 +15938,20 @@ func (q *sqlQuerier) InsertWorkspaceApp(ctx context.Context, arg InsertWorkspace } const insertWorkspaceAppStatus = `-- name: InsertWorkspaceAppStatus :one -INSERT INTO workspace_app_statuses (id, created_at, workspace_id, agent_id, app_id, state, message, needs_user_attention, uri, icon) -VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) -RETURNING id, created_at, agent_id, app_id, workspace_id, state, needs_user_attention, message, uri, icon +INSERT INTO workspace_app_statuses (id, created_at, workspace_id, agent_id, app_id, state, message, uri) +VALUES ($1, $2, $3, $4, $5, $6, $7, $8) +RETURNING id, created_at, agent_id, app_id, workspace_id, state, message, uri ` type InsertWorkspaceAppStatusParams struct { - ID uuid.UUID `db:"id" json:"id"` - CreatedAt time.Time `db:"created_at" json:"created_at"` - WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` - AgentID uuid.UUID `db:"agent_id" json:"agent_id"` - AppID uuid.UUID `db:"app_id" json:"app_id"` - State WorkspaceAppStatusState `db:"state" json:"state"` - Message string `db:"message" json:"message"` - NeedsUserAttention bool `db:"needs_user_attention" json:"needs_user_attention"` - Uri sql.NullString `db:"uri" json:"uri"` - Icon sql.NullString `db:"icon" json:"icon"` + ID uuid.UUID `db:"id" json:"id"` + CreatedAt time.Time `db:"created_at" json:"created_at"` + WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` + AgentID uuid.UUID `db:"agent_id" json:"agent_id"` + AppID uuid.UUID `db:"app_id" json:"app_id"` + State WorkspaceAppStatusState `db:"state" json:"state"` + Message string `db:"message" json:"message"` + Uri sql.NullString `db:"uri" json:"uri"` } func (q *sqlQuerier) InsertWorkspaceAppStatus(ctx context.Context, arg InsertWorkspaceAppStatusParams) (WorkspaceAppStatus, error) { @@ -15969,9 +15963,7 @@ func (q *sqlQuerier) InsertWorkspaceAppStatus(ctx context.Context, arg InsertWor arg.AppID, arg.State, arg.Message, - arg.NeedsUserAttention, arg.Uri, - arg.Icon, ) var i WorkspaceAppStatus err := row.Scan( @@ -15981,10 +15973,8 @@ func (q *sqlQuerier) InsertWorkspaceAppStatus(ctx context.Context, arg InsertWor &i.AppID, &i.WorkspaceID, &i.State, - &i.NeedsUserAttention, &i.Message, &i.Uri, - &i.Icon, ) return i, err } diff --git a/coderd/database/queries/workspaceapps.sql b/coderd/database/queries/workspaceapps.sql index e402ee1402922..cd1cddb454b88 100644 --- a/coderd/database/queries/workspaceapps.sql +++ b/coderd/database/queries/workspaceapps.sql @@ -44,8 +44,8 @@ WHERE id = $1; -- name: InsertWorkspaceAppStatus :one -INSERT INTO workspace_app_statuses (id, created_at, workspace_id, agent_id, app_id, state, message, needs_user_attention, uri, icon) -VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) +INSERT INTO workspace_app_statuses (id, created_at, workspace_id, agent_id, app_id, state, message, uri) +VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING *; -- name: GetWorkspaceAppStatusesByAppIDs :many @@ -54,6 +54,6 @@ SELECT * FROM workspace_app_statuses WHERE app_id = ANY(@ids :: uuid [ ]); -- name: GetLatestWorkspaceAppStatusesByWorkspaceIDs :many SELECT DISTINCT ON (workspace_id) * -FROM workspace_app_statuses +FROM workspace_app_statuses WHERE workspace_id = ANY(@ids :: uuid[]) ORDER BY workspace_id, created_at DESC; diff --git a/coderd/workspaceagents.go b/coderd/workspaceagents.go index a4f8ed297b77a..e194aec8f921a 100644 --- a/coderd/workspaceagents.go +++ b/coderd/workspaceagents.go @@ -366,11 +366,6 @@ func (api *API) patchWorkspaceAgentAppStatus(rw http.ResponseWriter, r *http.Req String: req.URI, Valid: req.URI != "", }, - Icon: sql.NullString{ - String: req.Icon, - Valid: req.Icon != "", - }, - NeedsUserAttention: req.NeedsUserAttention, }) if err != nil { httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{ diff --git a/coderd/workspaceagents_test.go b/coderd/workspaceagents_test.go index a8fe7718f4385..de935176f22ac 100644 --- a/coderd/workspaceagents_test.go +++ b/coderd/workspaceagents_test.go @@ -366,8 +366,10 @@ func TestWorkspaceAgentAppStatus(t *testing.T) { AppSlug: "vscode", Message: "testing", URI: "https://example.com", - Icon: "https://example.com/icon.png", State: codersdk.WorkspaceAppStatusStateComplete, + // Ensure deprecated fields are ignored. + Icon: "https://example.com/icon.png", + NeedsUserAttention: true, }) require.NoError(t, err) @@ -376,6 +378,9 @@ func TestWorkspaceAgentAppStatus(t *testing.T) { agent, err := client.WorkspaceAgent(ctx, workspace.LatestBuild.Resources[0].Agents[0].ID) require.NoError(t, err) require.Len(t, agent.Apps[0].Statuses, 1) + // Deprecated fields should be ignored. + require.Empty(t, agent.Apps[0].Statuses[0].Icon) + require.False(t, agent.Apps[0].Statuses[0].NeedsUserAttention) }) } diff --git a/codersdk/agentsdk/agentsdk.go b/codersdk/agentsdk/agentsdk.go index 4f7d0a8baef31..109d14b84d050 100644 --- a/codersdk/agentsdk/agentsdk.go +++ b/codersdk/agentsdk/agentsdk.go @@ -583,12 +583,14 @@ func (c *Client) PatchLogs(ctx context.Context, req PatchLogs) error { // PatchAppStatus updates the status of a workspace app. type PatchAppStatus struct { - AppSlug string `json:"app_slug"` - NeedsUserAttention bool `json:"needs_user_attention"` - State codersdk.WorkspaceAppStatusState `json:"state"` - Message string `json:"message"` - URI string `json:"uri"` - Icon string `json:"icon"` + AppSlug string `json:"app_slug"` + State codersdk.WorkspaceAppStatusState `json:"state"` + Message string `json:"message"` + URI string `json:"uri"` + // Deprecated: this field is unused and will be removed in a future version. + Icon string `json:"icon"` + // Deprecated: this field is unused and will be removed in a future version. + NeedsUserAttention bool `json:"needs_user_attention"` } func (c *Client) PatchAppStatus(ctx context.Context, req PatchAppStatus) error { diff --git a/codersdk/toolsdk/toolsdk.go b/codersdk/toolsdk/toolsdk.go index 6cadbe611f335..73dee8e748575 100644 --- a/codersdk/toolsdk/toolsdk.go +++ b/codersdk/toolsdk/toolsdk.go @@ -67,10 +67,6 @@ var ( "type": "string", "description": "A link to a relevant resource, such as a PR or issue.", }, - "emoji": map[string]any{ - "type": "string", - "description": "An emoji that visually represents your current progress. Choose an emoji that helps the user understand your current status at a glance.", - }, "state": map[string]any{ "type": "string", "description": "The state of your task. This can be one of the following: working, complete, or failure. Select the state that best represents your current progress.", @@ -81,7 +77,7 @@ var ( }, }, }, - Required: []string{"summary", "link", "emoji", "state"}, + Required: []string{"summary", "link", "state"}, }, }, Handler: func(ctx context.Context, args map[string]any) (string, error) { @@ -104,22 +100,16 @@ var ( if !ok { return "", xerrors.New("link must be a string") } - emoji, ok := args["emoji"].(string) - if !ok { - return "", xerrors.New("emoji must be a string") - } state, ok := args["state"].(string) if !ok { return "", xerrors.New("state must be a string") } if err := agentClient.PatchAppStatus(ctx, agentsdk.PatchAppStatus{ - AppSlug: appSlug, - Message: summary, - URI: link, - Icon: emoji, - NeedsUserAttention: false, // deprecated, to be removed later - State: codersdk.WorkspaceAppStatusState(state), + AppSlug: appSlug, + Message: summary, + URI: link, + State: codersdk.WorkspaceAppStatusState(state), }); err != nil { return "", err } diff --git a/codersdk/toolsdk/toolsdk_test.go b/codersdk/toolsdk/toolsdk_test.go index aca4045f36e8e..1504e956f6bd4 100644 --- a/codersdk/toolsdk/toolsdk_test.go +++ b/codersdk/toolsdk/toolsdk_test.go @@ -75,7 +75,6 @@ func TestTools(t *testing.T) { "summary": "test summary", "state": "complete", "link": "https://example.com", - "emoji": "✅", }) require.NoError(t, err) }) diff --git a/codersdk/workspaceapps.go b/codersdk/workspaceapps.go index ec5a7c4414f76..a55db1911101e 100644 --- a/codersdk/workspaceapps.go +++ b/codersdk/workspaceapps.go @@ -100,18 +100,22 @@ type Healthcheck struct { } type WorkspaceAppStatus struct { - ID uuid.UUID `json:"id" format:"uuid"` - CreatedAt time.Time `json:"created_at" format:"date-time"` - WorkspaceID uuid.UUID `json:"workspace_id" format:"uuid"` - AgentID uuid.UUID `json:"agent_id" format:"uuid"` - AppID uuid.UUID `json:"app_id" format:"uuid"` - State WorkspaceAppStatusState `json:"state"` - NeedsUserAttention bool `json:"needs_user_attention"` - Message string `json:"message"` + ID uuid.UUID `json:"id" format:"uuid"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + WorkspaceID uuid.UUID `json:"workspace_id" format:"uuid"` + AgentID uuid.UUID `json:"agent_id" format:"uuid"` + AppID uuid.UUID `json:"app_id" format:"uuid"` + State WorkspaceAppStatusState `json:"state"` + Message string `json:"message"` // URI is the URI of the resource that the status is for. // e.g. https://github.com/org/repo/pull/123 // e.g. file:///path/to/file URI string `json:"uri"` + + // Deprecated: This field is unused and will be removed in a future version. // Icon is an external URL to an icon that will be rendered in the UI. Icon string `json:"icon"` + // Deprecated: This field is unused and will be removed in a future version. + // NeedsUserAttention specifies whether the status needs user attention. + NeedsUserAttention bool `json:"needs_user_attention"` } diff --git a/docs/reference/api/builds.md b/docs/reference/api/builds.md index 1e5ff95026eaf..1f795c3d7d313 100644 --- a/docs/reference/api/builds.md +++ b/docs/reference/api/builds.md @@ -818,10 +818,10 @@ Status Code **200** | `»»»» agent_id` | string(uuid) | false | | | | `»»»» app_id` | string(uuid) | false | | | | `»»»» created_at` | string(date-time) | false | | | -| `»»»» icon` | string | false | | Icon is an external URL to an icon that will be rendered in the UI. | +| `»»»» icon` | string | false | | Deprecated: This field is unused and will be removed in a future version. Icon is an external URL to an icon that will be rendered in the UI. | | `»»»» id` | string(uuid) | false | | | | `»»»» message` | string | false | | | -| `»»»» needs_user_attention` | boolean | false | | | +| `»»»» needs_user_attention` | boolean | false | | Deprecated: This field is unused and will be removed in a future version. NeedsUserAttention specifies whether the status needs user attention. | | `»»»» state` | [codersdk.WorkspaceAppStatusState](schemas.md#codersdkworkspaceappstatusstate) | false | | | | `»»»» uri` | string | false | | Uri is the URI of the resource that the status is for. e.g. https://github.com/org/repo/pull/123 e.g. file:///path/to/file | | `»»»» workspace_id` | string(uuid) | false | | | @@ -1532,10 +1532,10 @@ Status Code **200** | `»»»»» agent_id` | string(uuid) | false | | | | `»»»»» app_id` | string(uuid) | false | | | | `»»»»» created_at` | string(date-time) | false | | | -| `»»»»» icon` | string | false | | Icon is an external URL to an icon that will be rendered in the UI. | +| `»»»»» icon` | string | false | | Deprecated: This field is unused and will be removed in a future version. Icon is an external URL to an icon that will be rendered in the UI. | | `»»»»» id` | string(uuid) | false | | | | `»»»»» message` | string | false | | | -| `»»»»» needs_user_attention` | boolean | false | | | +| `»»»»» needs_user_attention` | boolean | false | | Deprecated: This field is unused and will be removed in a future version. NeedsUserAttention specifies whether the status needs user attention. | | `»»»»» state` | [codersdk.WorkspaceAppStatusState](schemas.md#codersdkworkspaceappstatusstate) | false | | | | `»»»»» uri` | string | false | | Uri is the URI of the resource that the status is for. e.g. https://github.com/org/repo/pull/123 e.g. file:///path/to/file | | `»»»»» workspace_id` | string(uuid) | false | | | diff --git a/docs/reference/api/schemas.md b/docs/reference/api/schemas.md index e5fa809ef23f0..85b6e65a545aa 100644 --- a/docs/reference/api/schemas.md +++ b/docs/reference/api/schemas.md @@ -133,14 +133,14 @@ ### Properties -| Name | Type | Required | Restrictions | Description | -|------------------------|----------------------------------------------------------------------|----------|--------------|-------------| -| `app_slug` | string | false | | | -| `icon` | string | false | | | -| `message` | string | false | | | -| `needs_user_attention` | boolean | false | | | -| `state` | [codersdk.WorkspaceAppStatusState](#codersdkworkspaceappstatusstate) | false | | | -| `uri` | string | false | | | +| Name | Type | Required | Restrictions | Description | +|------------------------|----------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------| +| `app_slug` | string | false | | | +| `icon` | string | false | | Deprecated: this field is unused and will be removed in a future version. | +| `message` | string | false | | | +| `needs_user_attention` | boolean | false | | Deprecated: this field is unused and will be removed in a future version. | +| `state` | [codersdk.WorkspaceAppStatusState](#codersdkworkspaceappstatusstate) | false | | | +| `uri` | string | false | | | ## agentsdk.PatchLogs @@ -8499,18 +8499,18 @@ If the schedule is empty, the user will be updated to use the default schedule.| ### Properties -| Name | Type | Required | Restrictions | Description | -|------------------------|----------------------------------------------------------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------| -| `agent_id` | string | false | | | -| `app_id` | string | false | | | -| `created_at` | string | false | | | -| `icon` | string | false | | Icon is an external URL to an icon that will be rendered in the UI. | -| `id` | string | false | | | -| `message` | string | false | | | -| `needs_user_attention` | boolean | false | | | -| `state` | [codersdk.WorkspaceAppStatusState](#codersdkworkspaceappstatusstate) | false | | | -| `uri` | string | false | | Uri is the URI of the resource that the status is for. e.g. https://github.com/org/repo/pull/123 e.g. file:///path/to/file | -| `workspace_id` | string | false | | | +| Name | Type | Required | Restrictions | Description | +|------------------------|----------------------------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------| +| `agent_id` | string | false | | | +| `app_id` | string | false | | | +| `created_at` | string | false | | | +| `icon` | string | false | | Deprecated: This field is unused and will be removed in a future version. Icon is an external URL to an icon that will be rendered in the UI. | +| `id` | string | false | | | +| `message` | string | false | | | +| `needs_user_attention` | boolean | false | | Deprecated: This field is unused and will be removed in a future version. NeedsUserAttention specifies whether the status needs user attention. | +| `state` | [codersdk.WorkspaceAppStatusState](#codersdkworkspaceappstatusstate) | false | | | +| `uri` | string | false | | Uri is the URI of the resource that the status is for. e.g. https://github.com/org/repo/pull/123 e.g. file:///path/to/file | +| `workspace_id` | string | false | | | ## codersdk.WorkspaceAppStatusState diff --git a/docs/reference/api/templates.md b/docs/reference/api/templates.md index f48a9482fa695..0f21cfccac670 100644 --- a/docs/reference/api/templates.md +++ b/docs/reference/api/templates.md @@ -2429,10 +2429,10 @@ Status Code **200** | `»»»» agent_id` | string(uuid) | false | | | | `»»»» app_id` | string(uuid) | false | | | | `»»»» created_at` | string(date-time) | false | | | -| `»»»» icon` | string | false | | Icon is an external URL to an icon that will be rendered in the UI. | +| `»»»» icon` | string | false | | Deprecated: This field is unused and will be removed in a future version. Icon is an external URL to an icon that will be rendered in the UI. | | `»»»» id` | string(uuid) | false | | | | `»»»» message` | string | false | | | -| `»»»» needs_user_attention` | boolean | false | | | +| `»»»» needs_user_attention` | boolean | false | | Deprecated: This field is unused and will be removed in a future version. NeedsUserAttention specifies whether the status needs user attention. | | `»»»» state` | [codersdk.WorkspaceAppStatusState](schemas.md#codersdkworkspaceappstatusstate) | false | | | | `»»»» uri` | string | false | | Uri is the URI of the resource that the status is for. e.g. https://github.com/org/repo/pull/123 e.g. file:///path/to/file | | `»»»» workspace_id` | string(uuid) | false | | | @@ -2976,10 +2976,10 @@ Status Code **200** | `»»»» agent_id` | string(uuid) | false | | | | `»»»» app_id` | string(uuid) | false | | | | `»»»» created_at` | string(date-time) | false | | | -| `»»»» icon` | string | false | | Icon is an external URL to an icon that will be rendered in the UI. | +| `»»»» icon` | string | false | | Deprecated: This field is unused and will be removed in a future version. Icon is an external URL to an icon that will be rendered in the UI. | | `»»»» id` | string(uuid) | false | | | | `»»»» message` | string | false | | | -| `»»»» needs_user_attention` | boolean | false | | | +| `»»»» needs_user_attention` | boolean | false | | Deprecated: This field is unused and will be removed in a future version. NeedsUserAttention specifies whether the status needs user attention. | | `»»»» state` | [codersdk.WorkspaceAppStatusState](schemas.md#codersdkworkspaceappstatusstate) | false | | | | `»»»» uri` | string | false | | Uri is the URI of the resource that the status is for. e.g. https://github.com/org/repo/pull/123 e.g. file:///path/to/file | | `»»»» workspace_id` | string(uuid) | false | | | diff --git a/site/src/api/typesGenerated.ts b/site/src/api/typesGenerated.ts index 24562dab7c04a..a0274ba099361 100644 --- a/site/src/api/typesGenerated.ts +++ b/site/src/api/typesGenerated.ts @@ -3445,10 +3445,10 @@ export interface WorkspaceAppStatus { readonly agent_id: string; readonly app_id: string; readonly state: WorkspaceAppStatusState; - readonly needs_user_attention: boolean; readonly message: string; readonly uri: string; readonly icon: string; + readonly needs_user_attention: boolean; } // From codersdk/workspaceapps.go diff --git a/site/src/testHelpers/entities.ts b/site/src/testHelpers/entities.ts index a434c56200a87..8b19905286a22 100644 --- a/site/src/testHelpers/entities.ts +++ b/site/src/testHelpers/entities.ts @@ -984,11 +984,12 @@ export const MockWorkspaceAppStatus: TypesGen.WorkspaceAppStatus = { agent_id: "test-workspace-agent", workspace_id: "test-workspace", app_id: MockWorkspaceApp.id, - needs_user_attention: false, - icon: "/emojis/1f957.png", uri: "https://github.com/coder/coder/pull/1234", message: "Your competitors page is completed!", state: "complete", + // Deprecated fields + needs_user_attention: false, + icon: "", }; export const MockWorkspaceAgentDisconnected: TypesGen.WorkspaceAgent = {