microsoft / microsoft/winget-pkgs
[New Feature]: Support multiple executable validation argument mappings atomically
- Dominant language
- No language data
- Stars
- 11.1k
- Forks
- 9.7k
- PR merge metrics
- PR metrics pending
Description
### Description of the new feature/enhancement
Packages can contain multiple portable executables that each require an argument to exit successfully during installation verification.
The current command supports one mapping at a time:
```text
@wingetbot installationmetadata exe add
```
This does not work for packages requiring several mappings. Testing on https://github.com/microsoft/winget-pkgs/pull/409107 showed that submitting mappings for `uv.exe`, `uvx.exe`, and `uvw.exe` created three validation operations:
- https://dev.azure.com/shine-oss/8b78618a-7973-49d8-9174-4360829d979b/_build/results?buildId=381032
- https://dev.azure.com/shine-oss/8b78618a-7973-49d8-9174-4360829d979b/_build/results?buildId=381033
- https://dev.azure.com/shine-oss/8b78618a-7973-49d8-9174-4360829d979b/_build/results?buildId=381034
Each new operation canceled the preceding operation. Only the final operation reached installation verification, where it failed without producing executable analysis or persisted `.validation` metadata. An automatic retry also failed:
https://dev.azure.com/shine-oss/8b78618a-7973-49d8-9174-4360829d979b/_build/results?buildId=381139
Wingetbot should support submitting all executable argument mappings for a package as one atomic update that triggers one validation run.
This is related to, but distinct from, the existing single-mapping application bug:
https://github.com/microsoft/winget-pkgs/issues/399195
### Proposed technical implementation details (optional)
Extend the installation-metadata command and underlying service API to accept a collection of executable-to-argument mappings in one operation. For example:
```text
@wingetbot installationmetadata exe add uv.exe=--help uvx.exe=--help uvw.exe=--help
```
The exact syntax may differ, but the operation should:
1. Validate all executable names against `NestedInstallerFiles`.
2. Store the complete mapping set as one pending metadata update.
3. Queue only one validation operation.
4. Invoke every executable with its corresponding argument.
5. Persist all successful mappings together in the package's `.validation` file.
6. Avoid partial persistence if any mapping fails.
7. Report which executable and argument failed.
8. Preserve compatibility with the existing single-executable syntax.
9. Allow future package versions to reuse the persisted mappings.
10. Clear the applicable validation labels after all mapped executions succeed.
The operation should also be idempotent so retrying the same mapping set does not create duplicate entries or conflicting validation operations.
Drafted with GitHub Copilot assistance.
Contributor guide
Research direction
Start by tracing the installationmetadata exe add command and its underlying service API, including validation against NestedInstallerFiles and persistence in the package's .validation file. Review how the existing single-executable syntax queues validation and persists mappings. Done means one atomic, idempotent update accepts multiple mappings, runs one validation, reports failures, and avoids partial persistence while preserving single-mapping compatibility.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend-api-design, cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100