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

chore: Add replace_insecure_js zone_settings_override toggle. #3602

Conversation

anordby
Copy link
Contributor

@anordby anordby commented Aug 12, 2024

No description provided.

@anordby anordby requested a review from jacobbednarz as a code owner August 12, 2024 08:52
Copy link
Contributor

github-actions bot commented Aug 12, 2024

changelog detected ✅

Copy link
Contributor

Marking this pull request as stale due to 14 days of inactivity. This helps our maintainers find and focus on the active pull requests. If this pull request receives no comments in the next 7 days it will automatically be closed. Maintainers can also remove the lifecycle/stale label.
If this pull request was automatically closed and you feel this pull request should be reopened, we encourage creating a new pull request linking back to this one for added context. Thank you!

@jacobbednarz
Copy link
Member

jacobbednarz commented Aug 27, 2024

if we're adding a new field, we need to add an acceptance test for coverage. as is, i also don't think this works given the new property isn't in the aggregated view of settings and needs to be treated as a single endpoint fetch as we did for nel in #3305.

@anordby
Copy link
Contributor Author

anordby commented Sep 2, 2024

if we're adding a new field, we need to add an acceptance test for coverage. as is, i also don't think this works given the new property isn't in the aggregated view of settings and needs to be treated as a single endpoint fetch as we did for nel in #3305.

Added a test, but seems it is not run from this PR? How do I test it manually? @jacobbednarz

@jacobbednarz
Copy link
Member

you'll need to run the acceptance tests locally - https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/contributing/development.md#quick-start

PRs only trigger unit tests as the acceptance tests take a long time and use real resources.

@anordby
Copy link
Contributor Author

anordby commented Sep 3, 2024

I was able to run the acceptance test for my test locally with a dummy Cloudflare account with some "pending" domains finally, and after setting a couple of defaults (challenge ttl and security level)) it completes successfully:

TESTARGS='-run "^TestAccCloudflareZoneSettingsOverride_ReplaceInsecureJS" -count 1 -parallel 1' make testacc (..) ok github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/zero_trust_access_mtls_hostname_settings 0.403s [no tests to run] testing: warning: no tests to run PASS ok github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/zero_trust_risk_behavior 0.395s [no tests to run] testing: warning: no tests to run PASS ok github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/zero_trust_risk_score_integration 0.389s [no tests to run] === RUN TestAccCloudflareZoneSettingsOverride_ReplaceInsecureJS --- PASS: TestAccCloudflareZoneSettingsOverride_ReplaceInsecureJS (26.39s) PASS ok github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider 26.784s testing: warning: no tests to run PASS ok github.com/cloudflare/terraform-provider-cloudflare/internal/utils 0.362s [no tests to run]

Does everything look OK then for you to consider adding this toggle? @jacobbednarz

@jacobbednarz
Copy link
Member

acceptance tests all looking good here.

TF_ACC=1 go test ./internal/sdkv2provider -v -run "^TestAccCloudflareZoneSettingsOverride_" -count 1 -timeout 120m -parallel 1
=== RUN   TestAccCloudflareZoneSettingsOverride_Full
--- PASS: TestAccCloudflareZoneSettingsOverride_Full (31.81s)
=== RUN   TestAccCloudflareZoneSettingsOverride_RemoveAttributes
--- PASS: TestAccCloudflareZoneSettingsOverride_RemoveAttributes (39.40s)
=== RUN   TestAccCloudflareZoneSettingsOverride_NEL
--- PASS: TestAccCloudflareZoneSettingsOverride_NEL (13.29s)
=== RUN   TestAccCloudflareZoneSettingsOverride_ReplaceInsecureJS
--- PASS: TestAccCloudflareZoneSettingsOverride_ReplaceInsecureJS (14.28s)
PASS
ok  	github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider	100.203s

thanks!

@jacobbednarz jacobbednarz merged commit 71b5afc into cloudflare:master Sep 4, 2024
9 checks passed
@github-actions github-actions bot added this to the v4.42.0 milestone Sep 4, 2024
Copy link
Contributor

This functionality has been released in v4.42.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 Sep 18, 2024
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