microsoft / winget-pkgs

The Microsoft community Windows Package Manager manifest repository
MIT License
8.75k stars 4.57k forks source link

PR validation should check capitalization matches between package ID and directory, and that there are no duplicates ignoring casing #7384

Open palenshus opened 3 years ago

palenshus commented 3 years ago

Description of the new feature/enhancement

For example, there's currently a manifest for Ditto in the repo: https://github.com/microsoft/winget-pkgs/blob/master/manifests/Ditto/Ditto/3.22.88.0.yaml. The directory is Ditto\Ditto, but the package ID is ditto.ditto. These should match so the directory to look up is deterministic from the ID, and validation should check that at PR time. By the same token, I could create a PR for Ditto with the directory ditto\ditto and that'd be allowed, even though those two directories wouldn't be allowed on Windows, differing only by case.

Proposed technical implementation details (optional)

A PR validation step should be added that ensures the manifest's directory and ID match in casing, and that there are no other manifest folders that differ only by capitalization.

jedieaston commented 3 years ago

This is why git is freaking out! Now I know I didn't just mess up my fork somehow.

denelon commented 3 years ago

We have some interesting challenges here with renaming the directory structure. When we already have approved manifests with some ID foo.bar in a directory /manifests/f/foo/bar/1.0.0/ and a PR comes in to change the package to the correct "Foo" and "Bar", the new manifest could pass in /manifests/f/Foo/Bar/2.0.0. The previous manifests would be incorrect if we were to validate them again.

vedantmgoyal9 commented 3 years ago

@denelon I think it has already been implemented and the pipelines check for it. 🤔

Trenly commented 1 year ago

[Policy] Area Validation-Pipeline