qchateau / conan-center-bot

A bot to automatically update conan-center-index
GNU General Public License v3.0
11 stars 2 forks source link

bug: `fixed` version incorrectly strips suffix from `0.7b1` #122

Open valgur opened 6 months ago

valgur commented 6 months ago

Hi @qchateau and thank you for creating this incredibly useful tool.

It looks like the _fix_version() function has an edge case that is not being handled correctly: a 0.7b1 release gets incorrectly transformed into 0.7.

I unfortunately did not catch that when merging that version into CCI, leading to https://github.com/conan-io/conan-center-index/issues/22071.

I traced the issue down to this regex replacement: https://github.com/qchateau/conan-center-bot/blob/bc403d90062c5c936077ec7b8e9ffa7759cf3fe3/ccb/version.py#L7 https://github.com/qchateau/conan-center-bot/blob/bc403d90062c5c936077ec7b8e9ffa7759cf3fe3/ccb/version.py#L94-L96

I would gladly submit a PR as well, but it's not entirely clear what cases the function is meant to cover. A small test suite would be beneficial here. I suppose I could create one from the large pool of version numbers already being handled by the tool.

valgur commented 6 months ago

Also, I also scanned all existing version-URL pairs in CCI and this was the only instance of this error that turned up, fortunately.