Draft
Improve extension install error for missing versions#9539
Conversation
|
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. |
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
tg-msft
reviewed
Aug 12, 2026
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 | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
azd extension install --versionreturnedno extensions foundwhen 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
Regression coverage
Example output: