fix(coderd/provisionerdserver): correct managed agent tracking#21696
fix(coderd/provisionerdserver): correct managed agent tracking#21696
Conversation
| return nil | ||
| } | ||
|
|
||
| func seedPreviousWorkspaceStartWithAITask(ctx context.Context, t testing.TB, db database.Store) error { |
| { | ||
| name: "current build does not have ai task but previous build did", | ||
| seedFunc: seedPreviousWorkspaceStartWithAITask, | ||
| transition: database.WorkspaceTransitionStop, | ||
| input: &proto.CompletedJob_WorkspaceBuild{ | ||
| AiTasks: []*sdkproto.AITask{}, | ||
| Resources: []*sdkproto.Resource{}, | ||
| }, | ||
| isTask: true, | ||
| expectTaskStatus: database.TaskStatusPaused, | ||
| expectHasAiTask: false, // We no longer inherit this from the previous build. | ||
| expectUsageEvent: false, | ||
| }, |
There was a problem hiding this comment.
review: this test case is no longer valid
| Stage: []string{"Cleaning Up", "Cleaning Up", "Cleaning Up", "Cleaning Up"}, | ||
| Output: []string{ | ||
| fmt.Sprintf("Unknown ai_task_app_id %q. This workspace will be unable to run AI tasks. This may be due to a template configuration issue, please check with the template author.", taskAppID.UUID.String()), | ||
| fmt.Sprintf("Unknown ai_task_app_id %q. This workspace will be unable to run AI tasks. This may be due to a template configuration issue, please check with the template author.", unknownAppID), |
There was a problem hiding this comment.
review: drive-by fix to avoid getting a uuid.Nil in the log which isn't really useful here
deansheather
left a comment
There was a problem hiding this comment.
The usage code looks correct, I don't know enough about tasks to comment on the other changes, though.
Documentation CheckNo Changes NeededThis PR corrects internal tracking logic for managed agents in the provisioner server. The change affects how Reasoning:
Automated review via Coder Tasks |
| // You can still "sort of" use a task in this state, but as we don't have | ||
| // the correct app ID you won't be able to communicate with it via Coder. | ||
| expectHasAiTask: true, | ||
| expectUsageEvent: true, |
There was a problem hiding this comment.
review: We decided to count "misconfigured but otherwise working".
Relates to coder/internal#1282
Updates tracking of managed agents to be predicated instead on the presence of a related
task_idinstead of the presence of acoder_ai_taskresource.