Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
bcdaf74
chore: refactor provisioner to handle more discrete terraform actions
Emyrk Nov 25, 2025
a148996
chore: initial init work, does not work for template import yet
Emyrk Nov 25, 2025
f9fb825
init step broken out
Emyrk Nov 25, 2025
8176ece
chore: echo provisioner, graph, and init
Emyrk Nov 25, 2025
c89d824
graph step in executor
Emyrk Nov 25, 2025
cbac23e
formatting
Emyrk Nov 25, 2025
94aa0f7
fix echo provisioner
Emyrk Nov 25, 2025
d454ca1
fmt
Emyrk Nov 25, 2025
2ac5bcf
fix dynamic param test
Emyrk Nov 25, 2025
3c94ed9
fix tests
Emyrk Nov 25, 2025
0e00edf
solve more tests
Emyrk Nov 25, 2025
d15327a
solve more tests
Emyrk Nov 25, 2025
121f9f8
more test fixes
Emyrk Nov 26, 2025
974dff9
fmt
Emyrk Nov 26, 2025
3e0c099
test fixes
Emyrk Nov 26, 2025
41f9dd5
test fixes
Emyrk Nov 26, 2025
4373086
make fmt
Emyrk Nov 26, 2025
8ef0f89
provisioner test fixes
Emyrk Nov 26, 2025
346183a
scaletest fixes
Emyrk Nov 26, 2025
c8c6e3d
test fixes
Emyrk Nov 26, 2025
7bf9707
provisioner test fixes
Emyrk Nov 26, 2025
11815cb
make gen
Emyrk Nov 26, 2025
ef7b33e
e2e fixes
Emyrk Nov 26, 2025
a422514
fmt
Emyrk Nov 26, 2025
c79f45e
graph is at the end now
Emyrk Nov 26, 2025
1c76f44
test
Emyrk Nov 26, 2025
de93769
ci push
Emyrk Nov 26, 2025
0a69503
make gen
Emyrk Nov 26, 2025
cf5acd3
more test fixes
Emyrk Nov 26, 2025
b6c2671
more test fixes
Emyrk Nov 26, 2025
54109a4
fix linting
Emyrk Nov 26, 2025
9630d94
fix linting
Emyrk Nov 26, 2025
7ac45f3
timing fixes
Emyrk Nov 26, 2025
3d3b293
linting
Emyrk Nov 26, 2025
25aa046
more tests
Emyrk Nov 26, 2025
9e19ed4
more tests
Emyrk Nov 26, 2025
9e7fb7e
more tests
Emyrk Nov 26, 2025
07c65a9
more tests
Emyrk Nov 26, 2025
b93321e
more tests
Emyrk Dec 1, 2025
9a6ab44
more tests
Emyrk Dec 1, 2025
7494a9b
more tests
Emyrk Dec 1, 2025
07c8383
fix provisioner test
Emyrk Dec 1, 2025
14ee7f2
fix script envs
Emyrk Dec 1, 2025
feb63df
fix script envs
Emyrk Dec 1, 2025
f978207
more fixes to provisioning test
Emyrk Dec 1, 2025
08078c6
flip asserts
Emyrk Dec 1, 2025
bcf9ff6
add logs to timing test
Emyrk Dec 1, 2025
336231e
linting
Emyrk Dec 1, 2025
bee6934
fix race condition
Emyrk Dec 1, 2025
9906c0a
add e2e echos
Emyrk Dec 1, 2025
63fd15f
add e2e echos
Emyrk Dec 1, 2025
3d2c059
e2e changes
Emyrk Dec 1, 2025
32da8c7
init timing arrays
Emyrk Dec 1, 2025
e86c6e2
init timing arrays
Emyrk Dec 1, 2025
99e3fd9
fix serialization
Emyrk Dec 1, 2025
7add31c
revert playwright change
Emyrk Dec 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions cli/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ func TestCreate(t *testing.T) {
func prepareEchoResponses(parameters []*proto.RichParameter, presets ...*proto.Preset) *echo.Responses {
return &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: []*proto.Response{
ProvisionGraph: []*proto.Response{
{
Type: &proto.Response_Plan{
Plan: &proto.PlanComplete{
Type: &proto.Response_Graph{
Graph: &proto.GraphComplete{
Parameters: parameters,
Presets: presets,
},
Expand Down Expand Up @@ -1573,11 +1573,13 @@ func TestCreateValidateRichParameters(t *testing.T) {
func TestCreateWithGitAuth(t *testing.T) {
t.Parallel()
echoResponses := &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: []*proto.Response{
Parse: echo.ParseComplete,
ProvisionInit: echo.InitComplete,
ProvisionPlan: echo.PlanComplete,
ProvisionGraph: []*proto.Response{
{
Type: &proto.Response_Plan{
Plan: &proto.PlanComplete{
Type: &proto.Response_Graph{
Graph: &proto.GraphComplete{
ExternalAuthProviders: []*proto.ExternalAuthProviderResource{{Id: "github"}},
},
},
Expand Down
6 changes: 3 additions & 3 deletions cli/restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,10 @@ func TestRestartWithParameters(t *testing.T) {
echoResponses := func() *echo.Responses {
return &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: []*proto.Response{
ProvisionGraph: []*proto.Response{
{
Type: &proto.Response_Plan{
Plan: &proto.PlanComplete{
Type: &proto.Response_Graph{
Graph: &proto.GraphComplete{
Parameters: []*proto.RichParameter{
{
Name: immutableParameterName,
Expand Down
10 changes: 5 additions & 5 deletions cli/ssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func TestSSH(t *testing.T) {
version := coderdtest.CreateTemplateVersion(t, client, owner.OrganizationID, &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: echo.PlanComplete,
ProvisionApply: echo.ProvisionApplyWithAgent(authToken),
ProvisionGraph: echo.ProvisionGraphWithAgent(authToken),
})
coderdtest.AwaitTemplateVersionJobCompleted(t, client, version.ID)
template := coderdtest.CreateTemplate(t, client, owner.OrganizationID, version.ID)
Expand Down Expand Up @@ -244,7 +244,7 @@ func TestSSH(t *testing.T) {
version := coderdtest.CreateTemplateVersion(t, client, owner.OrganizationID, &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: echo.PlanComplete,
ProvisionApply: echo.ProvisionApplyWithAgent(authToken),
ProvisionGraph: echo.ProvisionGraphWithAgent(authToken),
})
coderdtest.AwaitTemplateVersionJobCompleted(t, client, version.ID)
template := coderdtest.CreateTemplate(t, client, owner.OrganizationID, version.ID)
Expand Down Expand Up @@ -305,7 +305,7 @@ func TestSSH(t *testing.T) {
echoResponses := &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: echo.PlanComplete,
ProvisionApply: echo.ProvisionApplyWithAgent(authToken),
ProvisionGraph: echo.ProvisionGraphWithAgent(authToken),
}

version := coderdtest.CreateTemplateVersion(t, ownerClient, owner.OrganizationID, echoResponses)
Expand All @@ -326,7 +326,7 @@ func TestSSH(t *testing.T) {
echoResponses2 := &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: echo.PlanComplete,
ProvisionApply: echo.ProvisionApplyWithAgent(authToken2),
ProvisionGraph: echo.ProvisionGraphWithAgent(authToken2),
}
version = coderdtest.UpdateTemplateVersion(t, ownerClient, owner.OrganizationID, echoResponses2, template.ID)
coderdtest.AwaitTemplateVersionJobCompleted(t, ownerClient, version.ID)
Expand Down Expand Up @@ -655,7 +655,7 @@ func TestSSH(t *testing.T) {
version := coderdtest.CreateTemplateVersion(t, client, owner.OrganizationID, &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: echo.PlanComplete,
ProvisionApply: echo.ProvisionApplyWithAgent(authToken),
ProvisionGraph: echo.ProvisionGraphWithAgent(authToken),
})
coderdtest.AwaitTemplateVersionJobCompleted(t, client, version.ID)
template := coderdtest.CreateTemplate(t, client, owner.OrganizationID, version.ID)
Expand Down
22 changes: 12 additions & 10 deletions cli/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ const (
func mutableParamsResponse() *echo.Responses {
return &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: []*proto.Response{
ProvisionGraph: []*proto.Response{
{
Type: &proto.Response_Plan{
Plan: &proto.PlanComplete{
Type: &proto.Response_Graph{
Graph: &proto.GraphComplete{
Parameters: []*proto.RichParameter{
{
Name: mutableParameterName,
Expand All @@ -59,10 +59,10 @@ func mutableParamsResponse() *echo.Responses {
func immutableParamsResponse() *echo.Responses {
return &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: []*proto.Response{
ProvisionGraph: []*proto.Response{
{
Type: &proto.Response_Plan{
Plan: &proto.PlanComplete{
Type: &proto.Response_Graph{
Graph: &proto.GraphComplete{
Parameters: []*proto.RichParameter{
{
Name: immutableParameterName,
Expand All @@ -83,11 +83,13 @@ func TestStart(t *testing.T) {

echoResponses := func() *echo.Responses {
return &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: []*proto.Response{
Parse: echo.ParseComplete,
ProvisionInit: echo.InitComplete,
ProvisionPlan: echo.PlanComplete,
ProvisionGraph: []*proto.Response{
{
Type: &proto.Response_Plan{
Plan: &proto.PlanComplete{
Type: &proto.Response_Graph{
Graph: &proto.GraphComplete{
Parameters: []*proto.RichParameter{
{
Name: ephemeralParameterName,
Expand Down
16 changes: 4 additions & 12 deletions cli/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,19 +285,10 @@ func createAITaskTemplate(t *testing.T, client *codersdk.Client, orgID uuid.UUID
taskAppID := uuid.New()
version := coderdtest.CreateTemplateVersion(t, client, orgID, &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: []*proto.Response{
ProvisionGraph: []*proto.Response{
{
Type: &proto.Response_Plan{
Plan: &proto.PlanComplete{
HasAiTasks: true,
},
},
},
},
ProvisionApply: []*proto.Response{
{
Type: &proto.Response_Apply{
Apply: &proto.ApplyComplete{
Type: &proto.Response_Graph{
Graph: &proto.GraphComplete{
Resources: []*proto.Resource{
{
Name: "example",
Expand All @@ -321,6 +312,7 @@ func createAITaskTemplate(t *testing.T, client *codersdk.Client, orgID uuid.UUID
},
},
},
HasAiTasks: true,
AiTasks: []*proto.AITask{
{
AppId: taskAppID.String(),
Expand Down
6 changes: 3 additions & 3 deletions cli/templatepresets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,10 @@ func TestTemplatePresets(t *testing.T) {
func templateWithPresets(presets []*proto.Preset) *echo.Responses {
return &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: []*proto.Response{
ProvisionGraph: []*proto.Response{
{
Type: &proto.Response_Plan{
Plan: &proto.PlanComplete{
Type: &proto.Response_Graph{
Graph: &proto.GraphComplete{
Presets: presets,
},
},
Expand Down
27 changes: 3 additions & 24 deletions cli/templatepush_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1323,31 +1323,10 @@ func createEchoResponsesWithTemplateVariables(templateVariables []*proto.Templat
func completeWithAgent() *echo.Responses {
return &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: []*proto.Response{
ProvisionGraph: []*proto.Response{
{
Type: &proto.Response_Plan{
Plan: &proto.PlanComplete{
Resources: []*proto.Resource{
{
Type: "compute",
Name: "main",
Agents: []*proto.Agent{
{
Name: "smith",
OperatingSystem: "linux",
Architecture: "i386",
},
},
},
},
},
},
},
},
ProvisionApply: []*proto.Response{
{
Type: &proto.Response_Apply{
Apply: &proto.ApplyComplete{
Type: &proto.Response_Graph{
Graph: &proto.GraphComplete{
Resources: []*proto.Resource{
{
Type: "compute",
Expand Down
1 change: 1 addition & 0 deletions cli/templateversionarchive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func TestTemplateVersionsArchive(t *testing.T) {
Parse: echo.ParseComplete,
ProvisionApply: echo.ApplyFailed,
ProvisionPlan: echo.PlanFailed,
ProvisionInit: echo.InitComplete,
}, func(request *codersdk.CreateTemplateVersionRequest) {
request.TemplateID = template.ID
})
Expand Down
2 changes: 1 addition & 1 deletion coderd/activitybump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestWorkspaceActivityBump(t *testing.T) {
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: echo.PlanComplete,
ProvisionApply: echo.ProvisionApplyWithAgent(agentToken),
ProvisionGraph: echo.ProvisionGraphWithAgent(agentToken),
})
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
coderdtest.AwaitTemplateVersionJobCompleted(t, client, version.ID)
Expand Down
46 changes: 19 additions & 27 deletions coderd/aitasks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,11 @@ func TestTasks(t *testing.T) {
taskAppID := uuid.New()
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: []*proto.Response{
ProvisionGraph: []*proto.Response{
{
Type: &proto.Response_Plan{
Plan: &proto.PlanComplete{
Type: &proto.Response_Graph{
Graph: &proto.GraphComplete{
HasAiTasks: true,
},
},
},
},
ProvisionApply: []*proto.Response{
{
Type: &proto.Response_Apply{
Apply: &proto.ApplyComplete{
Resources: []*proto.Resource{
{
Name: "example",
Expand Down Expand Up @@ -945,8 +937,8 @@ func TestTasksCreate(t *testing.T) {
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
Parse: echo.ParseComplete,
ProvisionApply: echo.ApplyComplete,
ProvisionPlan: []*proto.Response{
{Type: &proto.Response_Plan{Plan: &proto.PlanComplete{
ProvisionGraph: []*proto.Response{
{Type: &proto.Response_Graph{Graph: &proto.GraphComplete{
HasAiTasks: true,
}}},
},
Expand Down Expand Up @@ -989,8 +981,8 @@ func TestTasksCreate(t *testing.T) {
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
Parse: echo.ParseComplete,
ProvisionApply: echo.ApplyComplete,
ProvisionPlan: []*proto.Response{
{Type: &proto.Response_Plan{Plan: &proto.PlanComplete{
ProvisionGraph: []*proto.Response{
{Type: &proto.Response_Graph{Graph: &proto.GraphComplete{
Parameters: []*proto.RichParameter{{Name: codersdk.AITaskPromptParameterName, Type: "string"}},
HasAiTasks: true,
}}},
Expand Down Expand Up @@ -1091,8 +1083,8 @@ func TestTasksCreate(t *testing.T) {
version = coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
Parse: echo.ParseComplete,
ProvisionApply: echo.ApplyComplete,
ProvisionPlan: []*proto.Response{
{Type: &proto.Response_Plan{Plan: &proto.PlanComplete{
ProvisionGraph: []*proto.Response{
{Type: &proto.Response_Graph{Graph: &proto.GraphComplete{
HasAiTasks: true,
}}},
},
Expand Down Expand Up @@ -1212,8 +1204,8 @@ func TestTasksCreate(t *testing.T) {
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
Parse: echo.ParseComplete,
ProvisionApply: echo.ApplyComplete,
ProvisionPlan: []*proto.Response{
{Type: &proto.Response_Plan{Plan: &proto.PlanComplete{
ProvisionGraph: []*proto.Response{
{Type: &proto.Response_Graph{Graph: &proto.GraphComplete{
HasAiTasks: true,
}}},
},
Expand Down Expand Up @@ -1269,8 +1261,8 @@ func TestTasksCreate(t *testing.T) {
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
Parse: echo.ParseComplete,
ProvisionApply: echo.ApplyComplete,
ProvisionPlan: []*proto.Response{
{Type: &proto.Response_Plan{Plan: &proto.PlanComplete{
ProvisionGraph: []*proto.Response{
{Type: &proto.Response_Graph{Graph: &proto.GraphComplete{
HasAiTasks: true,
}}},
},
Expand Down Expand Up @@ -1303,8 +1295,8 @@ func TestTasksCreate(t *testing.T) {
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
Parse: echo.ParseComplete,
ProvisionApply: echo.ApplyComplete,
ProvisionPlan: []*proto.Response{
{Type: &proto.Response_Plan{Plan: &proto.PlanComplete{
ProvisionGraph: []*proto.Response{
{Type: &proto.Response_Graph{Graph: &proto.GraphComplete{
HasAiTasks: true,
}}},
},
Expand Down Expand Up @@ -1353,8 +1345,8 @@ func TestTasksCreate(t *testing.T) {
version1 := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
Parse: echo.ParseComplete,
ProvisionApply: echo.ApplyComplete,
ProvisionPlan: []*proto.Response{
{Type: &proto.Response_Plan{Plan: &proto.PlanComplete{
ProvisionGraph: []*proto.Response{
{Type: &proto.Response_Graph{Graph: &proto.GraphComplete{
HasAiTasks: true,
}}},
},
Expand All @@ -1365,8 +1357,8 @@ func TestTasksCreate(t *testing.T) {
version2 := coderdtest.UpdateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
Parse: echo.ParseComplete,
ProvisionApply: echo.ApplyComplete,
ProvisionPlan: []*proto.Response{
{Type: &proto.Response_Plan{Plan: &proto.PlanComplete{
ProvisionGraph: []*proto.Response{
{Type: &proto.Response_Graph{Graph: &proto.GraphComplete{
HasAiTasks: true,
}}},
},
Expand Down
33 changes: 3 additions & 30 deletions coderd/audit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,37 +476,10 @@ func TestAuditLogsFilter(t *testing.T) {
func completeWithAgentAndApp() *echo.Responses {
return &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: []*proto.Response{
ProvisionGraph: []*proto.Response{
{
Type: &proto.Response_Plan{
Plan: &proto.PlanComplete{
Resources: []*proto.Resource{
{
Type: "compute",
Name: "main",
Agents: []*proto.Agent{
{
Name: "smith",
OperatingSystem: "linux",
Architecture: "i386",
Apps: []*proto.App{
{
Slug: "app",
DisplayName: "App",
},
},
},
},
},
},
},
},
},
},
ProvisionApply: []*proto.Response{
{
Type: &proto.Response_Apply{
Apply: &proto.ApplyComplete{
Type: &proto.Response_Graph{
Graph: &proto.GraphComplete{
Resources: []*proto.Resource{
{
Type: "compute",
Expand Down
Loading
Loading