refactor: create tasks in coderd instead of frontend (#19280)

Instead of creating tasks with a specialized call to `CreateWorkspace`
on the frontend, we instead lift this to the backend and allow the
frontend to simply call `CreateAITask`.
This commit is contained in:
Danielle Maywood
2025-08-12 11:23:55 +01:00
committed by GitHub
parent cda1a3a593
commit f349edcc3c
14 changed files with 362 additions and 4 deletions
@@ -1531,6 +1531,13 @@ func (m queryMetricsStore) GetTemplateVersionByTemplateIDAndName(ctx context.Con
return version, err
}
func (m queryMetricsStore) GetTemplateVersionHasAITask(ctx context.Context, id uuid.UUID) (bool, error) {
start := time.Now()
r0, r1 := m.s.GetTemplateVersionHasAITask(ctx, id)
m.queryLatencies.WithLabelValues("GetTemplateVersionHasAITask").Observe(time.Since(start).Seconds())
return r0, r1
}
func (m queryMetricsStore) GetTemplateVersionParameters(ctx context.Context, templateVersionID uuid.UUID) ([]database.TemplateVersionParameter, error) {
start := time.Now()
parameters, err := m.s.GetTemplateVersionParameters(ctx, templateVersionID)