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

[Dependencies:] azurerm_cdn_frontdoor_rule, azurerm_cdn_frontdoor_ruleset and cdn_frontdoor_rule_actions - upgrade resources to 2024-02-01 API to enable support for the JS Challenge field #28308

Merged
merged 19 commits into from
Feb 3, 2025

Conversation

WodansSon
Copy link
Collaborator

@WodansSon WodansSon commented Dec 17, 2024

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

  • cdn_frontdoor_rule_actions - upgrade resource to 2024-09-01/rules and 2024-02-01/origins API's
  • azurerm_cdn_frontdoor_rule - upgrade resource to 2024-09-01/rules and 2024-02-01/rulesets API's
  • azurerm_cdn_frontdoor_ruleset - upgrade resource to 2024-02-01/rulesets API
  • front_door_validation_helpers - update dependencies to use 2024-09-01/rules API
  • front_door_route_https_redirect - update dependencies to use 2024-02-01/endpoints API
  • azurerm_cdn_frontdoor_firewall_policy - update dependencies to use 2024-02-01/webapplicationfirewallpolicies API
  • azurerm_cdn_frontdoor_firewall_policy - expose JSChallenge as an action type for the managed_rule.override.rule block

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.
    For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevant documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.
  • (For changes that include a state migration only). I have manually tested the migration path between relevant versions of the provider.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

image

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

ENHANCEMENTS:

  • dependencies - cdn_frontdoor_rule_actions - upgrade resource to 2024-09-01/rules and 2024-02-01/origins API's
  • dependencies - front_door_validation_helpers update to use 2024-09-01/rules API
  • dependencies - front_door_route_https_redirect update to use 2024-02-01/endpoints API
  • dependencies - azurerm_cdn_frontdoor_rule update to use 2024-09-01/rules and 2024-02-01/rulesets API's
  • dependencies - azurerm_cdn_frontdoor_ruleset update to use 2024-02-01/rulesets API
  • dependencies - azurerm_cdn_frontdoor_firewall_policy update to use 2024-02-01/webapplicationfirewallpolicies API
  • azurerm_cdn_frontdoor_firewall_policy - expose JSChallenge as an action type for the managed_rule.override.rule block

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Dependencies
  • Enhancement
  • Breaking Change

Related Issue(s)

  • Second part of the fix for #27325 (see Related PRs)

Related PRs

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

@WodansSon WodansSon changed the title [Dependencies:] azurerm_cdn_frontdoor_rule, azurerm_cdn_frontdoor_ruleset and cdn_frontdoor_rule_actions - upgrade to resources to 2024-02-01 API to enable support for the JS Challenge field [Dependencies:] azurerm_cdn_frontdoor_rule, azurerm_cdn_frontdoor_ruleset and cdn_frontdoor_rule_actions - upgrade resources to 2024-02-01 API to enable support for the JS Challenge field Dec 18, 2024
@WodansSon WodansSon marked this pull request as ready for review January 31, 2025 09:03
Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Thanks @WodansSon - Handful of fairly minor stuff to check if you could. Also, I can see you rant the CI tests, and it looks like there are some failures introduced if you can check those over?

Thanks!

@@ -231,55 +232,56 @@ func validateCdnFrontDoorExpandConditionOperatorValues(operator string, matchVal
return fmt.Errorf("%q is invalid: no 'operator' value has been set, got %q", m.ConfigName, operator)
}

if operator == string(cdn.OperatorAny) && len(*matchValues) > 0 {
// NOTE: There are now 14 different "Any" operators in the new API, however they are all the same so I am just hardcoding this here now...
Copy link
Member

Choose a reason for hiding this comment

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

Can you open an issue detailing this so it's tracked somewhere along with what we're planning to change it to if this is just for now?

Copy link
Collaborator Author

@WodansSon WodansSon Feb 1, 2025

Choose a reason for hiding this comment

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

I don't believe an issue is required here, these fields were added due to the swagger issue opened by HashiCorp to allow the Pandora SDK to build the API correctly. Every condition now has it's own Any field (e.g., ClientPortOperatorAny, CookiesOperatorAny, HostNameOperatorAny, etc.) So I believe hardcoding this value is acceptable here as this function is a general function that will be called by all conditions. That said I added more context in the code comment to give historical reasons why the decision was made to hardcode this value.

Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Thanks @WodansSon for the updates, this LGTM now 👍
And the tests are looking good too
image

@jackofallops jackofallops merged commit c5af06c into main Feb 3, 2025
33 checks passed
@jackofallops jackofallops deleted the deps/e_frontdoor_rules branch February 3, 2025 13:15
jackofallops added a commit that referenced this pull request Feb 3, 2025
stephybun added a commit that referenced this pull request Feb 7, 2025
Co-authored-by: Wodans Son <[email protected]>
jackofallops added a commit that referenced this pull request Feb 7, 2025
* CHANGELOG.md for v4.18.0

* Update CHANGELOG.md for #28308

* Update for #28447

* Update for #28532

* Update for #28537

* Update CHANGELOG.md for #28674

* Update for #28363

* Update for #28536

* Update for #28416

* Update CHANGELOG.md #28700

* Update for #28673

* Update for #28308

Co-authored-by: Wodans Son <[email protected]>

* Update for #27533

* prep for release

---------

Co-authored-by: stephybun <[email protected]>
Co-authored-by: sreallymatt <[email protected]>
Co-authored-by: Wodans Son <[email protected]>
hqhqhqhqhqhqhqhqhqhqhq pushed a commit to hqhqhqhqhqhqhqhqhqhqhq/terraform-provider-azurerm that referenced this pull request Feb 26, 2025
…ruleset` and `cdn_frontdoor_rule_actions` - upgrade resources to `2024-02-01` API to enable support for the JS Challenge field (hashicorp#28308)

* Check-in progress...

* Fixing delivery rule conditions adding a polymorphisim discriminator package...

* Progress...

* Think I have the new polymorphisim figured out here...

* go mod vendor

* Fix lint errors...

* Fix RuleSet Client...

* Add JSChallenge functionality for the override action type...

* go mod vendor to remove legacy API dependency...

* Fix lint error... from if else to switch case...

* Update internal/services/cdn/cdn_frontdoor_firewall_policy_resource.go

Co-authored-by: jackofallops <[email protected]>

* Update internal/services/cdn/cdn_frontdoor_firewall_policy_resource_test.go

Co-authored-by: jackofallops <[email protected]>

* Address PR comments...

* Fix test case due to new returned error value...

* Set Behavior and Order in Read...

* Fix lint error add example of override for jschallenge...

* Add legal note for JSChallenge value for action field...

---------

Co-authored-by: jackofallops <[email protected]>
hqhqhqhqhqhqhqhqhqhqhq pushed a commit to hqhqhqhqhqhqhqhqhqhqhq/terraform-provider-azurerm that referenced this pull request Feb 26, 2025
* CHANGELOG.md for v4.18.0

* Update CHANGELOG.md for hashicorp#28308

* Update for hashicorp#28447

* Update for hashicorp#28532

* Update for hashicorp#28537

* Update CHANGELOG.md for hashicorp#28674

* Update for hashicorp#28363

* Update for hashicorp#28536

* Update for hashicorp#28416

* Update CHANGELOG.md hashicorp#28700

* Update for hashicorp#28673

* Update for hashicorp#28308

Co-authored-by: Wodans Son <[email protected]>

* Update for hashicorp#27533

* prep for release

---------

Co-authored-by: stephybun <[email protected]>
Co-authored-by: sreallymatt <[email protected]>
Co-authored-by: Wodans Son <[email protected]>
Copy link

github-actions bot commented Mar 6, 2025

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

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

Successfully merging this pull request may close these issues.

2 participants