Skip to content

Report upgrades skipped as not applicable - #6637

Open
Slai.life (huong8373tt-beep) wants to merge 4 commits into
microsoft:masterfrom
huong8373tt-beep:fix/6516-upgrade-all-skip-reason
Open

Slai.life (huong8373tt-beep) wants to merge 4 commits into
microsoft:masterfrom
huong8373tt-beep:fix/6516-upgrade-all-skip-reason

Conversation

@huong8373tt-beep

@huong8373tt-beep Slai.life (huong8373tt-beep) commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Resolves #6516.

winget upgrade --all --scope user can list an available update, then skip it when no compatible user-scope installer exists. The single-package flow explains that outcome, but the --all flow previously omitted it.

This change counts APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE results in UpdateAllApplicable() and reports a concise summary after processing available updates.

Validation

  • Added UpdateFlow_UpdateAll_ReportsNotApplicable, using an installed EXE package whose newer manifest contains only a machine-scope installer while --scope user is requested.
  • Added the 1.31 release-note fragment.
  • git diff --check passed.
  • Merge-ReleaseNotes.ps1 -Version 1.31 passed.
  • Project XML and the new YAML fixture parsed successfully.
  • A local C++ test build was attempted, but dependency acquisition in the local environment prevented the test binary from being produced; the repository CI remains the full build-and-test authority.

AI assistance disclosure

Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.

Microsoft Reviewers: Open in CodeFlow

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@huong8373tt-beep

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 6637 in repo microsoft/winget-cli

@huong8373tt-beep
Slai.life (huong8373tt-beep) marked this pull request as ready for review October 30, 2026 10:49
@huong8373tt-beep
Slai.life (huong8373tt-beep) requested a review from a team as a code owner October 30, 2026 10:49
@JohnMcPMS
JohnMcPMS requested a balanced review from Copilot November 3, 2026 01:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The added user-scope argument breaks an existing upgrade success-path test, and the skipped-upgrade counter incorrectly includes already-current and pinned packages.

2 open issues
What changed in this PR

This PR addresses #6516 by adding a summary for upgrades skipped as not applicable during winget upgrade --all, extending reporting previously available only for single-package upgrades.

Changes:

  • Counts not-applicable results and adds an English summary resource.
  • Adds a scope-mismatch regression test, supporting fixture, and test-project registration.
  • Adds a 1.31 release-note fragment describing the new output.
File Description
src/​AppInstallerCLITests/​WorkflowCommon.h Declares the new test-source result.
src/​AppInstallerCLITests/​WorkflowCommon.cpp Defines a package with a machine-scope upgrade.
src/​AppInstallerCLITests/​UpdateFlow.cpp Adds summary coverage and modifies the existing success test’s scope.
src/​AppInstallerCLITests/​TestData/​UpdateFlowTest_Exe_MachineScope.yaml Supplies the machine-only EXE upgrade fixture.
src/​AppInstallerCLITests/​AppInstallerCLITests.vcxproj.filters Groups the new fixture under test data.
src/​AppInstallerCLITests/​AppInstallerCLITests.vcxproj Includes the fixture in test deployment.
src/​AppInstallerCLIPackage/​Shared/​Strings/​en-us/​winget.resw Adds the skipped-upgrade summary text.
src/​AppInstallerCLICore/​Workflows/​UpdateFlow.cpp Counts and reports not-applicable upgrade results.
src/​AppInstallerCLICore/​Resources.h Exposes the new summary resource identifier.
doc/​release-notes/​1.31/​6516-upgrade-all-skip-reason.md Documents the user-visible reporting change.

Review effort: Balanced

Comment thread src/AppInstallerCLITests/UpdateFlow.cpp Resolved

if (updateContext.GetTerminationHR() == APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE)
{
if (updateContext.Contains(Execution::Data::InstallerInapplicable))

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.

Suggested change
if (updateContext.Contains(Execution::Data::InstallerInapplicable))
if (updateContext.Contains(Execution::Data::InstallerInapplicable) && updateContext.Get(Execution::Data::InstallerInapplicable))

If it is going to be a bool, there are two values.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A blocked version can leave packagePinned true and suppress both summaries when another newer version passes pin evaluation but has no applicable installer; this case needs corrected tracking and a regression test.

1 open issue
2 resolved since last review

Review effort: Balanced

AICLI_TERMINATE_CONTEXT(APPINSTALLER_CLI_ERROR_UPDATE_INSTALL_TECHNOLOGY_MISMATCH);
}

if (isUpgrade && upgradeVersionAvailable && !packagePinned)
@huong8373tt-beep

Copy link
Copy Markdown
Contributor Author

Addressed the mixed pinned/inapplicable version case from review. The workflow now tracks whether a newer version passed pin evaluation and whether installer selection failed independently of packagePinned, and the regression test covers a pinned 2.0 version plus an allowed 1.1 version with only a machine-scope installer. Also normalized the existing release-note/test-data files to end with a newline. Commit: 18fc238. Local Windows build reached the repository C++/WinRT/vcpkg stage but was blocked by the shared vcpkg filesystem lock; no code assertion failure was observed.

@huong8373tt-beep

Copy link
Copy Markdown
Contributor Author

I am rechecking the latest Copilot comments against the current head before making any follow-up changes. I will address only confirmed issues and report the Windows validation status separately.

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.

winget upgrade --all --scope does do nothing on certain upgrades without giving reason

3 participants