Skip to content

Conversation

@bavneetsingh16
Copy link
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 July 30, 2025 22:10
@azure-client-tools-bot-prd
Copy link

Validation for Breaking Change Starting...

Thanks for your contribution!

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

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
Collaborator

yonzhan commented Jul 30, 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

This PR introduces PowerShell-based integration tests for Azure CLI K8s extensions and configurations. The tests utilize the Pester framework and are designed to validate Azure Arc K8s extension and configuration functionality.

Key changes:

  • Adds comprehensive test infrastructure with helper functions for extension and configuration testing
  • Provides test suites for various Azure extensions (Azure Monitor, Azure ML, Azure Defender, Azure Policy)
  • Creates test configurations for Flux Git/Blob storage scenarios
  • Establishes CI/CD pipeline templates for automated testing

Reviewed Changes

Copilot reviewed 29 out of 33 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
testing/test/helper/*.ps1 Helper functions for extension data retrieval and common test operations
testing/test/extensions/**/*.ps1 Test suites for Azure extensions using Pester framework
testing/test/configurations/*.ps1 Test suites for Flux configuration scenarios with various storage backends
testing/pipeline/*.yml Azure DevOps pipeline configuration for automated testing
testing/*.ps1 Main test orchestration and environment setup scripts
testing/docs/*.md Documentation for test authoring and setup procedures
Comments suppressed due to low confidence (4)

testing/pipeline/k8s-custom-pipelines.yml:22

  • Python 3.13 may not be available or supported in Azure DevOps hosted agents. Consider using a stable Python version like 3.11 or 3.12.
  jobs:

testing/pipeline/templates/run-test.yml:22

  • Python 3.13 may not be available or supported in Azure DevOps hosted agents. Consider using a stable Python version like 3.11 or 3.12.
    displayName: 'Use Python 3.13'

testing/pipeline/k8s-custom-pipelines.yml:44

  • Python 3.13 may not be available or supported in Azure DevOps hosted agents. Consider using a stable Python version like 3.11 or 3.12.
      displayName: 'Use Python 3.13'

testing/pipeline/k8s-custom-pipelines.yml:81

  • Python 3.13 may not be available or supported in Azure DevOps hosted agents. Consider using a stable Python version like 3.11 or 3.12.
      displayName: 'Use Python 3.13'

)

$output = kubectl get gitconfigs -A -o json | ConvertFrom-Json
return $output.items | Where-Object { $_.metadata.name -eq $configurationName }
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

The variable $configurationName is not defined in this function. It should be $configName to match the parameter name.

Suggested change
return $output.items | Where-Object { $_.metadata.name -eq $configurationName }
return $output.items | Where-Object { $_.metadata.name -eq $configName }

Copilot uses AI. Check for mistakes.
)

$output = kubectl get fc -A -o json | ConvertFrom-Json
return $output.items | Where-Object { $_.metadata.name -eq $configurationName }
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

The variable $configurationName is not defined in this function. It should be $configName to match the parameter name.

Suggested change
return $output.items | Where-Object { $_.metadata.name -eq $configurationName }
return $output.items | Where-Object { $_.metadata.name -eq $configName }

Copilot uses AI. Check for mistakes.
{
$readyConfigs = 0
foreach($configData in $CONFIG_ARR) {
$output = az k8s-configuration flux show -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters -n $CONFIGdATA.Item1
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

There is a typo in the variable name $CONFIGdATA.Item1. It should be $configData.Item1 with lowercase 'd' to match the variable defined in the loop.

Suggested change
$output = az k8s-configuration flux show -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters -n $CONFIGdATA.Item1
$output = az k8s-configuration flux show -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters -n $configData.Item1

Copilot uses AI. Check for mistakes.

It "Performs another list after the delete" {
$output = az $Env:K8sExtensionName list -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters
$extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName }
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

The filter condition should use $extensionType instead of $extensionName to correctly filter by extension type.

Suggested change
$extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName }
$extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionType }

Copilot uses AI. Check for mistakes.

It "Performs another list after the delete" {
$output = az $Env:K8sExtensionName list -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters
$extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName }
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

The filter condition should use $extensionType instead of $extensionName to correctly filter by extension type.

Suggested change
$extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName }
$extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionType }

Copilot uses AI. Check for mistakes.

It "Performs another list after the delete" {
$output = az $Env:K8sExtensionName list -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters
$extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName }
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

The filter condition should use $extensionType instead of $extensionName to correctly filter by extension type.

Suggested change
$extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName }
$extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionType }

Copilot uses AI. Check for mistakes.

It "Performs another list after the delete" {
$output = az k8s-extension list --cluster-name $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters
$extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName }
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

The filter condition should use $extensionType instead of $extensionName to correctly filter by extension type.

Suggested change
$extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName }
$extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionType }

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

@bavneetsingh16 bavneetsingh16 deleted the python313_test branch July 31, 2025 21:24
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.

2 participants