Skip to content

Commit c6cda84

Browse files
committed
Deprecate parse
1 parent c7e8d4e commit c6cda84

23 files changed

+1387
-1371
lines changed

cli/create_test.go

+12-18
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ func TestCreate(t *testing.T) {
257257
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
258258
user := coderdtest.CreateFirstUser(t, client)
259259
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
260-
Parse: []*proto.Parse_Response{{
261-
Type: &proto.Parse_Response_Complete{
262-
Complete: &proto.Parse_Complete{
260+
Parse: []*proto.DeprecatedParse_Response{{
261+
Type: &proto.DeprecatedParse_Response_Complete{
262+
Complete: &proto.DeprecatedParse_Complete{
263263
ParameterSchemas: echo.ParameterSuccess,
264264
},
265265
},
@@ -297,35 +297,29 @@ func TestCreate(t *testing.T) {
297297
})
298298
}
299299

300-
func createTestParseResponseWithDefault(defaultValue string) []*proto.Parse_Response {
301-
return []*proto.Parse_Response{{
302-
Type: &proto.Parse_Response_Complete{
303-
Complete: &proto.Parse_Complete{
304-
ParameterSchemas: []*proto.ParameterSchema{
300+
func createTestParseResponseWithDefault(defaultValue string) []*proto.DeprecatedParse_Response {
301+
return []*proto.DeprecatedParse_Response{{
302+
Type: &proto.DeprecatedParse_Response_Complete{
303+
Complete: &proto.DeprecatedParse_Complete{
304+
ParameterSchemas: []*proto.DeprecatedParameterSchema{
305305
{
306306
AllowOverrideSource: true,
307307
Name: "region",
308308
Description: "description 1",
309-
DefaultSource: &proto.ParameterSource{
310-
Scheme: proto.ParameterSource_DATA,
309+
DefaultSource: &proto.DeprecatedParameterSource{
310+
Scheme: proto.DeprecatedParameterSource_DATA,
311311
Value: defaultValue,
312312
},
313-
DefaultDestination: &proto.ParameterDestination{
314-
Scheme: proto.ParameterDestination_PROVISIONER_VARIABLE,
315-
},
316313
},
317314
{
318315
AllowOverrideSource: true,
319316
Name: "username",
320317
Description: "description 2",
321-
DefaultSource: &proto.ParameterSource{
322-
Scheme: proto.ParameterSource_DATA,
318+
DefaultSource: &proto.DeprecatedParameterSource{
319+
Scheme: proto.DeprecatedParameterSource_DATA,
323320
// No default value
324321
Value: "",
325322
},
326-
DefaultDestination: &proto.ParameterDestination{
327-
Scheme: proto.ParameterDestination_PROVISIONER_VARIABLE,
328-
},
329323
},
330324
},
331325
},

cli/templatecreate_test.go

+5-8
Original file line numberDiff line numberDiff line change
@@ -258,17 +258,14 @@ func TestTemplateCreate(t *testing.T) {
258258
})
259259
}
260260

261-
func createTestParseResponse() []*proto.Parse_Response {
262-
return []*proto.Parse_Response{{
263-
Type: &proto.Parse_Response_Complete{
264-
Complete: &proto.Parse_Complete{
265-
ParameterSchemas: []*proto.ParameterSchema{{
261+
func createTestParseResponse() []*proto.DeprecatedParse_Response {
262+
return []*proto.DeprecatedParse_Response{{
263+
Type: &proto.DeprecatedParse_Response_Complete{
264+
Complete: &proto.DeprecatedParse_Complete{
265+
ParameterSchemas: []*proto.DeprecatedParameterSchema{{
266266
AllowOverrideSource: true,
267267
Name: "region",
268268
Description: "description",
269-
DefaultDestination: &proto.ParameterDestination{
270-
Scheme: proto.ParameterDestination_PROVISIONER_VARIABLE,
271-
},
272269
}},
273270
},
274271
},

cli/templatepull_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,18 @@ func TestTemplatePull(t *testing.T) {
131131
// a template version source.
132132
func genTemplateVersionSource() *echo.Responses {
133133
return &echo.Responses{
134-
Parse: []*proto.Parse_Response{
134+
Parse: []*proto.DeprecatedParse_Response{
135135
{
136-
Type: &proto.Parse_Response_Log{
136+
Type: &proto.DeprecatedParse_Response_Log{
137137
Log: &proto.Log{
138138
Output: uuid.NewString(),
139139
},
140140
},
141141
},
142142

143143
{
144-
Type: &proto.Parse_Response_Complete{
145-
Complete: &proto.Parse_Complete{},
144+
Type: &proto.DeprecatedParse_Response_Complete{
145+
Complete: &proto.DeprecatedParse_Complete{},
146146
},
147147
},
148148
},

coderd/database/dump.sql

+12-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/migrations/000055_parameters.up.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ CREATE TABLE template_version_parameters (
1313
unique (template_version_id, name)
1414
);
1515

16-
CREATE TABLE workspace_parameters (
17-
workspace_id uuid not null,
16+
CREATE TABLE workspace_build_parameters (
17+
workspace_build_id uuid not null references workspace_builds (id) on delete cascade,
1818
name text not null,
1919
value text not null,
20-
unique (workspace_id, name)
20+
unique (workspace_build_id, name)
2121
);

coderd/database/models.go

+20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/unique_constraint.go

+19-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)