Skip to content

Commit caebbac

Browse files
committed
chore(codersdk): remove NeedsUserAttention and Icon from WorkspaceAppStatus
1 parent 69aa365 commit caebbac

File tree

12 files changed

+55
-79
lines changed

12 files changed

+55
-79
lines changed

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
@@ -9783,16 +9783,14 @@ func (q *FakeQuerier) InsertWorkspaceAppStatus(_ context.Context, arg database.I
97839783
defer q.mutex.Unlock()
97849784

97859785
status := database.WorkspaceAppStatus{
9786-
ID: arg.ID,
9787-
CreatedAt: arg.CreatedAt,
9788-
WorkspaceID: arg.WorkspaceID,
9789-
AgentID: arg.AgentID,
9790-
AppID: arg.AppID,
9791-
NeedsUserAttention: arg.NeedsUserAttention,
9792-
State: arg.State,
9793-
Message: arg.Message,
9794-
Uri: arg.Uri,
9795-
Icon: arg.Icon,
9786+
ID: arg.ID,
9787+
CreatedAt: arg.CreatedAt,
9788+
WorkspaceID: arg.WorkspaceID,
9789+
AgentID: arg.AgentID,
9790+
AppID: arg.AppID,
9791+
State: arg.State,
9792+
Message: arg.Message,
9793+
Uri: arg.Uri,
97969794
}
97979795
q.workspaceAppStatuses = append(q.workspaceAppStatuses, status)
97989796
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;

coderd/workspaceagents.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,6 @@ func (api *API) patchWorkspaceAgentAppStatus(rw http.ResponseWriter, r *http.Req
366366
String: req.URI,
367367
Valid: req.URI != "",
368368
},
369-
Icon: sql.NullString{
370-
String: req.Icon,
371-
Valid: req.Icon != "",
372-
},
373-
NeedsUserAttention: req.NeedsUserAttention,
374369
})
375370
if err != nil {
376371
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{

codersdk/workspaceapps.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,15 @@ type Healthcheck struct {
100100
}
101101

102102
type WorkspaceAppStatus struct {
103-
ID uuid.UUID `json:"id" format:"uuid"`
104-
CreatedAt time.Time `json:"created_at" format:"date-time"`
105-
WorkspaceID uuid.UUID `json:"workspace_id" format:"uuid"`
106-
AgentID uuid.UUID `json:"agent_id" format:"uuid"`
107-
AppID uuid.UUID `json:"app_id" format:"uuid"`
108-
State WorkspaceAppStatusState `json:"state"`
109-
NeedsUserAttention bool `json:"needs_user_attention"`
110-
Message string `json:"message"`
103+
ID uuid.UUID `json:"id" format:"uuid"`
104+
CreatedAt time.Time `json:"created_at" format:"date-time"`
105+
WorkspaceID uuid.UUID `json:"workspace_id" format:"uuid"`
106+
AgentID uuid.UUID `json:"agent_id" format:"uuid"`
107+
AppID uuid.UUID `json:"app_id" format:"uuid"`
108+
State WorkspaceAppStatusState `json:"state"`
109+
Message string `json:"message"`
111110
// URI is the URI of the resource that the status is for.
112111
// e.g. https://github.com/org/repo/pull/123
113112
// e.g. file:///path/to/file
114113
URI string `json:"uri"`
115-
// Icon is an external URL to an icon that will be rendered in the UI.
116-
Icon string `json:"icon"`
117114
}

site/src/api/typesGenerated.ts

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

site/src/testHelpers/entities.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,6 @@ export const MockWorkspaceAppStatus: TypesGen.WorkspaceAppStatus = {
984984
agent_id: "test-workspace-agent",
985985
workspace_id: "test-workspace",
986986
app_id: MockWorkspaceApp.id,
987-
needs_user_attention: false,
988-
icon: "/emojis/1f957.png",
989987
uri: "https://github.com/coder/coder/pull/1234",
990988
message: "Your competitors page is completed!",
991989
state: "complete",

0 commit comments

Comments
 (0)