-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[Draft] [Bug] azure_role_definition - Better error handling when importing azure role definitions #27082
Conversation
1966d46
to
da091a2
Compare
I've marked this PR as Part of the difficultly in testing has been that, previously, the range of allowable user-supplied values was wider and there was no unit test. So there's no way to be certain what values users may have used in the field. Thus, if this PR is acceptable it should probably be considered a breaking change. I've also been hitting additional cases which I had not originally considered. This can be seen in the evolution of the commit history. The first commit addresses the reporter's immediate issue, and further !fixups make the parsing more strict and address additional cases. Thank you for the consideration. Cheers. |
0606d8a
to
b40bddf
Compare
b40bddf
to
4a5c3c3
Compare
@cdituri - is this PR ready for review? |
Since this has been sitting in draft for a while and we haven't heard back I'm going to close this PR for the moment. Let us know once you're ready to pick this back up again for us to review, we can reopen this then. Thanks! |
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. |
Community Note
Description
Fixes a bug, in the parsing of azure role definition strings into
RoleDefinitionId
s, which leads to a crash. Also added a unit test.Update: I added !fixup commits which make the parsing adhere to the Azure api docs more strictly, but which allow for case insensitivity. Also enhanced the unit test methodology and added additional test data for better coverage. Lastly, parse.RoleDefinitionIds() no longer relies on strings.Spilt.
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
For state migrations please test the changes locally and provide details here, such as the versions involved in testing the migration path. For further details on testing state migration changes please see our guide on state migrations in the contributor documentation. -->
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_role_definition
- stricter parsing of RoleDefinitionId to fix crash [Support for better error handling when importing azure role definitions #26682]This is a (please select all that apply):
Related Issue(s)
Fixes #26682