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

FLPROD-1439: Make terraform config consistent with the API on declaring optional fields for snippet rules #4787

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

WowVeryLogin
Copy link

No description provided.

Copy link

changelog detected ✅

Optional: true,
Optional: true,
PlanModifiers: []planmodifier.String{
defaults.DefaultString(""),
Copy link
Member

Choose a reason for hiding this comment

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

do we need an empty string here? or can it be totally optional?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed this, used the same planmodifier rulesets are using for description field (we need the same behaviour as in ordinary rulesets)

Copy link

github-actions bot commented Jan 2, 2025

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!

Copy link

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!

…ng optional fields for snippet rules and use list block for rules based products
@jacobbednarz
Copy link
Member

looks like snippet_rules are failing acceptance tests

=== RUN   TestAccCloudflareCloudConnectorRules
=== PAUSE TestAccCloudflareCloudConnectorRules
=== CONT  TestAccCloudflareCloudConnectorRules
--- PASS: TestAccCloudflareCloudConnectorRules (6.03s)
PASS
ok      github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/cloud_connector_rules    6.698s
=== RUN   TestAccCloudflareSnippetRules
=== PAUSE TestAccCloudflareSnippetRules
=== CONT  TestAccCloudflareSnippetRules
    resource_test.go:55: Step 1/1 error: Error running post-apply refresh plan: exit status 1

        Error: failed reading snippet rules

          with cloudflare_snippet_rules.zigltbzgjv,
          on terraform_plugin_test.tf line 23, in resource "cloudflare_snippet_rules" "zigltbzgjv":
          23:   resource "cloudflare_snippet_rules" "zigltbzgjv" {

--- FAIL: TestAccCloudflareSnippetRules (16.40s)
FAIL
FAIL    github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/snippet_rules    17.544s
=== RUN   TestAccCloudflareSnippet
=== PAUSE TestAccCloudflareSnippet
=== CONT  TestAccCloudflareSnippet
--- PASS: TestAccCloudflareSnippet (9.75s)
PASS
ok      github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/snippets 11.903s
FAIL

@WowVeryLogin
Copy link
Author

WowVeryLogin commented Jan 24, 2025

Hm, this is probably api failure on our side inside the service (I see some timeouts during the day on db queries inside the service). Just run the test multiple times:
=== RUN TestAccCloudflareSnippetRules
=== PAUSE TestAccCloudflareSnippetRules
=== CONT TestAccCloudflareSnippetRules
--- PASS: TestAccCloudflareSnippetRules (17.84s)
PASS
ok github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/snippet_rules 21.496s
UPD: rulesets-api was timeouting at that time, can you please run the test again?

@jacobbednarz
Copy link
Member

found the issue and now this is all good

=== RUN   TestAccCloudflareCloudConnectorRules
=== PAUSE TestAccCloudflareCloudConnectorRules
=== CONT  TestAccCloudflareCloudConnectorRules
--- PASS: TestAccCloudflareCloudConnectorRules (5.90s)
PASS
ok      github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/cloud_connector_rules    6.829s
=== RUN   TestAccCloudflareSnippetRules
=== PAUSE TestAccCloudflareSnippetRules
=== CONT  TestAccCloudflareSnippetRules
--- PASS: TestAccCloudflareSnippetRules (18.30s)
PASS
ok      github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/snippet_rules    19.708s
=== RUN   TestAccCloudflareSnippet
=== PAUSE TestAccCloudflareSnippet
=== CONT  TestAccCloudflareSnippet
--- PASS: TestAccCloudflareSnippet (8.80s)
PASS
ok      github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/snippets 10.663s

@jacobbednarz jacobbednarz merged commit 96f73b4 into cloudflare:master Jan 29, 2025
7 checks passed
@github-actions github-actions bot added this to the v4.52.0 milestone Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants