Skip to content

{k8s-extension} Migrate code to aaz-based implementation - #10407

Open
William (william051200) wants to merge 9 commits into
Azure:mainfrom
william051200:migrate-k8s
Open

William (william051200) wants to merge 9 commits into
Azure:mainfrom
william051200:migrate-k8s

Conversation

@william051200

Copy link
Copy Markdown
Member

Migration from mgmt.compute to aaz-based
Update minCliCoreVersion as VMListSizes only available since CLI 2.69.0


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install azdev required)
  • My extension version conforms to the Extension version schema

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.json automatically.
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The AAZ invocation and output handling are correct, version requirements are aligned, and tests cover both validation outcomes.

Review effort: Balanced
Findings: None

What changed in this PR

Migrates virtual-node VM-size validation from the Compute SDK to Azure CLI’s AAZ implementation.

Changes:

  • Uses VMListSizes with dictionary-based results.
  • Adds validation unit tests.
  • Bumps extension and minimum CLI versions.
File Description
setup.py Bumps version to 1.9.2.
HISTORY.rst Records the AAZ migration.
test_virtual_nodes.py Tests qualifying and non-qualifying pools.
VirtualNodes.py Replaces Compute SDK VM-size lookup with AAZ.
azext_metadata.json Requires Azure CLI 2.69.0.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@yonzhan

Copy link
Copy Markdown
Collaborator

k8s-extension

@yonzhan

Copy link
Copy Markdown
Collaborator

Please fix CI issues

@william051200

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@JaysonTaiMicrosoft

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@william051200 William (william051200) added the Request X Engineering Agent Ask the agent to triage this issue or review this PR label Oct 15, 2026
@x-engineering-agent

x-engineering-agent Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

X Engineering Agent Report

Review — Comments

William (@william051200)

No confirmed semantic defect in the inspected migration at f308dde765fb: VirtualNodes.py:152–163 uses the AAZ invocation supported by CLI 2.69.0 and retains the VM-size output fields and four-core/16-GiB eligibility rules. The raised minimum CLI version matches the availability of VMListSizes; 1.9.4 matches the release history. No pending Copilot reviewer item remains.

Upstream CI has no failed or pending checks, but regression coverage of the actual AAZ request/output contract is not verified. src/k8s-extension/azext_k8s_extension/tests/latest/test_virtual_nodes.py:17–68 checks acceptance, rejection, unknown sizes and invocation arguments while mocking VMListSizes, so it bypasses serialization. The unchanged tests/latest/recordings/test_k8s_extension.yaml, test_k8s_extension_fleet.yaml and test_k8s_extension_types.yaml under that extension do not exercise VirtualNodes or the Compute VM-size request.

Before merge, add focused contract coverage for the actual AAZ location request and numberOfCores/memoryInMB output (Compute API 2022-11-01), including exact thresholds, empty results and error propagation. Rerun TestVirtualNodes in src/k8s-extension/azext_k8s_extension/tests/latest/test_virtual_nodes.py and that focused contract case on CLI 2.69.0 and current CLI. Existing recordings do not prove these conditions.

Test validation
  • Agent live test: Not run; this is a review-only PR. Check author-provided test evidence and upstream CI separately.
  • Regression coverage: Not applicable to the changed files.

The helper's non-applicability result does not assess extension scenarios; the coverage limitation above comes from static inspection, not an Agent live-test run.

Risk assessment — 17/100 · Low · High confidence

The Low rating is driven by dependency or supply chain.

  • Change scope: 5 changed files, 90 changed lines (+82 / -8), including 2 production files.
  • Affected components: k8s-extension
  • Risk drivers: dependency or supply chain (+18)
  • Regression evidence: Changed regression tests are included, reducing risk.
  • Confidence: High because changed-line patches were available for every production file.
  • Required review: Owning-squad review is required for k8s-extension before merge.

Posted by x-engineering-agent (Reviewer)

@x-engineering-agent x-engineering-agent Bot added the X Engineering Agent Reviewed Agent reviewed this PR label Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot Request X Engineering Agent Ask the agent to triage this issue or review this PR X Engineering Agent Reviewed Agent reviewed this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants