Skip to content
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

add compatibility_flags to cloudflare_workers_script #2324

Merged
merged 8 commits into from
Mar 28, 2023
Merged

add compatibility_flags to cloudflare_workers_script #2324

merged 8 commits into from
Mar 28, 2023

Conversation

abiodunakande
Copy link

Adds compatibility_flags attribute to workers script resource.

Following up on this issue here where compatibility_date was added.

@github-actions
Copy link
Contributor

changelog detected ✅

@abiodunakande
Copy link
Author

Screenshot 2023-03-27 at 10 34 04

@@ -159,6 +159,15 @@ func resourceCloudflareWorkerScriptSchema() map[string]*schema.Schema {
Optional: true,
Description: "The date to use for the compatibility flag.",
},
"compatibility_flags": {
Type: schema.TypeList,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given that we don't care about ordering, let's use a TypeSet here.

@@ -131,6 +131,14 @@ func parseWorkerBindings(d *schema.ResourceData, bindings ScriptBindings) {
}
}

func getCompatibilityFlags(d *schema.ResourceData) []string {
compatibilityFlags := make([]string, 0)
for _, item := range d.Get("compatibility_flags").([]interface{}) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when you swap to a TypeSet this will become

Suggested change
for _, item := range d.Get("compatibility_flags").([]interface{}) {
for _, item := range d.Get("compatibility_flags").(*schema.Set).List() {

@jacobbednarz
Copy link
Member

very close to getting this sorted! for next time, if you use a non-master branch and allow maintainers to edit the PR, we'll be able to fix these sorts of things without having the back and forth :)

@abiodunakande
Copy link
Author

very close to getting this sorted! for next time, if you use a non-master branch and allow maintainers to edit the PR, we'll be able to fix these sorts of things without having the back and forth :)

Good shout, will bear that in mind :) thank you

@jacobbednarz
Copy link
Member

acceptance tests all passing

TF_ACC=1 go test ./internal/sdkv2provider -v -run "^TestAccCloudflareWorkerScript_" -timeout 120m -parallel 1
=== RUN   TestAccCloudflareWorkerScript_Import
--- PASS: TestAccCloudflareWorkerScript_Import (20.01s)
=== RUN   TestAccCloudflareWorkerScript_MultiScriptEnt
=== PAUSE TestAccCloudflareWorkerScript_MultiScriptEnt
=== RUN   TestAccCloudflareWorkerScript_ModuleUpload
=== PAUSE TestAccCloudflareWorkerScript_ModuleUpload
=== CONT  TestAccCloudflareWorkerScript_MultiScriptEnt
--- PASS: TestAccCloudflareWorkerScript_MultiScriptEnt (44.65s)
=== CONT  TestAccCloudflareWorkerScript_ModuleUpload
--- PASS: TestAccCloudflareWorkerScript_ModuleUpload (14.09s)
PASS
ok  	github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider	79.711s

@jacobbednarz jacobbednarz merged commit b9afbb5 into cloudflare:master Mar 28, 2023
@github-actions github-actions bot added this to the v4.3.0 milestone Mar 28, 2023
github-actions bot pushed a commit that referenced this pull request Mar 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2023

This functionality has been released in v4.3.0 of the Terraform Cloudflare Provider.

Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants