Skip to content

changes to support gateway association/disassociation for api version 2025-08-01-preview#9162

Closed
bavneetsingh16 wants to merge 6 commits intoAzure:mainfrom
AzureArcForKubernetes:bsingh/gateway-feature-ga
Closed

changes to support gateway association/disassociation for api version 2025-08-01-preview#9162
bavneetsingh16 wants to merge 6 commits intoAzure:mainfrom
AzureArcForKubernetes:bsingh/gateway-feature-ga

Conversation

@bavneetsingh16
Copy link
Copy Markdown
Contributor


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 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 September 12, 2025 21:01
@azure-client-tools-bot-prd
Copy link
Copy Markdown

Validation for Breaking Change Starting...

Thanks for your contribution!

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

Hi @bavneetsingh16,
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
Copy Markdown
Collaborator

yonzhan commented Sep 12, 2025

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

@github-actions
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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 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

Comment on lines +797 to +801
:vartype enabled: bool
"""

enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
"""Indicates whether the gateway for arc router connectivity is enabled."""
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
: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."""

Copilot uses AI. Check for mistakes.
if ($isProxyEnabled -match "isProxyEnabled: false") {
break
}
break
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

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

There are two consecutive break statements on lines 47 and 49. The second break on line 49 is unreachable code and should be removed.

Suggested change
break

Copilot uses AI. Check for mistakes.
BeforeAll {
. $PSScriptRoot/../helper/Constants.ps1

$SelfHostedIssuer = "https://eastus.oic.prod-aks.azure.com/fc50e82b-3761-4218-8691-d98bcgb146da/e6c4bf03-84d9-480c-a269-37a41c28c5cb/"
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
$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."
}

Copilot uses AI. Check for mistakes.
CLI_REPO_PATH: $(Agent.BuildDirectory)/s
EXTENSION_NAME: "connectedk8s"
EXTENSION_FILE_NAME: "connectedk8s"
SUBSCRIPTION_ID: "15c06b1b-01d6-407b-bb21-740b8617dea3"
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
SUBSCRIPTION_ID: "15c06b1b-01d6-407b-bb21-740b8617dea3"
SUBSCRIPTION_ID: $(SUBSCRIPTION_ID)

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +6
$gatewayResourceId = "/subscriptions/15c06b1b-01d6-407b-bb21-740b8617dea3/resourceGroups/connectedk8sCLITestResources/providers/Microsoft.HybridCompute/gateways/gateway-test-cli"
}
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
$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"

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

Hi @bavneetsingh16

Release Suggestions

Module: connectedk8s

  • Please log updates into to src/connectedk8s/HISTORY.rst
  • Update VERSION to 1.10.9 in src/connectedk8s/setup.py

Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants