Skip to content

Conversation

@wyattfry
Copy link
Collaborator

@wyattfry wyattfry commented Mar 13, 2025

This PR makes the approval_status consistent with the other properties in this resource that are Computed Optional, and resolves a bug where, when an activation_rules block is configured, previously an impossible change would always appear in plans.

I added a test (TestGroupRoleManagementPolicy_activationRules) that fails when run against the main branch:

   testcase.go:122: Step 1/2 error: After applying this test step, the non-refresh plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # azuread_group_role_management_policy.test will be updated in-place
          ~ resource "azuread_group_role_management_policy" "test" {
                id           = "Group_9dff2f65-d602-45ca-8195-55f0cccb7a1a_f305ca62-d9ae-44c7-b8e4-4b4ca5198e84"
                # (4 unchanged attributes hidden)
        
              ~ activation_rules {
                    # (6 unchanged attributes hidden)
        
                  - approval_stage {
                    }
                }
        
                # (3 unchanged blocks hidden)
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
2025-03-14T09:05:35.383-0400 [WARN]  sdk.helper_schema: Previously configured provider being re-configured. This can cause issues in concurrent testing if the configurations are not equal.: tf_rpc=Configure tf_req_id=9bef211b-7ce6-72c0-0c43-32c0e8c4d9e1 tf_provider_addr=registry.terraform.io/hashicorp/azuread
--- FAIL: TestGroupRoleManagementPolicy_activationRules (52.86s)

FAIL

Fixes #1398

Test:

image

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

LGTM! I'd just leave a note in the description that you're matching the consistency of the rest of the blocks in this resource

@wyattfry
Copy link
Collaborator Author

LGTM! I'd just leave a note in the description that you're matching the consistency of the rest of the blocks in this resource

Certainly, I've updated it now.

@wyattfry wyattfry merged commit 6b37740 into main Mar 14, 2025
25 checks passed
@wyattfry wyattfry deleted the wyatt/bug-group-role-mgmt-policy-approval-stage branch March 14, 2025 15:26
wyattfry added a commit that referenced this pull request Mar 14, 2025
jackofallops added a commit that referenced this pull request Mar 21, 2025
* Update CHANGELOG.md for #1664 #1567

* Update CHANGELOG.md for #1666

* Update CHANGELOG.md for #1635

* Update CHANGELOG.md for #1623

* prep for release

---------

Co-authored-by: Wyatt Fry <[email protected]>
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.

azuread_group_role_management_policy unset approval_stage causes constant drift

2 participants