Auto-install: fix/improve project extension requirement resolution#9218
Conversation
|
Azure Pipelines: 20 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Resolve exact same-source dependency versions during preflight so extension packs cover inferred providers without extra source prompts. Skip installed extension IDs before selection, reuse source choices, and surface preflight failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c802f692-befd-4e8b-aca8-152699d438a0
There was a problem hiding this comment.
Pull request overview
Adds preflight extension resolution so project commands install missing explicit and inferred providers before execution.
Changes:
- Resolves extension requirements and dependency graphs.
- Rebuilds the command tree after installation.
- Adds version-resolution and auto-install tests.
Show a summary per file
| File | Description |
|---|---|
cli/azd/pkg/extensions/manager.go |
Exposes extension version resolution. |
cli/azd/pkg/extensions/manager_test.go |
Tests nil metadata handling. |
cli/azd/cmd/auto_install.go |
Implements project extension preflight and installation. |
cli/azd/cmd/auto_install_test.go |
Tests requirements, providers, dependencies, and errors. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 5
- Review effort level: Medium
Require capability, provider name, and provider type on the same extension version; honor installed dependency metadata; normalize installed IDs; and preserve container singletons when rebuilding command bindings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c802f692-befd-4e8b-aca8-152699d438a0
Move project-specific extension discovery, dependency resolution, and preflight error rendering into a dedicated command file without changing behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c802f692-befd-4e8b-aca8-152699d438a0
Honor --cwd during command-tree construction, propagate provider lookup failures, validate constrained and installed extension versions, and avoid repeating a declined preflight prompt in the legacy fallback. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c802f692-befd-4e8b-aca8-152699d438a0
|
/azp run azure-dev - cli |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Fixes #8999
This PR preflights extension requirements declared or inferred from
azure.yamlbefore project commands run, allowingazdto install all missing providers once and then execute with a rebuilt command tree.Issue
Project commands could fail on the first unsupported service host before offering the required extension. Auto-install also ignored explicit extension requirements and custom provisioning providers, and duplicate registry sources could produce repeated or no-op source-selection prompts.
Preflight extension resolution
up,provision,deploy,package,restore,down,show,monitor,infra generate, andenv refresh.requiredVersions.extensionsentries and providers inferred from service hosts and infrastructure layers.--cwdwhen it is provided.Version and dependency handling
Example
The following project explicitly requires the Microsoft Foundry extension pack while also using service and provisioning providers supplied by its dependencies:
Without changes:
With changes:
Behavior at a glance
requiredVersions.extensionsinfra.providerTesting
Covered explicit constraints, provider-version filtering, installed extensions, duplicate sources, shared service and infrastructure providers, direct and transitive pack dependencies, dependency-version conflicts, deterministic ordering, and visible preflight failures. Also validated the affected packages with build, unit-test, and lint checks plus isolated CLI runs using real registry metadata.