Skip to content

feat: mark prebuilds as such and set their preset ids #16965

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
Apr 14, 2025
Prev Previous commit
Next Next commit
test to ensure we mark prebuilds as such
  • Loading branch information
SasSwart committed Apr 10, 2025
commit 3693d45cbef822ce62a55627a997d1cb7af88ef2
38 changes: 38 additions & 0 deletions provisioner/terraform/provision_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,44 @@ func TestProvision(t *testing.T) {
}},
},
},
{
Name: "is-prebuild",
Files: map[string]string{
"main.tf": `terraform {
required_providers {
coder = {
source = "coder/coder"
version = "2.3.0-pre2"
}
}
}
data "coder_workspace" "me" {}
resource "null_resource" "example" {}
resource "coder_metadata" "example" {
resource_id = null_resource.example.id
item {
key = "is_prebuild"
value = data.coder_workspace.me.is_prebuild
}
}
`,
},
Request: &proto.PlanRequest{
Metadata: &proto.Metadata{
IsPrebuild: true,
},
},
Response: &proto.PlanComplete{
Resources: []*proto.Resource{{
Name: "example",
Type: "null_resource",
Metadata: []*proto.Resource_Metadata{{
Key: "is_prebuild",
Value: "true",
}},
}},
},
},
}

for _, testCase := range testCases {
Expand Down