Skip to content

Improve extension install error for missing versions - #9539

Draft
tg-msft with Copilot wants to merge 4 commits into
mainfrom
copilot/improve-error-message-extension
Draft

Improve extension install error for missing versions#9539
tg-msft with Copilot wants to merge 4 commits into
mainfrom
copilot/improve-error-message-extension

Conversation

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

azd extension install --version returned no extensions found when the extension existed but the requested version did not. This made a version mismatch look like a missing extension or registry problem.

  • Install error handling

    • Detects the “extension exists, requested version missing” case by retrying lookup without the version filter.
    • Reports the requested version and latest available version.
    • Includes an actionable install command for the latest version.
  • Regression coverage

    • Adds coverage for installing an existing extension with an unavailable version from a local source.

Example output:

ERROR: extension 'test.ext' version '0.1.0' was not found; latest version is '1.0.0'

Suggestion: Run 'azd extension install test.ext --version 1.0.0 --source local-dev' to install the latest version.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
19 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI and others added 2 commits August 11, 2026 21:23
Co-authored-by: tg-msft <1179329+tg-msft@users.noreply.github.com>
Co-authored-by: tg-msft <1179329+tg-msft@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve error message for missing extension version Improve extension install error for missing versions Aug 11, 2026
Copilot AI requested a review from tg-msft August 11, 2026 21:27
Comment thread cli/azd/cmd/extension.go
Comment on lines 960 to +977
extensionMatches, err := a.extensionManager.FindExtensions(ctx, filterOptions)
if err != nil {
a.console.StopSpinner(ctx, stepMessage, input.StepFailed)
return nil, fmt.Errorf("failed to find extension: %w", err)
}
if len(extensionMatches) == 0 {
unversionedOptions := *filterOptions
unversionedOptions.Version = ""
unversionedMatches, err := a.extensionManager.FindExtensions(ctx, &unversionedOptions)
if err != nil {
a.console.StopSpinner(ctx, stepMessage, input.StepFailed)
return nil, fmt.Errorf("failed to find extension: %w", err)
}
if err := extensionVersionNotFoundError(extensionId, a.flags.source, a.flags.version, unversionedMatches); err != nil {
a.console.StopSpinner(ctx, stepMessage, input.StepFailed)
return nil, err
}
}

@tg-msft tg-msft Aug 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copilot - doing multiple searches is subpar. All of this logic (including the error message improvements) should be moved into FindExtensions rather than trying to call it multiple times.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 511aacb. Missing-version detection and latest-version error details now come from FindExtensions during the same source enumeration, and the install path no longer performs a second lookup.

Co-authored-by: tg-msft <1179329+tg-msft@users.noreply.github.com>
Copilot AI requested a review from tg-msft August 12, 2026 00:55
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.

Improve error message when specific extension version not found

2 participants