changes to support gateway association/disassociation for api version 2025-08-01-preview#9162
changes to support gateway association/disassociation for api version 2025-08-01-preview#9162bavneetsingh16 wants to merge 6 commits intoAzure:mainfrom
Conversation
* forcedelete * format * add code owner * mypy
* update errors * format * style
… 2025-08-01-preview
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Hi @bavneetsingh16, |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive testing infrastructure for the connectedk8s Azure CLI extension to support gateway association/disassociation for API version 2025-08-01-preview. The changes include PowerShell test files for various scenarios, pipeline configurations, and updated SDK models.
Key Changes:
- Adds PowerShell testing framework with scenarios for workload identity, gateway functionality, troubleshooting, and proxy configurations
- Updates the SDK models to support the 2025-08-01-preview API version with new gateway functionality
- Introduces pipeline templates for automated testing and deployment workflows
Reviewed Changes
Copilot reviewed 50 out of 55 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| testing/test/helper/Constants.ps1 | Defines common constants for test configuration |
| testing/test/configurations/*.Tests.ps1 | Test scenarios for workload identity, gateway, proxy, and troubleshooting features |
| testing/pipeline/templates/run-test.yml | Azure DevOps pipeline template for running tests |
| testing/pipeline/k8s-custom-pipelines.yml | Main pipeline configuration for building and testing |
| src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/ | Updated SDK models and operations for 2025-08-01-preview API |
| :vartype enabled: bool | ||
| """ | ||
|
|
||
| enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) | ||
| """Indicates whether the gateway for arc router connectivity is enabled.""" |
There was a problem hiding this comment.
The Gateway model is missing the resourceId field that is referenced in the test files. The tests check for gatewayId which appears to map to a resourceId property that should be present in this model.
| :vartype enabled: bool | |
| """ | |
| enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) | |
| """Indicates whether the gateway for arc router connectivity is enabled.""" | |
| :vartype enabled: bool | |
| :ivar resource_id: The resource ID of the gateway. | |
| :vartype resource_id: str | |
| """ | |
| enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) | |
| """Indicates whether the gateway for arc router connectivity is enabled.""" | |
| resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read", "create", "update", "delete", "query"]) | |
| """The resource ID of the gateway.""" |
| if ($isProxyEnabled -match "isProxyEnabled: false") { | ||
| break | ||
| } | ||
| break |
There was a problem hiding this comment.
There are two consecutive break statements on lines 47 and 49. The second break on line 49 is unreachable code and should be removed.
| break |
| BeforeAll { | ||
| . $PSScriptRoot/../helper/Constants.ps1 | ||
|
|
||
| $SelfHostedIssuer = "https://eastus.oic.prod-aks.azure.com/fc50e82b-3761-4218-8691-d98bcgb146da/e6c4bf03-84d9-480c-a269-37a41c28c5cb/" |
There was a problem hiding this comment.
The hardcoded self-hosted issuer URL contains what appears to be sensitive identifiers (GUIDs). Consider using parameterized values or environment variables instead of hardcoding these in the test file.
| $SelfHostedIssuer = "https://eastus.oic.prod-aks.azure.com/fc50e82b-3761-4218-8691-d98bcgb146da/e6c4bf03-84d9-480c-a269-37a41c28c5cb/" | |
| if ($env:SELF_HOSTED_ISSUER_URL) { | |
| $SelfHostedIssuer = $env:SELF_HOSTED_ISSUER_URL | |
| } else { | |
| throw "Environment variable SELF_HOSTED_ISSUER_URL is not set. Please set it to the desired self-hosted issuer URL." | |
| } |
| CLI_REPO_PATH: $(Agent.BuildDirectory)/s | ||
| EXTENSION_NAME: "connectedk8s" | ||
| EXTENSION_FILE_NAME: "connectedk8s" | ||
| SUBSCRIPTION_ID: "15c06b1b-01d6-407b-bb21-740b8617dea3" |
There was a problem hiding this comment.
The subscription ID is hardcoded in the pipeline configuration. This should be moved to a variable or secret to avoid exposing sensitive information in source control.
| SUBSCRIPTION_ID: "15c06b1b-01d6-407b-bb21-740b8617dea3" | |
| SUBSCRIPTION_ID: $(SUBSCRIPTION_ID) |
| $gatewayResourceId = "/subscriptions/15c06b1b-01d6-407b-bb21-740b8617dea3/resourceGroups/connectedk8sCLITestResources/providers/Microsoft.HybridCompute/gateways/gateway-test-cli" | ||
| } |
There was a problem hiding this comment.
The gateway resource ID contains a hardcoded subscription ID and resource group. These values should be parameterized or read from configuration to avoid exposing sensitive information and improve test portability.
| $gatewayResourceId = "/subscriptions/15c06b1b-01d6-407b-bb21-740b8617dea3/resourceGroups/connectedk8sCLITestResources/providers/Microsoft.HybridCompute/gateways/gateway-test-cli" | |
| } | |
| # Parameterize subscription ID and resource group for portability | |
| if (-not $ENVCONFIG.subscriptionId) { | |
| throw "ENVCONFIG.subscriptionId is not set. Please set it in your configuration." | |
| } | |
| $gatewayResourceId = "/subscriptions/$($ENVCONFIG.subscriptionId)/resourceGroups/$($ENVCONFIG.resourceGroup)/providers/Microsoft.HybridCompute/gateways/gateway-test-cli" |
Release SuggestionsModule: connectedk8s
Notes
|
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)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.jsonautomatically.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.