Skip to content

Conversation

@lilypan26
Copy link
Contributor


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

Related command

az aks update --disable-http-proxy

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 May 29, 2025 23:23
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented May 29, 2025

⚠️Azure CLI Extensions Breaking Change Test
⚠️aks-preview
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd aks update cmd aks update added parameter disable_http_proxy

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

Hi @lilypan26,
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 May 29, 2025

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

@github-actions
Copy link

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

Adds support for a new --disable-http-proxy flag to the az aks update command, enabling users to turn off HTTP proxy settings on an existing cluster.

  • Introduced disable_http_proxy CLI parameter and help text.
  • Implemented get_disable_http_proxy and update_http_proxy_config in the update decorator.
  • Added unit and live tests to verify disabling the HTTP proxy.

Reviewed Changes

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

Show a summary per file
File Description
src/aks-preview/azext_aks_preview/_params.py Registered new disable_http_proxy argument
src/aks-preview/azext_aks_preview/_help.py Added help entry for --disable-http-proxy option
src/aks-preview/azext_aks_preview/managed_cluster_decorator.py Implemented retrieval and handling of disable flag
src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py Added unit tests for update_http_proxy_config
src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py Added live CLI test for disabling proxy
src/aks-preview/HISTORY.rst Updated changelog for new preview release
Comments suppressed due to low confidence (2)

src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py:6499

  • The test initializes mc_2 without an http_proxy_config, so disabling proxy will always hit the error path. Consider setting a default http_proxy_config on mc_2 before calling update_http_proxy_config.
mc_2 = self.models.ManagedCluster(location="test_location")

src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py:6056

  • [nitpick] The live CLI test only asserts the enabled flag; consider adding checks to ensure existing httpProxy, httpsProxy, and noProxy values remain unchanged when disabling.
disable_cmd = "aks update --resource-group={resource_group} --name={name} --disable-http-proxy"

Comment on lines 5298 to 5301
if not mc.http_proxy_config:
raise UnknownError(
"Unexpectedly get an empty http proxy config in the process of updating http proxy enabled."
)
Copy link

Copilot AI May 29, 2025

Choose a reason for hiding this comment

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

The check for not mc.http_proxy_config precedes the None initialization, so a null http_proxy_config always triggers an error and prevents creating a new config. Swap the order or remove the redundant error to allow initialization when missing.

Suggested change
if not mc.http_proxy_config:
raise UnknownError(
"Unexpectedly get an empty http proxy config in the process of updating http proxy enabled."
)

Copilot uses AI. Check for mistakes.
ground_truth_mc_2 = self.models.ManagedCluster(
location="test_location",
http_proxy_config={
"enabled": "false",
Copy link

Copilot AI May 29, 2025

Choose a reason for hiding this comment

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

The test expects the enabled field as the string "false", but the decorator sets it to the boolean False. Update the expected value to a boolean.

Suggested change
"enabled": "false",
"enabled": False,

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented May 29, 2025

@github-actions github-actions bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label May 30, 2025
@FumingZhang
Copy link
Member

the change looks good to me, could you please fix failed CI checks, live test and resolve merge conflicts?

@github-actions github-actions bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label May 30, 2025
@lilypan26 lilypan26 force-pushed the lily/http-proxy-disable branch from 90e4b2c to 6bc8769 Compare May 30, 2025 18:21
@lilypan26
Copy link
Contributor Author

@zhoxing-ms zhoxing-ms merged commit c816497 into Azure:main Jun 3, 2025
24 checks passed
@azclibot
Copy link
Collaborator

azclibot commented Jun 3, 2025

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

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