[AKS] az aks install-desktop: Add AKS Desktop installation - #34100
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
Critical archive traversal and other unresolved installation and validation issues must be addressed.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds cross-platform az aks install-desktop support with secure release downloads, integrity verification, native installation, and Linux archive handling.
Changes:
- Registers the command,
--version, and help examples. - Implements platform/release selection, downloads, verification, extraction, and installation.
- Adds mocked workflow tests.
File summaries
| File | Summary and findings |
|---|---|
src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_custom.py |
Adds installer tests. Nit (1 vote): cleanup assertion is vacuous because the mock does not create the downloaded path. |
src/azure-cli/azure/cli/command_modules/acs/custom.py |
Implements the installation workflow. Critical (1 vote): archive extraction remains vulnerable to traversal through symlink members. Moderate (3 votes): temporary DMG/DEB files may be deleted before desktop handlers finish consuming them. Moderate (1 vote): null digests raise TypeError instead of ClientRequestError. Moderate (1 vote): an empty --version bypasses validation and installs the latest release. |
src/azure-cli/azure/cli/command_modules/acs/commands.py |
Registers the new command. |
src/azure-cli/azure/cli/command_modules/acs/_params.py |
Adds the --version parameter. |
src/azure-cli/azure/cli/command_modules/acs/_help.py |
Adds command help and examples. |
Review details
Suppressed comments (3)
src/azure-cli/azure/cli/command_modules/acs/custom.py:2504
- When the GitHub asset payload contains an explicit
"digest": null,asset.getreturnsNoneandre.fullmatchraisesTypeErrorinstead of the intendedClientRequestError. Treat non-string values as an invalid digest so malformed or older release metadata fails cleanly.
if not re.fullmatch(r'sha256:[0-9a-fA-F]{64}', digest):
src/azure-cli/azure/cli/command_modules/acs/custom.py:2422
- Because this guard is truthiness-based,
az aks install-desktop --version ""skips semantic-version validation and silently falls through to/latest, installing a different version than the user supplied. Use an explicitis not Nonecheck so every supplied value, including an empty string, is rejected.
if version:
src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_custom.py:1052
- This cleanup assertion is vacuous:
mock_downloadis a mock and never creates the path, soexistsis already false even ifTemporaryDirectoryfails to remove a downloaded artifact. Make the mock createdestinationbefore returning, then assert that the path is absent after the workflow.
self.assertFalse(os.path.exists(mock_download.call_args[0][1]))
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
az aks install-desktop: Add AKS Desktop installation
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
FumingZhang
left a comment
There was a problem hiding this comment.
please consider adding a scenario test case to help validate the change
|
FumingZhang Added the requested command-level scenario coverage in acb91b9: Also addressed the earlier validation/test feedback: null/non-string digests fail cleanly, empty versions no longer select latest, and cleanup fixtures write/read actual files. |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 34100 in repo Azure/azure-cli |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Addressed the four new review threads in 5867803 and 1d26969. Local unit/scenario verification: 116 passed, 1 existing skip; archive/install regressions also pass on Python 3.10–3.14. Yong Zhang (@yonzhan) Could you trigger |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
🤖 PR Validation —⚠️ Review suggested
Summary
az aks install-desktopwith latest-stable installation by default and optional--versionValidation
test_customand offline CLI scenario suites: 105 passed, 1 pre-existing skip, 125 subtests passed.xdg-openhandoff with an isolated harmless handler confirms the retained installer remains readable after the command returns.git diff --checkpass.az aks install-desktop -hrenders the arguments, examples and installer-retention guidance./polishand CodeRabbit reviews completed; review findings were addressed.