Repository navigation
[ACR] az acr scope-map delete: Fix missing service warnings - #34167
Open
SakoPak (SakoPak) wants to merge 4 commits into
Open
SakoPak (SakoPak) wants to merge 4 commits into
SakoPak (SakoPak) wants to merge 4 commits into
Conversation
microsoft-github-policy-service
Bot
requested review from
Bin Du (northtyphoon) and
Terence Truong (terencet-dev)
October 5, 2026 17:57
az acr scope-map delete: Surface service warnings during deletion
az acr scope-map delete: Surface service warnings during deletionaz acr scope-map delete: Fix missing service warnings
Collaborator
|
ACR |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation is focused, correctly handles LRO responses, and includes appropriate regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Adds user-visible, deduplicated service warnings for az acr scope-map delete.
Changes:
- Adds an SDK response hook for
x-ms-warning. - Emits each distinct warning once.
- Adds focused tests for absent and repeated warnings.
| File | Description |
|---|---|
acr/_utils.py |
Adds the warning response hook. |
acr/scope_map.py |
Attaches the hook to scope-map deletion. |
acr/tests/latest/test_acr_commands_mock.py |
Tests hook registration and deduplication. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related command
az acr scope-map delete
Description
When a scope map deletion completes with a service warning, Azure CLI currently exposes the
x-ms-warningresponse header only in debug logs. Users runningaz acr scope-map deletenormally do not see which associated tokens require follow-up action.This PR registers an Azure SDK response hook for the asynchronous delete operation and emits each distinct service warning once through the standard CLI warning channel. Behavior remains unchanged when the service does not return
x-ms-warning.This change works in tandem with the active ACR backend implementation:
https://msazure.visualstudio.com/One/_git/DevServices-ContainerRegistry-Service/pullrequest/16790540
Repair item:
https://msazure.visualstudio.com/AzureContainerRegistry/_workitems/edit/33216671
Testing Guide
python -m unittest azure.cli.command_modules.acr.tests.latest.test_acr_commands_mock.AcrMockCommandsTests.x-ms-warningdoes not emit a warning.x-ms-warningemit the warning once.--debug.This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.