Repository navigation
[Container Apps] Fix #10375: az containerapp show: Return exit code 3 for missing apps - #10507
Draft
Aditya Pujara (a0x1ab) wants to merge 1 commit into
Conversation
… code 3 for missing apps Root cause: src/containerapp/azext_containerapp/_clients.py: ContainerAppPreviewClient inherited ContainerAppClient.show without classifying HTTP 404. custom.py: show_containerapp delegates to core BaseContainerAppDecorator.show and BaseResource.show, whose handle_raw_exception converts structured ARM ResourceNotFound JSON from core HTTPError into CLIInternalError, losing the not-found exit classification. Change: Convert only core HTTPError 404 from handwritten ContainerAppPreviewClient.show into CLI ResourceNotFoundError with a clean message identifying the app and resource group. Preserve the original response for existing 404-tolerant create/existence checks. Leave other errors and successful show/secrets behavior unchanged. Add six focused command/client tests, a release history note and patch version 1.3.1b1. Alternatives considered: - Changing shared core handle_raw_exception requires a separate Azure/azure-cli change and broadens scope. - Parsing ARM body error codes instead of HTTP status would miss empty or malformed 404 responses. Verified: - Trusted validation passed (1 command). - New or changed tests fail on the base revision and pass with the change: `src/containerapp/azext_containerapp/tests/latest/test_containerapp_show_unit.py::ContainerappShowClientTest::test_404_is_classified_without_parsing_the_body`, `src/containerapp/azext_containerapp/tests/latest/test_containerapp_show_unit.py::ContainerappShowClientTest::test_not_found_keeps_response_for_existing_resource_checks`, `src/containerapp/azext_containerapp/tests/latest/test_containerapp_show_unit.py::ContainerappShowCommandTest::test_missing_app_show_returns_exit_code_3`. - Unit tests: 6 executed, 0 skipped. - flake8 and pylint passed. - Pre-publication gates passed: release-artifact, generated-ownership, command-help, regression-test, independent-review. - Repository CI and live tests run on this PR. Fixes Azure#10375
microsoft-github-policy-service
Bot
requested review from
ZelinWang (wangzelin007) and
Yong Zhang (yonzhan)
October 22, 2026 13:01
X Engineering Agent ReportLive test — Passed (6/6)PASS Selectors: Changed test files runNew test filesWorkflow run: https://github.com/Azure/issue-sentinel/actions/runs/39783727310 Last 80 lines of azdev outputPosted by x-engineering-agent (Tester) |
Live reproduction on the PR head is inconclusiveThe issue was reproduced live before this change, but the re-run on head This PR stays a draft until a maintainer verifies the fix (or a new push re-runs the reproduction). Run: https://github.com/Azure/issue-sentinel/actions/runs/39783708288 |
Collaborator
|
Please fix CI issues |
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.
🤖 PR Validation — ️✔️ All clear
Description
Fixes #10375.
Return exit code 3 for missing apps.
Root cause: src/containerapp/azext_containerapp/_clients.py: ContainerAppPreviewClient inherited ContainerAppClient.show without classifying HTTP 404. custom.py: show_containerapp delegates to core BaseContainerAppDecorator.show and BaseResource.show, whose handle_raw_exception converts structured ARM ResourceNotFound JSON from core HTTPError into CLIInternalError, losing the not-found exit classification.
Fix: Convert only core HTTPError 404 from handwritten ContainerAppPreviewClient.show into CLI ResourceNotFoundError with a clean message identifying the app and resource group. Preserve the original response for existing 404-tolerant create/existence checks. Leave other errors and successful show/secrets behavior unchanged. Add six focused command/client tests, a release history note and patch version 1.3.1b1.
How verified (trusted validation output):
src/containerapp/azext_containerapp/tests/latest/test_containerapp_show_unit.py::ContainerappShowClientTest::test_404_is_classified_without_parsing_the_body,src/containerapp/azext_containerapp/tests/latest/test_containerapp_show_unit.py::ContainerappShowClientTest::test_not_found_keeps_response_for_existing_resource_checks,src/containerapp/azext_containerapp/tests/latest/test_containerapp_show_unit.py::ContainerappShowCommandTest::test_missing_app_show_returns_exit_code_3.Risks and limitations (from the job report):
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az containerapp showGeneral Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install azdevrequired)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.Independent review: an independent reviewer checked this change against 5 acceptance criteria derived from the issue (2 required); every required criterion is backed by evidence in the diff.