Skip to content

Conversation

@FumingZhang
Copy link
Member

@FumingZhang FumingZhang commented Jun 6, 2025


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

Related command

  • {AKS} Vendor new SDK and bump API version to 2025-04-02-preview
  • Deprecate options --safeguards-level, --safeguards-version and --safeguards-excluded-ns in az aks create and az aks update commands.

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 wheel==0.30.0 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 review requested due to automatic review settings June 6, 2025 03:49
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jun 6, 2025

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@azure-client-tools-bot-prd
Copy link

Hi @FumingZhang,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Jun 6, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

github-actions bot commented Jun 6, 2025

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR vendors a new SDK and updates the API version from 2025-03-02-preview to 2025-04-02-preview. The key changes include updating all recorded URIs in test recordings, modifying the SDKProfile in the extension’s initialization, and updating release documentation in HISTORY.rst and README.rst.

Reviewed Changes

Copilot reviewed 262 out of 262 changed files in this pull request and generated 2 comments.

File Description
tests/recordings/*.yaml Updated API version URIs for consistent versioning in tests
managed_cluster_decorator.py Commented-out safeguards code now has a TODO for the new deployment safeguard API
init.py Updated SDKProfile API version to 2025-04-02-preview
README.rst and HISTORY.rst Updated release notes and versioning details to reflect the new API version

Comment on lines 3437 to 3442
# TODO (NickKeller): update this according to the new deployment safeguard API
# excludedNamespaces = self.context.get_safeguards_excluded_namespaces()
# version = self.context.get_safeguards_version()
# level = self.context.get_safeguards_level()
# # provided any value?
# mc = setup_common_safeguards_profile(level, version, excludedNamespaces, mc, self.models)
Copy link

Copilot AI Jun 6, 2025

Choose a reason for hiding this comment

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

Consider removing or cleaning up the commented-out safeguards profile code in set_up_safeguards_profile once the new deployment safeguard API is available, or reference a tracking issue to avoid leaving dead code in production.

Suggested change
# TODO (NickKeller): update this according to the new deployment safeguard API
# excludedNamespaces = self.context.get_safeguards_excluded_namespaces()
# version = self.context.get_safeguards_version()
# level = self.context.get_safeguards_level()
# # provided any value?
# mc = setup_common_safeguards_profile(level, version, excludedNamespaces, mc, self.models)
# TODO (NickKeller): Update this method when the new deployment safeguard API becomes available.
# Tracking issue: https://github.com/Azure/azure-cli/issues/12345

Copilot uses AI. Check for mistakes.
Comment on lines 4894 to 4911
"""Update safeguards profile for the ManagedCluster object
:return: the ManagedCluster object
"""
# TODO (NickKeller): update this according to the new deployment safeguard API

self._ensure_mc(mc)
# self._ensure_mc(mc)

excludedNamespaces = self.context.get_safeguards_excluded_namespaces()
version = self.context.get_safeguards_version()
level = self.context.get_safeguards_level()
# excludedNamespaces = self.context.get_safeguards_excluded_namespaces()
# version = self.context.get_safeguards_version()
# level = self.context.get_safeguards_level()

mc = setup_common_safeguards_profile(level, version, excludedNamespaces, mc, self.models)
# mc = setup_common_safeguards_profile(level, version, excludedNamespaces, mc, self.models)

if level is not None:
mc.safeguards_profile.level = level
if version is not None:
mc.safeguards_profile.version = version
# if level is not None:
# mc.safeguards_profile.level = level
# if version is not None:
# mc.safeguards_profile.version = version

Copy link

Copilot AI Jun 6, 2025

Choose a reason for hiding this comment

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

The commented-out code in update_safeguards_profile (including the _ensure_mc call and safeguards configuration) could be removed or clearly marked with a reference to an issue, which would improve code clarity and maintainability.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

May I ask whether these commented-out lines of code have any impact on the existing logic?

@github-actions
Copy link

github-actions bot commented Jun 6, 2025

# version = self.context.get_safeguards_version()
# level = self.context.get_safeguards_level()
# # provided any value?
# mc = setup_common_safeguards_profile(level, version, excludedNamespaces, mc, self.models)
Copy link
Contributor

Choose a reason for hiding this comment

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

May I ask whether these commented-out lines of code have any impact on the existing logic?

Copy link
Member Author

Choose a reason for hiding this comment

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

The options related to the 'safe guard' feature are being updated. A new backend API design has been introduced, and the feature owner has removed the current safe guard profile from the AKS Swagger. A separate profile will be added soon and feature owner add new implementation then.

For now, as the safe guard related model has been removed, I have to comment out the implementation to pass the test.

Copy link
Member Author

@FumingZhang FumingZhang Jun 6, 2025

Choose a reason for hiding this comment

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

+ feature owner @NickKeller to help take another look

Copy link
Member

Choose a reason for hiding this comment

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

Any code that sets mc.safeguards_profile is fine to delete instead of comment out. I'd like to leave in the cli flags though, as I want to use those as syntactic sugar to create our resource

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I'll remove the implementations

c.argument("safeguards_excluded_ns", type=str, is_preview=True)
c.argument(
"safeguards_excluded_ns",
deprecate_info=c.deprecate(
Copy link
Member

Choose a reason for hiding this comment

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

I can always "un-deprecate" this option when my PR merges and the sdk for my new resource is generated?

It's not going to add to the managed cluster model, but I would like to use it to specify creating our resource instead

Copy link
Member Author

Choose a reason for hiding this comment

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

I think "un-deprecate" is not acceptable, I'll revert these changes and let you decide whether to deprecate them.

@FumingZhang
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@yanzhudd yanzhudd merged commit 718c878 into Azure:main Jun 10, 2025
24 checks passed
@azclibot
Copy link
Collaborator

[Release] Update index.json for extension [ aks-preview-18.0.0b11 ] : https://dev.azure.com/msazure/One/_build/results?buildId=126776792&view=results

@FumingZhang FumingZhang deleted the fuming/aks-sdk-0605 branch September 10, 2025 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants