Skip to content

Commit 6a92c6e

Browse files
committed
yeah that's probably fine actually
1 parent 295bceb commit 6a92c6e

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

coderd/database/dbauthz/dbauthz_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,8 @@ func (s *MethodTestSuite) TestTemplate() {
12651265
job := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{})
12661266
_ = dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{JobID: job.ID})
12671267
check.Args(database.InsertTemplateVersionTerraformValuesByJobIDParams{
1268-
JobID: job.ID,
1268+
JobID: job.ID,
1269+
CachedPlan: []byte("{}"),
12691270
}).Asserts(rbac.ResourceSystem, policy.ActionCreate)
12701271
}))
12711272
s.Run("SoftDeleteTemplateByID", s.Subtest(func(db database.Store, check *expects) {

coderd/provisionerdserver/provisionerdserver_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,7 @@ func TestCompleteJob(t *testing.T) {
10601060
ExternalAuthProviders: []*sdkproto.ExternalAuthProviderResource{{
10611061
Id: "github",
10621062
}},
1063+
Plan: []byte("{}"),
10631064
},
10641065
},
10651066
})
@@ -1115,6 +1116,7 @@ func TestCompleteJob(t *testing.T) {
11151116
}},
11161117
StopResources: []*sdkproto.Resource{},
11171118
ExternalAuthProviders: []*sdkproto.ExternalAuthProviderResource{{Id: "github"}},
1119+
Plan: []byte("{}"),
11181120
},
11191121
},
11201122
})
@@ -1523,6 +1525,7 @@ func TestCompleteJob(t *testing.T) {
15231525
Source: "github.com/example2/example",
15241526
},
15251527
},
1528+
Plan: []byte("{}"),
15261529
},
15271530
},
15281531
},

provisioner/echo/serve.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,15 @@ func TarWithOptions(ctx context.Context, logger slog.Logger, responses *Response
313313
}
314314
}
315315
for trans, m := range responses.ProvisionPlanMap {
316-
for i, rs := range m {
317-
err := writeProto(fmt.Sprintf("%d.%s.plan.protobuf", i, strings.ToLower(trans.String())), rs)
316+
for i, resp := range m {
317+
plan := resp.GetPlan()
318+
if plan != nil {
319+
if len(plan.Plan) == 0 {
320+
plan.Plan = []byte("{}")
321+
}
322+
}
323+
324+
err := writeProto(fmt.Sprintf("%d.%s.plan.protobuf", i, strings.ToLower(trans.String())), resp)
318325
if err != nil {
319326
return nil, err
320327
}

0 commit comments

Comments
 (0)