You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f31e6e0
Browse filesBrowse the repository at this point in the historyBrowse files
chore(provisioner): support updated coder_ai_task resource (#20160)
Closescoder/internal#978
- Introduce `CODER_TASK_ID` and `CODER_TASK_PROMPT` to the provisioner
environment
- Make use of new `app_id` field in provider, with a fallback to
`sidebar_app.id` for backwards compatibility
**For now** I've left the `taskPrompt` and `taskID` as a TODO as we do
not yet create these values.
fmt.Sprintf("Unknown ai_task_sidebar_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.", sidebarAppID.UUID.String()),
2071
+
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()),
2055
2072
"Template author: double-check the following:",
2056
2073
" - You have associated the coder_ai_task with a valid coder_app in your template (ref: https://registry.terraform.io/providers/coder/coder/latest/docs/resources/ai_task).",
2057
2074
" - You have associated the coder_agent with at least one other compute resource. Agents with no other associated resources are not inserted into the database.",
2058
2075
},
2059
2076
}); err!=nil {
2060
-
s.Logger.Error(ctx, "insert provisioner job log for ai task sidebar app id warning",
2077
+
s.Logger.Error(ctx, "insert provisioner job log for ai task app id warning",
id = "7128be08-8722-44cb-bbe1-b5a391c4d94b" # fake ID, irrelevant here anyway but needed for validation
1065
-
}
1066
-
}
1067
-
`,
1068
-
},
1069
-
Request: &proto.PlanRequest{},
1070
-
Response: &proto.PlanComplete{
1071
-
Error: fmt.Sprintf("plan resources: coder_parameter named '%s' is required when 'coder_ai_task' resource is defined", provider.TaskPromptParameterName),
require.ErrorContains(t, err, fmt.Sprintf("coder_parameter named '%s' is required when 'coder_ai_task' resource is defined", provider.TaskPromptParameterName))
1549
-
})
1550
-
1551
1529
t.Run("Multiple tasks can be defined", func(t*testing.T) {
0 commit comments