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

Commit23a44d1

Browse files
feat: include latest build id in task responses (coder#20181)
Adding the latest build ID is necessary to locate the logs associatedwith the tasks in the UI.
1 parent1783ee1 commit23a44d1

File tree

6 files changed

+7
-0
lines changed

6 files changed

+7
-0
lines changed

‎cli/exp_task_status_test.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ STATE CHANGED STATUS HEALTHY STATE MESSAGE
193193
"workspace_agent_id": null,
194194
"workspace_agent_lifecycle": null,
195195
"workspace_agent_health": null,
196+
"latest_build_id": null,
196197
"initial_prompt": "",
197198
"status": "running",
198199
"current_state": {

‎coderd/aitasks.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ func taskFromWorkspace(ws codersdk.Workspace, initialPrompt string) codersdk.Tas
272272
WorkspaceAgentID:taskAgentID,
273273
WorkspaceAgentLifecycle:taskAgentLifecycle,
274274
WorkspaceAgentHealth:taskAgentHealth,
275+
LatestBuildID: uuid.NullUUID{Valid:true,UUID:ws.LatestBuild.ID},
275276
CreatedAt:ws.CreatedAt,
276277
UpdatedAt:ws.UpdatedAt,
277278
InitialPrompt:initialPrompt,

‎coderd/aitasks_test.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ func TestTasks(t *testing.T) {
270270
assert.Equal(t,wantPrompt,got.InitialPrompt,"task prompt should match the AI Prompt parameter")
271271
assert.Equal(t,workspace.Name,got.Name,"task name should map from workspace name")
272272
assert.Equal(t,workspace.ID,got.WorkspaceID.UUID,"workspace id should match")
273+
assert.Equal(t,workspace.LatestBuild.ID,got.LatestBuildID.UUID,"latest build id should match")
273274
// Status should be populated via app status or workspace status mapping.
274275
assert.NotEmpty(t,got.Status,"task status should not be empty")
275276
})
@@ -320,6 +321,7 @@ func TestTasks(t *testing.T) {
320321
assert.Equal(t,workspace.Name,task.Name,"task name should map from workspace name")
321322
assert.Equal(t,wantPrompt,task.InitialPrompt,"task prompt should match the AI Prompt parameter")
322323
assert.Equal(t,workspace.ID,task.WorkspaceID.UUID,"workspace id should match")
324+
assert.Equal(t,workspace.LatestBuild.ID,task.LatestBuildID.UUID,"latest build id should match")
323325
assert.NotEmpty(t,task.Status,"task status should not be empty")
324326

325327
// Stop the workspace

‎codersdk/aitasks.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ type Task struct {
119119
WorkspaceAgentID uuid.NullUUID`json:"workspace_agent_id" format:"uuid" table:"workspace agent id"`
120120
WorkspaceAgentLifecycle*WorkspaceAgentLifecycle`json:"workspace_agent_lifecycle" table:"workspace agent lifecycle"`
121121
WorkspaceAgentHealth*WorkspaceAgentHealth`json:"workspace_agent_health" table:"workspace agent health"`
122+
LatestBuildID uuid.NullUUID`json:"latest_build_id" format:"uuid" table:"latest build id"`
122123
InitialPromptstring`json:"initial_prompt" table:"initial prompt"`
123124
StatusWorkspaceStatus`json:"status" enums:"pending,starting,running,stopping,stopped,failed,canceling,canceled,deleting,deleted" table:"status"`
124125
CurrentState*TaskStateEntry`json:"current_state" table:"cs,recursive_inline"`

‎site/src/api/typesGenerated.ts‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎site/src/testHelpers/entities.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5031,6 +5031,7 @@ export const MockTask: TypesGen.Task = {
50315031
workspace_agent_id:MockWorkspaceAgent.id,
50325032
workspace_agent_lifecycle:MockWorkspaceAgent.lifecycle_state,
50335033
workspace_agent_health:MockWorkspaceAgent.health,
5034+
latest_build_id:MockWorkspace.latest_build.id,
50345035
initial_prompt:"Perform some task",
50355036
status:"running",
50365037
current_state:{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp