dont't prompt for version when --version was supplied#15527
dont't prompt for version when --version was supplied#15527Muckenbatscher wants to merge 4 commits intomicrosoft:mainfrom
--version was supplied#15527Conversation
…pire add The interactive flow would be initiated when a package was found but the version passed by the --version flag is not the latest version of the integration nuget package. Now fetch all the versions for the selected package from all configured channels. If the CLI supplied version is found in the list of the available versions skip the interactive flow and use the CLI supplied version.
When supplying a version parameter through the CLI handle the cases: * supplied version is not the latest version found in any channel * supplied version does not exist in any of the channels
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15527Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15527" |
|
I felt responsible for a fix because the CPM test that I introduced surfaced the behaviour and caused the CLI E2E tests to fail😀 |
|
Also just noticed something: Would you prefer for me to alter the affecting commit to not include these changes? |
`aspire add redis --version 13.1.2` will not prompt for a version in this E2E CLI test
b53e647 to
84b964f
Compare
Description
When the
--versionflag is supplied to aspire CLI duringaspire addit would previously prompt for the version anyways.This only happened when the supplied version is not the latest version of the selected integration package.
Now the CLI will search for all existing versions of a package and if a match to the supplied version is found, it will add it to the Apphost without prompting.
If the supplied version is not found in any of the channels the CLI will still prompt for a version bt will suggest the latest version from each of the sources.
The search for nuget versions is done with the dotnet CLI using the
--exact-matchflag. This will make sure that all the versions that are returned are from the same package.The search results are cached like before. For this the key was extended to include the "exactMatch" parameter.
(This means that previously cached pacakage searches cause a cache miss now, because they wil generate a different key)
Fixes #15396
Reverts the workaround PR #15393
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: