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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

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!

internal/services/cdn/cdn_frontdoor_rule_resource.go Outdated Show resolved Hide resolved
internal/services/cdn/cdn_frontdoor_shared_schema.go Outdated Show resolved Hide resolved
@@ -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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants