chore: revert "feat: include latest build id in task responses" (#20184)

Reverts coder/coder#20181

I realized we don’t need this in the task response. When loading a task,
we already need much more workspace information, so it makes more sense
to fetch the workspace data separately instead of trying to embed all
its details into the response.

I think we can keep the task response clean and focused on the essential
information needed to list tasks. For more specific details, we can
fetch the related resources as needed. So, I’m reverting this PR.
This commit is contained in:
Bruno Quaresma
2025-10-06 14:44:11 -03:00
committed by GitHub
parent 23a44d10ac
commit 83c4611293
6 changed files with 0 additions and 7 deletions
-1
View File
@@ -272,7 +272,6 @@ func taskFromWorkspace(ws codersdk.Workspace, initialPrompt string) codersdk.Tas
WorkspaceAgentID: taskAgentID,
WorkspaceAgentLifecycle: taskAgentLifecycle,
WorkspaceAgentHealth: taskAgentHealth,
LatestBuildID: uuid.NullUUID{Valid: true, UUID: ws.LatestBuild.ID},
CreatedAt: ws.CreatedAt,
UpdatedAt: ws.UpdatedAt,
InitialPrompt: initialPrompt,
-2
View File
@@ -270,7 +270,6 @@ func TestTasks(t *testing.T) {
assert.Equal(t, wantPrompt, got.InitialPrompt, "task prompt should match the AI Prompt parameter")
assert.Equal(t, workspace.Name, got.Name, "task name should map from workspace name")
assert.Equal(t, workspace.ID, got.WorkspaceID.UUID, "workspace id should match")
assert.Equal(t, workspace.LatestBuild.ID, got.LatestBuildID.UUID, "latest build id should match")
// Status should be populated via app status or workspace status mapping.
assert.NotEmpty(t, got.Status, "task status should not be empty")
})
@@ -321,7 +320,6 @@ func TestTasks(t *testing.T) {
assert.Equal(t, workspace.Name, task.Name, "task name should map from workspace name")
assert.Equal(t, wantPrompt, task.InitialPrompt, "task prompt should match the AI Prompt parameter")
assert.Equal(t, workspace.ID, task.WorkspaceID.UUID, "workspace id should match")
assert.Equal(t, workspace.LatestBuild.ID, task.LatestBuildID.UUID, "latest build id should match")
assert.NotEmpty(t, task.Status, "task status should not be empty")
// Stop the workspace