[AKS] az aks install-cli: Add optional native Azure skills installation - #34101
Tom Gamble (gambtho) wants to merge 25 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The changes require final human review because they are too complex or risky for automated approval.
Review effort: Lite
Findings: None
What changed in this PR
Adds opt-in native Azure skills installation to az aks install-cli, preserving existing binary behavior while supporting agent detection, safe downloads, staging, and non-overwriting publication.
Changes:
- Adds interactive and explicit skills-installation modes with agent selection.
- Implements bounded GitHub release retrieval, archive validation, and secure publication.
- Adds extensive tests, help text, and design/implementation documentation.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_custom.py | Updated as part of this pull request. |
| src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_azure_skills.py | Updated as part of this pull request. |
| src/azure-cli/azure/cli/command_modules/acs/custom.py | Updated as part of this pull request. |
| src/azure-cli/azure/cli/command_modules/acs/_params.py | Updated as part of this pull request. |
| src/azure-cli/azure/cli/command_modules/acs/_help.py | Updated as part of this pull request. |
| src/azure-cli/azure/cli/command_modules/acs/_azure_skills.py | Updated as part of this pull request. |
| docs/superpowers/specs/2026-09-18-aks-azure-skills-design.md | Updated as part of this pull request. |
| docs/superpowers/plans/2026-09-18-aks-azure-skills.md | Updated as part of this pull request. |
| docs/superpowers/implementation/2026-09-19-aks-azure-skills.md | Updated as part of this pull request. |
💡 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). |
FumingZhang
left a comment
There was a problem hiding this comment.
I found three issues to address before merge: an unhandled home-directory resolution failure, a parser test that is already failing in both full-test jobs, and the blocking style violations.
FumingZhang
left a comment
There was a problem hiding this comment.
please consider adding a scenario test case to help validate the change
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
| def discover_agents() -> list[AgentTarget]: | ||
| try: | ||
| home = Path.home() | ||
| except RuntimeError as error: |
There was a problem hiding this comment.
[P2] Path.home() can raise RuntimeError when the home directory cannot be resolved, such as in a minimal container running under a numeric UID with no HOME or passwd entry. Before this catch was added, that failure escaped as a raw traceback after binary installation. Handling it as FileOperationError preserves optional-mode binary success and gives explicit mode a normal CLI error.
| def test_invalid_agent_is_rejected_by_parser(self): | ||
| result, handler = self.invoke(['--install-azure-skills', '--skills-agents', 'unknown']) | ||
| self.assertEqual(result, 2) | ||
| handler.assert_not_called() |
There was a problem hiding this comment.
[P1] The previous assertion against a late sys.stderr patch failed deterministically in both Python 3.12 and 3.14 full-test jobs because the CLI logging handlers were not guaranteed to write there. Keeping this test focused on exit code 2 and confirming that the command handler was not called removes the merge-blocking false failure.
| reasons.append(failure) | ||
| failure = 'Azure skills installation is incomplete. ' + '; '.join(reasons) | ||
| if failure: | ||
| message = (f'{failure} kubectl and kubelogin remain installed. {source} ' + |
There was a problem hiding this comment.
[P1] This expression previously triggered the required style gate (W503), alongside several pylint violations in the new module, and therefore blocked the PR from merging. The refactoring now satisfies the style checks; the priority reflects the merge-blocking gate rather than a runtime defect.
🤖 PR Validation —⚠️ Review suggested
Related command
az aks install-cliDescription
Offer native, opt-in installation of Microsoft Azure skills after the existing kubectl and kubelogin installation succeeds.
--only-show-errors. Use native Knack prompts and typed Azure CLI errors.--install-azure-skills true|falseand--skills-agents. Explicit installation requires targets and bypasses prompts; omitted noninteractive execution and explicit false preserve binary-only behavior.microsoft/azure-skillsrelease by resolved commit, install complete skill trees/resources and license notices, and report provenance. Install no MCP configuration, hooks, or agent applications; add no runtime dependencies.--gh-tokenfor trusted GitHub metadata requests only. Bound transport/download/extraction, reject unsafe archive paths and destination indirection, and stage before publication.Codex uses the shared
~/.agents/skillsdirectory, so deselecting another agent does not prevent that agent from discovering shared skills. Selection controls installation destinations, not agent enablement.Testing Guide
After running the CLI from this branch:
Run unprivileged when testing skills installation. If default binary destinations need elevated access, use user-writable
--install-locationand--kubelogin-install-locationpaths, including the binary filenames. A skills acceptance installs into the selected user-level directories; automated verification instead used temporary destinations.Verification performed on Linux/Python 3.14 with worktree source overlays:
test_azure_skills,test_custom, andtest_validators: 402 tests run, 400 passed, 2 known skips.git diff --check: passed.v1.2.49(abaf74ac8f62fbe9f83d7ccb2bd991dca929a4da) smoke after the conformance changes: 28 installations, then 28 identical no-ops; all 926 original payload files byte-matched; notices retained; temporary state removed.The two skips are native Windows junction coverage and an existing kubelogin custom-source test. Existing ResourceWarnings/datetime deprecations remain unchanged. Native Windows/macOS, Python 3.10 runtime, full azdev ACS/style/linter gates, and actual agent/MCP workflows have not been exercised locally; CI/platform review remains necessary.
History Notes
[AKS]
az aks install-cli: Add optional native Azure skills installation for coding agents