Skip to content

Commit 979687c

Browse files
authored
chore(codersdk): deprecate WorkspaceAppStatus.{NeedsUserAttention,Icon} (#17358)
#17163 introduced the `workspace_app_statuses` table. Two of these fields (`needs_user_attention`, `icon`) turned out to be surplus to requirements. - Removes columns `needs_user_attention` and `icon` from `workspace_app_statuses` - Marks the corresponding fields of `codersdk.WorkspaceAppStatus` as deprecated.
1 parent 95f03c5 commit 979687c

21 files changed

+119
-129
lines changed

coderd/apidoc/docs.go

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/db2sdk/db2sdk.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -537,16 +537,14 @@ func WorkspaceAppStatuses(statuses []database.WorkspaceAppStatus) []codersdk.Wor
537537

538538
func WorkspaceAppStatus(status database.WorkspaceAppStatus) codersdk.WorkspaceAppStatus {
539539
return codersdk.WorkspaceAppStatus{
540-
ID: status.ID,
541-
CreatedAt: status.CreatedAt,
542-
WorkspaceID: status.WorkspaceID,
543-
AgentID: status.AgentID,
544-
AppID: status.AppID,
545-
NeedsUserAttention: status.NeedsUserAttention,
546-
URI: status.Uri.String,
547-
Icon: status.Icon.String,
548-
Message: status.Message,
549-
State: codersdk.WorkspaceAppStatusState(status.State),
540+
ID: status.ID,
541+
CreatedAt: status.CreatedAt,
542+
WorkspaceID: status.WorkspaceID,
543+
AgentID: status.AgentID,
544+
AppID: status.AppID,
545+
URI: status.Uri.String,
546+
Message: status.Message,
547+
State: codersdk.WorkspaceAppStatusState(status.State),
550548
}
551549
}
552550

coderd/database/dbmem/dbmem.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9764,16 +9764,14 @@ func (q *FakeQuerier) InsertWorkspaceAppStatus(_ context.Context, arg database.I
97649764
defer q.mutex.Unlock()
97659765

97669766
status := database.WorkspaceAppStatus{
9767-
ID: arg.ID,
9768-
CreatedAt: arg.CreatedAt,
9769-
WorkspaceID: arg.WorkspaceID,
9770-
AgentID: arg.AgentID,
9771-
AppID: arg.AppID,
9772-
NeedsUserAttention: arg.NeedsUserAttention,
9773-
State: arg.State,
9774-
Message: arg.Message,
9775-
Uri: arg.Uri,
9776-
Icon: arg.Icon,
9767+
ID: arg.ID,
9768+
CreatedAt: arg.CreatedAt,
9769+
WorkspaceID: arg.WorkspaceID,
9770+
AgentID: arg.AgentID,
9771+
AppID: arg.AppID,
9772+
State: arg.State,
9773+
Message: arg.Message,
9774+
Uri: arg.Uri,
97779775
}
97789776
q.workspaceAppStatuses = append(q.workspaceAppStatuses, status)
97799777
return status, nil

coderd/database/dump.sql

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE ONLY workspace_app_statuses
2+
ADD COLUMN IF NOT EXISTS needs_user_attention BOOLEAN NOT NULL DEFAULT FALSE,
3+
ADD COLUMN IF NOT EXISTS icon TEXT;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE ONLY workspace_app_statuses
2+
DROP COLUMN IF EXISTS needs_user_attention,
3+
DROP COLUMN IF EXISTS icon;

coderd/database/models.go

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

coderd/database/queries.sql.go

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

coderd/database/queries/workspaceapps.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ WHERE
4444
id = $1;
4545

4646
-- name: InsertWorkspaceAppStatus :one
47-
INSERT INTO workspace_app_statuses (id, created_at, workspace_id, agent_id, app_id, state, message, needs_user_attention, uri, icon)
48-
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
47+
INSERT INTO workspace_app_statuses (id, created_at, workspace_id, agent_id, app_id, state, message, uri)
48+
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
4949
RETURNING *;
5050

5151
-- name: GetWorkspaceAppStatusesByAppIDs :many
@@ -54,6 +54,6 @@ SELECT * FROM workspace_app_statuses WHERE app_id = ANY(@ids :: uuid [ ]);
5454
-- name: GetLatestWorkspaceAppStatusesByWorkspaceIDs :many
5555
SELECT DISTINCT ON (workspace_id)
5656
*
57-
FROM workspace_app_statuses
57+
FROM workspace_app_statuses
5858
WHERE workspace_id = ANY(@ids :: uuid[])
5959
ORDER BY workspace_id, created_at DESC;

0 commit comments

Comments
 (0)