microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
22.53k stars 1.39k forks source link

Fix limit mode metadata blocking #4489

Closed JohnMcPMS closed 1 month ago

JohnMcPMS commented 1 month ago

Change

The serialization code should not be modifying the object that it is operating on. Move it to instead skip the output of some values rather than removing them.

When the remoting server is operating in limited mode, the metadata must match between the initial limitation set and the incoming unit. This removal was also breaking that, as the entry was now missing.

Validation

Manual confirmation that the limit mode works after the change.

Microsoft Reviewers: Open in CodeFlow
JohnMcPMS commented 1 month ago

So looks like during serialization "module" will be excluded from metadata, I guess the incoming unit will have "module" dropped in the metadata somewhere else?

No, module gets inserted from the resource name if present. This was removing it for serialization for brevity, but by actually removing it the limit matching broke.

JohnMcPMS commented 1 month ago

/azp run

azure-pipelines[bot] commented 1 month ago
Azure Pipelines successfully started running 1 pipeline(s).
JohnMcPMS commented 1 month ago

/azp run

azure-pipelines[bot] commented 1 month ago
Azure Pipelines successfully started running 1 pipeline(s).