Skip role assignment handling for emulators#9705
Conversation
- Updated `BuildRoleAssignmentAnnotations` to skip processing for container emulators. - Added a new test `DoesNotApplyRoleAssignmentsInRunModeForEmulators` to verify that role assignments are not applied to emulator resources.
There was a problem hiding this comment.
Pull Request Overview
This PR updates the role assignment handling logic to skip processing for container emulator resources and adds a corresponding unit test to verify this behavior.
- Skips role assignment processing for emulator resources in AzureResourcePreparer.
- Adds a dedicated test to ensure that role assignments are not applied for emulator resources in run mode.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/Aspire.Hosting.Azure.Tests/AzureResourcePreparerTests.cs | Added test DoesNotApplyRoleAssignmentsInRunModeForEmulators verifying skip behavior for emulator resources. |
| src/Aspire.Hosting.Azure/AzureResourcePreparer.cs | Updated BuildRoleAssignmentAnnotations to bypass processing for resources identified as containers. |
Comments suppressed due to low confidence (1)
src/Aspire.Hosting.Azure/AzureResourcePreparer.cs:151
- [nitpick] Consider renaming the method 'IsContainer()' to a more explicit name (e.g., 'IsContainerEmulator()') to clarify that it checks for emulator resources, thereby improving code readability.
if (azureReference.IsContainer())
|
/backport to release/9.3 |
|
Started backporting to release/9.3: https://github.com/dotnet/aspire/actions/runs/15469706213 |
|
@davidfowl backporting to "release/9.3" failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Skip role assignment handling for emulators
Using index info to reconstruct a base tree...
M src/Aspire.Hosting.Azure/AzureResourcePreparer.cs
M tests/Aspire.Hosting.Azure.Tests/AzureResourcePreparerTests.cs
Falling back to patching base and 3-way merge...
Auto-merging tests/Aspire.Hosting.Azure.Tests/AzureResourcePreparerTests.cs
CONFLICT (content): Merge conflict in tests/Aspire.Hosting.Azure.Tests/AzureResourcePreparerTests.cs
Auto-merging src/Aspire.Hosting.Azure/AzureResourcePreparer.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Skip role assignment handling for emulators
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
|
@eerhardt can you backport this change to 9.3? |
Yes. Will do. |
- Updated `BuildRoleAssignmentAnnotations` to skip processing for container emulators. - Added a new test `DoesNotApplyRoleAssignmentsInRunModeForEmulators` to verify that role assignments are not applied to emulator resources.
- Updated `BuildRoleAssignmentAnnotations` to skip processing for container emulators. - Added a new test `DoesNotApplyRoleAssignmentsInRunModeForEmulators` to verify that role assignments are not applied to emulator resources. Co-authored-by: David Fowler <davidfowl@gmail.com>
|
Patched in 9.3.1. To pick up this fix if you need it, For existing projects targeting 9.3.0, please update as follows; If you're creating new projects, you can just install and use the updated project templates: |
Description
BuildRoleAssignmentAnnotationsto skip processing for container emulators.DoesNotApplyRoleAssignmentsInRunModeForEmulatorsto verify that role assignments are not applied to emulator resources.Fixes #9422
Checklist