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

Workaround API consistency bugs for various resources #659

Merged
merged 17 commits into from
Nov 12, 2021

Conversation

manicminer
Copy link
Member

@manicminer manicminer commented Nov 11, 2021

Add some helper funcs for post-deletion check and identifying key/password credentials

Increase the default retry limit by one - making it 9 retries after the first attempt for a total of 10 requests with exponential backoff

Consistency fixes for various resources:

  • azuread_application_certificate: check for consistency on deletion
  • azuread_application_password: check for consistency on deletion
  • azuread_directory_role_member: check for consistency on deletion
  • azuread_group: check for consistency on creation by attempting to patch the new group, perform consistency check on deletion
  • azuread_group_member: check for consistency on deletion
  • azuread_invitation: check for consistency on creation by attempting to patch the guest user, use helper func for consistency check on deletion, move flatten/expand funcs to own source file
  • azuread_service_principal: check for consistency on creation by attempting to patch the new service principal, perform consistency check on deletion
  • azuread_service_principal_certificate: check for consistency on deletion
  • azuread_service_principal_password: check for consistency on deletion
  • azuread_user: check for consistency on deletion

Note that some of these resources already attempted to PATCH themselves after creation with an empty object. It's become clear that the API is filtering these out and returning early, unless there is an actual property in the body to be changed. So now we're choosing a property to update for each resource and ensuring that a valid change is sent in the PATCH request.

Closes: #578
Closes: #611

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @manicminer - LGTM aside from some minor comments i've left inline 🌵

internal/services/groups/group_member_resource.go Outdated Show resolved Hide resolved
internal/services/groups/group_resource.go Show resolved Hide resolved
internal/services/invitations/invitation_resource.go Outdated Show resolved Hide resolved
@manicminer manicminer force-pushed the bugfix/create-delete-consistency branch from 5751d0e to a9abfd8 Compare November 12, 2021 00:05
@manicminer
Copy link
Member Author

Thanks @katbyte! Have tidied those up 👍

@manicminer
Copy link
Member Author

Test results (failures unrelated)

Screenshot 2021-11-12 at 00 33 09

Screenshot 2021-11-12 at 00 34 07

Screenshot 2021-11-12 at 00 33 57

Screenshot 2021-11-12 at 00 33 46

Screenshot 2021-11-12 at 00 33 36

Screenshot 2021-11-12 at 00 33 22

@manicminer manicminer merged commit 720f09e into main Nov 12, 2021
@manicminer manicminer deleted the bugfix/create-delete-consistency branch November 12, 2021 00:35
manicminer added a commit that referenced this pull request Nov 12, 2021
@github-actions
Copy link

This functionality has been released in v2.9.0 of the Terraform 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
Copy link

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 Dec 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.