Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/lint-ext-azure-ai-agents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- "cli/azd/extensions/azure.ai.agents/**"
- ".github/workflows/lint-ext-azure-ai-agents.yml"
- ".github/workflows/verify-ext-providers.yml"
branches: [main]

concurrency:
Expand All @@ -20,3 +21,8 @@ jobs:
uses: ./.github/workflows/lint-go.yml
with:
working-directory: cli/azd/extensions/azure.ai.agents

verify-providers:
uses: ./.github/workflows/verify-ext-providers.yml
with:
working-directory: cli/azd/extensions/azure.ai.agents
6 changes: 6 additions & 0 deletions .github/workflows/lint-ext-azure-ai-connections.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- "cli/azd/extensions/azure.ai.connections/**"
- ".github/workflows/lint-ext-azure-ai-connections.yml"
- ".github/workflows/verify-ext-providers.yml"
branches: [main]

concurrency:
Expand All @@ -20,3 +21,8 @@ jobs:
uses: ./.github/workflows/lint-go.yml
with:
working-directory: cli/azd/extensions/azure.ai.connections

verify-providers:
uses: ./.github/workflows/verify-ext-providers.yml
with:
working-directory: cli/azd/extensions/azure.ai.connections
6 changes: 6 additions & 0 deletions .github/workflows/lint-ext-azure-ai-projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- "cli/azd/extensions/azure.ai.projects/**"
- ".github/workflows/lint-ext-azure-ai-projects.yml"
- ".github/workflows/verify-ext-providers.yml"
branches: [main]

concurrency:
Expand All @@ -20,3 +21,8 @@ jobs:
uses: ./.github/workflows/lint-go.yml
with:
working-directory: cli/azd/extensions/azure.ai.projects

verify-providers:
uses: ./.github/workflows/verify-ext-providers.yml
with:
working-directory: cli/azd/extensions/azure.ai.projects
6 changes: 6 additions & 0 deletions .github/workflows/lint-ext-azure-ai-routines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- "cli/azd/extensions/azure.ai.routines/**"
- ".github/workflows/lint-ext-azure-ai-routines.yml"
- ".github/workflows/verify-ext-providers.yml"
branches: [main]

concurrency:
Expand All @@ -20,3 +21,8 @@ jobs:
uses: ./.github/workflows/lint-go.yml
with:
working-directory: cli/azd/extensions/azure.ai.routines

verify-providers:
uses: ./.github/workflows/verify-ext-providers.yml
with:
working-directory: cli/azd/extensions/azure.ai.routines
6 changes: 6 additions & 0 deletions .github/workflows/lint-ext-azure-ai-skills.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- "cli/azd/extensions/azure.ai.skills/**"
- ".github/workflows/lint-ext-azure-ai-skills.yml"
- ".github/workflows/verify-ext-providers.yml"
branches: [main]

concurrency:
Expand All @@ -20,3 +21,8 @@ jobs:
uses: ./.github/workflows/lint-go.yml
with:
working-directory: cli/azd/extensions/azure.ai.skills

verify-providers:
uses: ./.github/workflows/verify-ext-providers.yml
with:
working-directory: cli/azd/extensions/azure.ai.skills
6 changes: 6 additions & 0 deletions .github/workflows/lint-ext-azure-ai-toolboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- "cli/azd/extensions/azure.ai.toolboxes/**"
- ".github/workflows/lint-ext-azure-ai-toolboxes.yml"
- ".github/workflows/verify-ext-providers.yml"
branches: [main]

concurrency:
Expand All @@ -20,3 +21,8 @@ jobs:
uses: ./.github/workflows/lint-go.yml
with:
working-directory: cli/azd/extensions/azure.ai.toolboxes

verify-providers:
uses: ./.github/workflows/verify-ext-providers.yml
with:
working-directory: cli/azd/extensions/azure.ai.toolboxes
69 changes: 69 additions & 0 deletions .github/workflows/verify-ext-providers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: verify-ext-providers

on:
pull_request:
paths:
- "cli/azd/extensions/*/extension.yaml"
- "cli/azd/extensions/extension.schema.json"
- "cli/azd/extensions/registry.schema.json"
- "cli/azd/pkg/extensions/registry.go"
- "cli/azd/pkg/extensions/validate_registry.go"
- "cli/azd/pkg/extensions/capability_schema_test.go"
- "cli/azd/pkg/extensions/extension_manifest_files_test.go"
- ".github/workflows/verify-ext-providers.yml"
branches: [main]
workflow_call:
inputs:
working-directory:
description: "Path to the extension module directory"
required: true
type: string
go-version-file:
description: "Path to go.mod to read Go version from"
required: false
type: string
default: "cli/azd/go.mod"

permissions:
contents: read

jobs:
verify-coverage:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
defaults:
run:
working-directory: cli/azd
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: cli/azd/go.mod
- name: Verify provider contract coverage
run: |
go test ./pkg/extensions \
-run '^(TestExtensionManifestsHaveProviderVerificationTests|TestCapabilitySchemaTypesInSyncWithGo)$' -v

verify-providers:
if: github.event_name == 'workflow_call'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: ${{ inputs.go-version-file }}
# go test -run exits 0 when nothing matches, so first require the
# canonical test file and exact test name.
- name: Verify providers match manifest
working-directory: ${{ inputs.working-directory }}
run: |
if [ ! -f internal/cmd/providers_manifest_test.go ]; then
echo "::error::internal/cmd/providers_manifest_test.go not found."
exit 1
fi
if ! go test ./internal/cmd/ -list '^TestConfigureExtensionHostMatchesManifest$' \
| grep -qx 'TestConfigureExtensionHostMatchesManifest'; then
echo "::error::TestConfigureExtensionHostMatchesManifest not found in ./internal/cmd/."
exit 1
fi
go test ./internal/cmd/ -run '^TestConfigureExtensionHostMatchesManifest$' -v
2 changes: 1 addition & 1 deletion cli/azd/extensions/azure.ai.agents/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry v1.3.0-beta.3
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0
github.com/azure/azure-dev/cli/azd v1.27.1
github.com/azure/azure-dev/cli/azd v1.27.2
github.com/braydonk/yaml v0.9.0
github.com/drone/envsubst v1.0.3
github.com/fatih/color v1.18.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package cmd

import (
"path/filepath"
"testing"

"github.com/azure/azure-dev/cli/azd/pkg/azdext"
"github.com/stretchr/testify/require"
)

// TestConfigureExtensionHostMatchesManifest verifies that the providers this
// extension registers match those declared in its extension.yaml.
func TestConfigureExtensionHostMatchesManifest(t *testing.T) {
manifestPath := filepath.Join("..", "..", "extension.yaml")
require.NoError(t, azdext.VerifyProvidersMatchManifest(configureExtensionHost, manifestPath))
}
2 changes: 1 addition & 1 deletion cli/azd/extensions/azure.ai.connections/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/v2 v2.0.0
github.com/azure/azure-dev/cli/azd v1.27.1
github.com/azure/azure-dev/cli/azd v1.27.2
github.com/fatih/color v1.18.0
github.com/spf13/cobra v1.10.1
github.com/stretchr/testify v1.11.1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package cmd

import (
"path/filepath"
"testing"

"github.com/azure/azure-dev/cli/azd/pkg/azdext"
"github.com/stretchr/testify/require"
)

// TestConfigureExtensionHostMatchesManifest verifies that the providers this
// extension registers match those declared in its extension.yaml.
func TestConfigureExtensionHostMatchesManifest(t *testing.T) {
manifestPath := filepath.Join("..", "..", "extension.yaml")
require.NoError(t, azdext.VerifyProvidersMatchManifest(configureExtensionHost, manifestPath))
}
2 changes: 1 addition & 1 deletion cli/azd/extensions/azure.ai.projects/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.26.4

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0
github.com/azure/azure-dev/cli/azd v1.25.0
github.com/azure/azure-dev/cli/azd v1.27.2
github.com/fatih/color v1.18.0
github.com/spf13/cobra v1.10.1
github.com/stretchr/testify v1.11.1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package cmd

import (
"path/filepath"
"testing"

"github.com/azure/azure-dev/cli/azd/pkg/azdext"
"github.com/stretchr/testify/require"
)

// TestConfigureExtensionHostMatchesManifest verifies that the providers this
// extension registers match those declared in its extension.yaml.
func TestConfigureExtensionHostMatchesManifest(t *testing.T) {
manifestPath := filepath.Join("..", "..", "extension.yaml")
require.NoError(t, azdext.VerifyProvidersMatchManifest(configureExtensionHost, manifestPath))
}
2 changes: 1 addition & 1 deletion cli/azd/extensions/azure.ai.routines/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.26.4
require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1
github.com/azure/azure-dev/cli/azd v1.27.1
github.com/azure/azure-dev/cli/azd v1.27.2
github.com/fatih/color v1.18.0
github.com/spf13/cobra v1.10.1
github.com/stretchr/testify v1.11.1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package cmd

import (
"path/filepath"
"testing"

"github.com/azure/azure-dev/cli/azd/pkg/azdext"
"github.com/stretchr/testify/require"
)

// TestConfigureExtensionHostMatchesManifest verifies that the providers this
// extension registers match those declared in its extension.yaml.
func TestConfigureExtensionHostMatchesManifest(t *testing.T) {
manifestPath := filepath.Join("..", "..", "extension.yaml")
require.NoError(t, azdext.VerifyProvidersMatchManifest(configureExtensionHost, manifestPath))
}
2 changes: 1 addition & 1 deletion cli/azd/extensions/azure.ai.skills/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.26.4
require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.0-beta.3
github.com/azure/azure-dev/cli/azd v1.25.0
github.com/azure/azure-dev/cli/azd v1.27.2
github.com/fatih/color v1.18.0
github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package cmd

import (
"path/filepath"
"testing"

"github.com/azure/azure-dev/cli/azd/pkg/azdext"
"github.com/stretchr/testify/require"
)

// TestConfigureExtensionHostMatchesManifest verifies that the providers this
// extension registers match those declared in its extension.yaml.
func TestConfigureExtensionHostMatchesManifest(t *testing.T) {
manifestPath := filepath.Join("..", "..", "extension.yaml")
require.NoError(t, azdext.VerifyProvidersMatchManifest(configureExtensionHost, manifestPath))
}
2 changes: 1 addition & 1 deletion cli/azd/extensions/azure.ai.toolboxes/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.26.4
require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1
github.com/azure/azure-dev/cli/azd v1.27.1
github.com/azure/azure-dev/cli/azd v1.27.2
github.com/spf13/cobra v1.10.1
github.com/stretchr/testify v1.11.1
google.golang.org/grpc v1.80.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package cmd

import (
"path/filepath"
"testing"

"github.com/azure/azure-dev/cli/azd/pkg/azdext"
"github.com/stretchr/testify/require"
)

// TestConfigureExtensionHostMatchesManifest verifies that the providers this
// extension registers match those declared in its extension.yaml.
func TestConfigureExtensionHostMatchesManifest(t *testing.T) {
manifestPath := filepath.Join("..", "..", "extension.yaml")
require.NoError(t, azdext.VerifyProvidersMatchManifest(configureExtensionHost, manifestPath))
}
8 changes: 7 additions & 1 deletion cli/azd/extensions/extension.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"capabilities": {
"type": "array",
"title": "Capabilities",
"description": "List of capabilities provided by the extension. Supported values: custom-commands, lifecycle-events, mcp-server, service-target-provider, framework-service-provider, provisioning-provider, metadata. Select one or more from the allowed list. Each value must be unique. Not required for extension packs, which declare dependencies instead and have no executable.",
"description": "List of capabilities provided by the extension. Supported values: custom-commands, lifecycle-events, mcp-server, service-target-provider, framework-service-provider, provisioning-provider, validation-provider, metadata. Select one or more from the allowed list. Each value must be unique. Not required for extension packs, which declare dependencies instead and have no executable.",
"minItems": 1,
"uniqueItems": true,
"items": {
Expand Down Expand Up @@ -153,6 +153,12 @@
"title": "Provisioning Provider",
"description": "Provisioning provider enables extensions to provide a custom infrastructure provisioning experience."
},
{
"type": "string",
"const": "validation-provider",
"title": "Validation Provider",
"description": "Validation provider enables extensions to contribute checks to azd validation pipelines."
},
{
"type": "string",
"const": "metadata",
Expand Down
12 changes: 8 additions & 4 deletions cli/azd/extensions/microsoft.azd.demo/ci-test.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Write-Host "Run test command(s) here..."

# Exit 0 for success, nonzero exit for failure
exit 0
Write-Host "Running unit tests..."
go test ./... -count=1

if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}

exit 0
Loading
Loading