Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit101cf64

Browse files
committed
mark fields of PatchAppStatus as deprecated
1 parent4e924af commit101cf64

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

‎coderd/workspaceagents_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,10 @@ func TestWorkspaceAgentAppStatus(t *testing.T) {
366366
AppSlug:"vscode",
367367
Message:"testing",
368368
URI:"https://example.com",
369-
Icon:"https://example.com/icon.png",
370369
State:codersdk.WorkspaceAppStatusStateComplete,
370+
// Ensure deprecated fields are ignored.
371+
Icon:"https://example.com/icon.png",
372+
NeedsUserAttention:true,
371373
})
372374
require.NoError(t,err)
373375

@@ -376,6 +378,9 @@ func TestWorkspaceAgentAppStatus(t *testing.T) {
376378
agent,err:=client.WorkspaceAgent(ctx,workspace.LatestBuild.Resources[0].Agents[0].ID)
377379
require.NoError(t,err)
378380
require.Len(t,agent.Apps[0].Statuses,1)
381+
// Deprecated fields should be ignored.
382+
require.Empty(t,agent.Apps[0].Statuses[0].Icon)
383+
require.False(t,agent.Apps[0].Statuses[0].NeedsUserAttention)
379384
})
380385
}
381386

‎codersdk/agentsdk/agentsdk.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -583,12 +583,14 @@ func (c *Client) PatchLogs(ctx context.Context, req PatchLogs) error {
583583

584584
// PatchAppStatus updates the status of a workspace app.
585585
typePatchAppStatusstruct {
586-
AppSlugstring`json:"app_slug"`
587-
NeedsUserAttentionbool`json:"needs_user_attention"`
588-
State codersdk.WorkspaceAppStatusState`json:"state"`
589-
Messagestring`json:"message"`
590-
URIstring`json:"uri"`
591-
Iconstring`json:"icon"`
586+
AppSlugstring`json:"app_slug"`
587+
State codersdk.WorkspaceAppStatusState`json:"state"`
588+
Messagestring`json:"message"`
589+
URIstring`json:"uri"`
590+
// Deprecated: this field is unused and will be removed in a future version.
591+
Iconstring`json:"icon"`
592+
// Deprecated: this field is unused and will be removed in a future version.
593+
NeedsUserAttentionbool`json:"needs_user_attention"`
592594
}
593595

594596
func (c*Client)PatchAppStatus(ctx context.Context,reqPatchAppStatus)error {

‎codersdk/workspaceapps.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,16 @@ type WorkspaceAppStatus struct {
106106
AgentID uuid.UUID`json:"agent_id" format:"uuid"`
107107
AppID uuid.UUID`json:"app_id" format:"uuid"`
108108
StateWorkspaceAppStatusState`json:"state"`
109-
// Deprecated: This field is unused and will be removed in a future version.
110-
NeedsUserAttentionbool`json:"needs_user_attention"`
111-
Messagestring`json:"message"`
109+
Messagestring`json:"message"`
112110
// URI is the URI of the resource that the status is for.
113111
// e.g. https://github.com/org/repo/pull/123
114112
// e.g. file:///path/to/file
115113
URIstring`json:"uri"`
116-
// Icon is an external URL to an icon that will be rendered in the UI.
114+
117115
// Deprecated: This field is unused and will be removed in a future version.
116+
// Icon is an external URL to an icon that will be rendered in the UI.
118117
Iconstring`json:"icon"`
118+
// Deprecated: This field is unused and will be removed in a future version.
119+
// NeedsUserAttention specifies whether the status needs user attention.
120+
NeedsUserAttentionbool`json:"needs_user_attention"`
119121
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp