jedieaston / Add-ARPEntries

A script to generate AppsAndFeaturesEntries for winget!
MIT License
3 stars 2 forks source link

DisplayVersion overlap between versions #9

Open russellbanks opened 2 years ago

russellbanks commented 2 years ago

Sometimes, packages can have two versions with the same DisplayVersion, as shown below. This caused the pipelines to fail when they were merged and I hadn't realised this would be an issue.

Azul.Zulu.11.JDK DisplayVersion overlap: https://github.com/microsoft/winget-pkgs/pull/73769 https://github.com/microsoft/winget-pkgs/pull/73772

To prevent this, ideally Add-ARPEntries could loop/recurse through all the other folders in the parent directory, and check their DisplayVersion.

If none match, then perfect. If the value it intends to write matches another folder, it would only keep it on the lowest version/remove it on the greatest version.

This would only account for the case where a directory has some ARP entries written for some versions and not others. I can try my best to account for this in the recursive script (once I learn Powershell-Yaml more) so that it can maybe remember what DisplayVersion values have been written for previous iterations (maybe adding each value to an array as it's iterated?) so that it can ensure there are no version overlaps (bit easier recursively because it creates PRs from smallest -> highest version).

I don't think this is a particularly easy issue to fix, so let me know if you have any ideas.

jedieaston commented 2 years ago

This is an issue that needs to be fixed, but the core Add-ARPEntries script is probably not the place to do it. It's designed to work against manifests that may not be inside the winget-pkgs community repo (where this issue doesn't exist).

With that being said, this should be fixable using another script that could just use Add-ARPEntries as a set of functions, modifying the data it outputs (like your recurse script does). Let me ponder how to do that.