Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: make dynamic parameters opt-in by default for new templates#19006

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 35 commits intomainfromjaaydenh/dynamic-params-default-optin
Jul 29, 2025
Merged
Changes from1 commit
Commits
Show all changes
35 commits
Select commitHold shift + click to select a range
532218e
feat: make dynamic parameters opt-in by default for new templates
jaaydenhJul 22, 2025
2ec5806
fix: format
jaaydenhJul 22, 2025
b933efe
fix: fix stories
jaaydenhJul 22, 2025
7144f4f
chore: update warning content
jaaydenhJul 24, 2025
170c5c6
chore: cleanup
jaaydenhJul 28, 2025
9bbd2b2
flip golden default value
EmyrkJul 28, 2025
f25a9f8
chore: echo provisioner reponses to include terraform to match
EmyrkJul 28, 2025
b10945c
fixup! chore: echo provisioner reponses to include terraform to match
EmyrkJul 28, 2025
67dc627
fixup! fixup! chore: echo provisioner reponses to include terraform t…
EmyrkJul 28, 2025
9eeb11b
fix: use classic parameter flow for MockWorkspace
jaaydenhJul 28, 2025
7aa393c
sane defaultS
EmyrkJul 28, 2025
238df67
sane defaultS
EmyrkJul 28, 2025
ee116fb
fixup! sane defaultS
EmyrkJul 28, 2025
d6a2262
fixup! fixup! sane defaultS
EmyrkJul 28, 2025
cf8deb0
restart and ephemeral parameters resolved
EmyrkJul 28, 2025
fc7b5d7
fixup! restart and ephemeral parameters resolved
EmyrkJul 28, 2025
adce52e
add todo to fix this later
EmyrkJul 28, 2025
a2358bf
fix: fix storybook tests
jaaydenhJul 28, 2025
273411a
add todo to fix this later
EmyrkJul 28, 2025
0501cff
add todo to fix this later
EmyrkJul 28, 2025
b7064c0
default orphaned template versions to dynamic params
EmyrkJul 28, 2025
fdbf0eb
add migration to make data schema consistent
EmyrkJul 28, 2025
326d2bf
fixup! add migration to make data schema consistent
EmyrkJul 28, 2025
83e643d
make fmt
EmyrkJul 28, 2025
ccb76a4
fixup tag tests
EmyrkJul 28, 2025
c4f4fe5
parameters require names
EmyrkJul 28, 2025
95f53fd
fix(e2e): disable dynamic parameters for updateWorkspace tests
blink-so[bot]Jul 28, 2025
9ba0b67
fix: use classic parameters for workspace tests
jaaydenhJul 28, 2025
5cd3e0b
fix: fix e2e tests
jaaydenhJul 28, 2025
53b9ec6
fix: fix format
jaaydenhJul 28, 2025
8fb0043
fix form type
EmyrkJul 28, 2025
f88a934
fix test race
EmyrkJul 29, 2025
1aad58e
test fixes
EmyrkJul 29, 2025
5f1320c
formatting
EmyrkJul 29, 2025
9c4aa40
remove unused file
EmyrkJul 29, 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
PrevPrevious commit
NextNext commit
fixup tag tests
  • Loading branch information
@Emyrk
Emyrk committedJul 28, 2025
commitccb76a495a46874e81acd1c05ea564b56545a3dd
59 changes: 19 additions & 40 deletionscoderd/templateversions_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -275,6 +275,7 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
files map[string]string
reqTags map[string]string
wantTags map[string]string
variables []codersdk.VariableValue
expectError string
}{
{
Expand All@@ -290,6 +291,7 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
default = "1"
}
data "coder_parameter" "b" {
name = "b"
type = string
default = "2"
}
Expand All@@ -311,6 +313,7 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
default = "1"
}
data "coder_parameter" "b" {
name = "b"
type = string
default = "2"
}
Expand All@@ -335,6 +338,7 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
default = "1"
}
data "coder_parameter" "b" {
name = "b"
type = string
default = "2"
}
Expand DownExpand Up@@ -365,6 +369,7 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
default = "1"
}
data "coder_parameter" "b" {
name = "b"
type = string
default = "2"
}
Expand DownExpand Up@@ -395,6 +400,7 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
default = "1"
}
data "coder_parameter" "b" {
name = "b"
type = string
default = "2"
}
Expand DownExpand Up@@ -429,18 +435,20 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
}
}`,
},
reqTags: map[string]string{"a": "b"},
wantTags: map[string]string{"owner": "", "scope": "organization", "a": "b"},
reqTags: map[string]string{"a": "b"},
wantTags: map[string]string{"owner": "", "scope": "organization", "a": "b"},
variables: []codersdk.VariableValue{{Name: "a", Value: "b"}},
},
{
name: "main.tf withdisallowed workspace tag value",
name: "main.tf withresource reference",
files: map[string]string{
`main.tf`: `
variable "a" {
type = string
default = "1"
}
data "coder_parameter" "b" {
name = "b"
type = string
default = "2"
}
Expand All@@ -461,38 +469,8 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
}
}`,
},
expectError: `Unknown variable; There is no variable named "null_resource".`,
},
{
name: "main.tf with disallowed function in tag value",
files: map[string]string{
`main.tf`: `
variable "a" {
type = string
default = "1"
}
data "coder_parameter" "b" {
type = string
default = "2"
}
data "coder_parameter" "unrelated" {
name = "unrelated"
type = "list(string)"
default = jsonencode(["a", "b"])
}
resource "null_resource" "test" {
name = "foo"
}
data "coder_workspace_tags" "tags" {
tags = {
"foo": "bar",
"a": var.a,
"b": data.coder_parameter.b.value,
"test": pathexpand("~/file.txt"),
}
}`,
},
expectError: `function "pathexpand" may not be used here`,
reqTags: map[string]string{"foo": "bar", "a": "1", "b": "2", "test": "foo"},
wantTags: map[string]string{"owner": "", "scope": "organization", "foo": "bar", "a": "1", "b": "2", "test": "foo"},
},
// We will allow coder_workspace_tags to set the scope on a template version import job
// BUT the user ID will be ultimately determined by the API key in the scope.
Expand DownExpand Up@@ -618,11 +596,12 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
// Create a template version from the archive
tvName := testutil.GetRandomNameHyphenated(t)
tv, err := templateAdmin.CreateTemplateVersion(ctx, owner.OrganizationID, codersdk.CreateTemplateVersionRequest{
Name: tvName,
StorageMethod: codersdk.ProvisionerStorageMethodFile,
Provisioner: codersdk.ProvisionerTypeTerraform,
FileID: fi.ID,
ProvisionerTags: tt.reqTags,
Name: tvName,
StorageMethod: codersdk.ProvisionerStorageMethodFile,
Provisioner: codersdk.ProvisionerTypeTerraform,
FileID: fi.ID,
ProvisionerTags: tt.reqTags,
UserVariableValues: tt.variables,
})

if tt.expectError == "" {
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp