winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Clarify `No installed package matching the input criteria was found` in upgrade flow

Open Trenly opened this issue 2 years ago • 8 comments

It seems to work, I am sorry. I was wondering about the message: "No installed package matching the input criteria was found". So I thought my installed software wasnt recognized by winget. I expected something like "No updates available" or something else.

This change provides a separate message when there are no matching search results found. In order to keep things clean, I switched the boolean parameter to an enum to allow for more fine-grained control over the messaging and to keep it extensible.

I also decided to not use the existing No applicable upgrade found message, as there is a difference between an upgrade being available and an upgrade being applicable. The message for applicability is still used when an upgrade is available, but an install attempt finds no upgrade that is applicable.


Edit: Since #2861 was merged, I rebased this PR due to a merge conflict and changed the SearchPurpose enum to a higher scope level to increase re-use. I did re-validate all of the happy-paths after the rebase.

Trenly@CORSAIR-JLU545 MINGW64 /d/Git/winget-cli (NoUpdatesFound)
$ winget upgrade windirstat
No applicable upgrade found.

Trenly@CORSAIR-JLU545 MINGW64 /d/Git/winget-cli (NoUpdatesFound)
$ winget list nothinginstalledmatchingthis
No installed package found matching input criteria.

Trenly@CORSAIR-JLU545 MINGW64 /d/Git/winget-cli (NoUpdatesFound)
$ winget search nothinginsourcematchingthis
No package found matching input criteria.

Trenly@CORSAIR-JLU545 MINGW64 /d/Git/winget-cli (NoUpdatesFound)
$ winget uninstall nothinginstalledmatchingthis
No installed package found matching input criteria.
Microsoft Reviewers: Open in CodeFlow

Trenly avatar Jan 25 '23 02:01 Trenly

@yao-msft - Could I trouble you for a few moments of your time?

Trenly avatar Feb 07 '23 22:02 Trenly

@yao-msft - Could I trouble you for a few moments of your time?

Sorry, I'll take a look now.

yao-msft avatar Feb 07 '23 22:02 yao-msft

/azp run

yao-msft avatar Feb 07 '23 22:02 yao-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Feb 07 '23 22:02 azure-pipelines[bot]

/azp run

yao-msft avatar Feb 09 '23 22:02 yao-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Feb 09 '23 22:02 azure-pipelines[bot]

##[error]There are one or more test failures detected in result files. Detailed summary of published test results can be viewed in the Tests tab.

I can't seem to find the Tests tab to tell me which one is failing ;-;

Trenly avatar Feb 13 '23 20:02 Trenly

##[error]There are one or more test failures detected in result files. Detailed summary of published test results can be viewed in the Tests tab.

I can't seem to find the Tests tab to tell me which one is failing ;-;

image

Looks like some tests were looking for the strings you changed: FAILED: REQUIRE( installOutput.str().find(Resource::LocString(Resource::String::UpdateNotApplicable).get()) != std::string::npos )

florelis avatar Feb 13 '23 20:02 florelis

@yao-msft - Can you trigger the pipelines and hopefully the unit tests pass this time around?

Trenly avatar Mar 02 '23 03:03 Trenly

/azp run

denelon avatar Mar 02 '23 17:03 denelon

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Mar 02 '23 17:03 azure-pipelines[bot]

The failing test is UpdateFlow_UpdateExeSpecificVersionNotApplicable With failing stack: REQUIRE( updateOutput.str().find(Resource::LocString(Resource::String::UpdateNotApplicable).get()) != std::string::npos ) with expansion: 18446744073709551615 (0xffffffffffffffff) != 18446744073709551615 (0xffffffffffffffff) \x1B[0mThe install technology of the newer version specified is different from the current version installed. Please uninstall the package and install the newer version.

at D:\a\1\s\src\AppInstallerCLITests\UpdateFlow.cpp(513)

yao-msft avatar Mar 02 '23 19:03 yao-msft

The failing test is UpdateFlow_UpdateExeSpecificVersionNotApplicable With failing stack: REQUIRE( updateOutput.str().find(Resource::LocString(Resource::String::UpdateNotApplicable).get()) != std::string::npos ) with expansion: 18446744073709551615 (0xffffffffffffffff) != 18446744073709551615 (0xffffffffffffffff) \x1B[0mThe install technology of the newer version specified is different from the current version installed. Please uninstall the package and install the newer version.

at D:\a\1\s\src\AppInstallerCLITests\UpdateFlow.cpp(513)

Ah. That makes sense. I don't know why I didn't see that before. Thank you for the detail (and the patience with me, as for some reason my computer refuses to run the unit tests, even though I know I've set the certificates)

Trenly avatar Mar 02 '23 20:03 Trenly

/azp run

yao-msft avatar Mar 02 '23 22:03 yao-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Mar 02 '23 22:03 azure-pipelines[bot]

InstallExeFoundExistingConvertToUpgradeNoAvailableUpgrade e2e test failed

at AppInstallerCLIE2ETests.InstallCommand.InstallExeFoundExistingConvertToUpgradeNoAvailableUpgrade() in \src\AppInstallerCLIE2ETests\InstallCommand.cs:line 591

yao-msft avatar Mar 03 '23 01:03 yao-msft

/azp run

yao-msft avatar Mar 10 '23 20:03 yao-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Mar 10 '23 20:03 azure-pipelines[bot]

/azp run

I apologize in advance if the unit tests fail again. I keep getting certificate errors anytime I try to run them locally and I can't figure out why. I've followed the steps in the readme to generate the cert and start the local web server, but no dice

Trenly avatar Mar 10 '23 20:03 Trenly

/azp run

I apologize in advance if the unit tests fail again. I keep getting certificate errors anytime I try to run them locally and I can't figure out why. I've followed the steps in the readme to generate the cert and start the local web server, but no dice

Those are for e2e tests. And yes it's quite complex to setup. For unit tests, I think you can just run the AppInstallerCliTests.exe, and it should just start. And if there are any test failures, I can help fix them directly if you are ok.

yao-msft avatar Mar 10 '23 20:03 yao-msft