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>
| 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 | ||
| } | ||
| } |
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.
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>
|
Hi @Copilot. Thank you for your interest in helping to improve the Azure Developer CLI experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
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: