Skip to content

Auto-install extension support for custom provisioning providers #7502

@wbreza

Description

@wbreza

Description

Extend the existing auto-install extension feature (cmd/auto_install.go) to support provisioning providers, matching the pattern already established for service targets.

Parent Epic: #7465

Background

The auto-install feature currently handles UnsupportedServiceHostError for service targets:

  • Detects unknown host values in azure.yaml services
  • Queries the extension registry (extensionManager.FindExtensions()) with ServiceTargetProviderCapability + provider name
  • Prompts the user to install the matching extension
  • Retries the command after installation

This same flow should be implemented for provisioning providers when infra.provider specifies an unknown provider name.

Implementation Plan

1. Add ProvisioningProviderType constant

File: pkg/extensions/registry.go
Add to the ProviderType constants:

ProvisioningProviderType ProviderType = "provisioning-provider"

2. Create UnsupportedProvisioningProviderError type

File: pkg/infra/provisioning/manager.go or new file
Similar to project.UnsupportedServiceHostError:

type UnsupportedProvisioningProviderError struct {
    Provider    string
    ErrorMessage string
}

3. Update provisioning.Manager.newProvider() to return typed error

File: pkg/infra/provisioning/manager.go
When serviceLocator.ResolveNamed() fails with ioc.ErrResolveInstance, return UnsupportedProvisioningProviderError instead of a generic error.

4. Add provisioning provider handler in ExecuteWithAutoInstall()

File: cmd/auto_install.go
Add a new error handler block (parallel to the UnsupportedServiceHostError handler) that:

  • Catches UnsupportedProvisioningProviderError
  • Calls extensionManager.FindExtensions() with ProvisioningProviderCapability + provider name
  • Prompts user to install
  • Retries the command

5. Update demo extension registry metadata

Ensure the demo extension's registry entry includes provider metadata:

{
    "providers": [{
        "name": "demo",
        "type": "provisioning-provider",
        "description": "Demo provisioning provider"
    }]
}

Acceptance Criteria

  • ProvisioningProviderType constant added to registry
  • UnsupportedProvisioningProviderError type created with Provider field
  • provisioning.Manager.newProvider() returns typed error when provider not found
  • ExecuteWithAutoInstall() handles UnsupportedProvisioningProviderError
  • Extension registry filtering works with ProvisioningProviderCapability + provider name
  • User is prompted to install matching extension when unknown provider is configured
  • Command retries successfully after extension installation
  • Unit tests for the new error type and auto-install handler
  • Integration test verifying end-to-end auto-install flow for provisioning providers

References

  • Existing auto-install implementation: cmd/auto_install.go (ExecuteWithAutoInstall())
  • Service target error type: pkg/project/service_manager.go (UnsupportedServiceHostError)
  • Extension filtering: pkg/extensions/manager.go (FindExtensions(), createExtensionFilter())
  • Provider metadata: pkg/extensions/registry.go (Provider, ProviderType)
  • Provisioning provider resolution: pkg/infra/provisioning/manager.go (newProvider())

Metadata

Metadata

Assignees

Labels

enhancementNew feature or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions