Skip to content

feat: evaluate provisioner tags #13333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 23, 2024
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Stub for eval
  • Loading branch information
mtojek committed May 21, 2024
commit a77a2dc22c15d3f41e9d03471cdac3c5caab14df
8 changes: 7 additions & 1 deletion coderd/wsbuilder/wsbuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ func TestWorkspaceBuildWithTags(t *testing.T) {
Key: "project_tag",
Value: `"${data.coder_parameter.project.value}+12345"`,
},
{
Key: "team_tag",
Value: `"data.coder_parameter.team.value`,
},
{
Key: "is_debug_build",
Value: `data.coder_parameter.is_debug_build.value == "true" ? "in-debug-mode" : "no-debug"`,
Expand All @@ -273,12 +277,14 @@ func TestWorkspaceBuildWithTags(t *testing.T) {

richParameters := []database.TemplateVersionParameter{
// Parameters can be mutable although it is discouraged as the workspace can be moved between provisioner nodes.
{Name: "project", Description: "This is second parameter", Mutable: true, Options: json.RawMessage("[]")},
{Name: "project", Description: "This is first parameter", Mutable: true, Options: json.RawMessage("[]")},
{Name: "team", Description: "This is second parameter", Mutable: true, DefaultValue: "godzilla", Options: json.RawMessage("[]")},
{Name: "is_debug_build", Type: "bool", Description: "This is third parameter", Mutable: false, Options: json.RawMessage("[]")},
}

buildParameters := []codersdk.WorkspaceBuildParameter{
{Name: "project", Value: "foobar-foobaz"},
// "team" parameter is skipped, so default value is selected
{Name: "is_debug_build", Value: "true"},
}

Expand Down
Loading