case-folding of "ProductCode" field
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- api, documentation
Research direction
Start at the REST source's /manifestSearch endpoint and trace how ProductCode requests with MatchType Exact are compared, using the lowercased examples and the official source behavior described here. Done means the expected ProductCode normalization and matching behavior is established and documented for REST-source implementers.
Written by the indexing model from the issue text.
Description
Brief description of your issue
Hi,
for implementing my own REST-source I have found the schemas and some of the code provided in this repository very helpful.
However one thing that is not clear to me is how the REST source is expected to act in regards to ProductCode normalization of the client (winget CLI).
If we look at some public and working manifests from the winget-pkgs repo, such as:
Telerik.Fiddler.Classic
Clement.bottom
we can see that they specify the ProductCode as a string containing uppercase letters. In my REST-source I ingest these exact same manifest files into my data model to be queried by winget clients.
When doing a winget list operation, the winget CLI sends a lot of API POST requests to the /manifestSearch endpoint, looking for matching packages for the ARP (add-remove-programs) entries it finds on the local computer. For the local ARP entry of the program "Fiddler", this API request carries the following body data:
{
"Inclusions": [
{
"PackageMatchField": "ProductCode"
"RequestMatch": {
"KeyWord": "fiddler2"
"MatchType": "Exact"
}
},
{
"PackageMatchField": "NormalizedPackageNameAndPublisher"
"RequestMatch": {
"KeyWord": "progresstelerikfiddler"
"MatchType": "Exact"
}
}
]
"Filters": []
}
as we can see, winget-CLI appears to lowercase the ProductCode before sending the API request, but at the same time specifies a MatchType of Exact instead of CaseInsensitive - so, in my current implementation, my REST source dutifully returns back 0 matches. I have observed the same behavior with full-on GUIDs such as the one the Clement.Bottom package uses. Winget-CLI queries for the correct GUID, but in all-lowercase with MatchType Exact - leading to no matches being found.
However, when I query the official winget source I do get matches for these programs back.
So my question is whether a REST source is expected to normalize all ProductCodes to lowercase on ingest (despite the fact that a CaseInsensitive MatchType also exists?) or whether I'm misinterpreting what I'm seeing.
If this is the case and ProductCodes are to be normalized server-side, it would be great if this could be documented.
Thank you!
- Dominant language
- C#
- Stars
- 317
- Forks
- 79
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/winget-cli-restsource
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Issue-Feature
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Font Support OpenIssue-Feature
microsoft/winget-cli-restsource#310 · 1 comment · 1 assignee ·
-
Issue-Bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
microsoft/winget-cli-restsource#309 · 2 comments ·
All issues in microsoft/winget-cli-restsource
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·