()
| 616 | } |
| 617 | |
| 618 | func (b ProvisionerJobResourcesBuilder) Do() { |
| 619 | b.t.Helper() |
| 620 | transition := b.transition |
| 621 | if transition == "" { |
| 622 | b.logger.Debug(context.Background(), "setting default transition to start") |
| 623 | transition = database.WorkspaceTransitionStart |
| 624 | } |
| 625 | for _, resource := range b.resources { |
| 626 | //nolint:gocritic // This is only used by tests. |
| 627 | err := provisionerdserver.InsertWorkspaceResource(ownerCtx, b.db, b.jobID, transition, resource, &telemetry.Snapshot{}) |
| 628 | require.NoError(b.t, err) |
| 629 | b.logger.Debug(context.Background(), "created workspace resource", |
| 630 | slog.F("resource_name", resource.Name), |
| 631 | slog.F("agent_count", len(resource.Agents)), |
| 632 | ) |
| 633 | } |
| 634 | } |
| 635 | |
| 636 | type TemplateVersionResponse struct { |
| 637 | Template database.Template |
nothing calls this directly
no test coverage detected