cran: Ensure artifacts info sent to loaders are correctly ordered
Use looseversion.LooseVersion2(version)
as key to correctly sort
artifacts of a CRAN package as comparing version strings with
lexicographical order can lead to invalid results.
Related to #4711.
Merge request reports
Activity
Jenkins job DLS/gitlab-builds #403 succeeded in 3 min 51 sec.
See Console Output, Blue Ocean and Coverage Report for more details.While this change probably doesn't hurt, depending on how versions are sorted between lister and loader seems slightly brittle; would it make sense to sort the versions when computing the HEAD alias in the loader instead? Either way the branches will end up sorted in lexicographic order when stored and retrieved in
swh.storage
.(I guess the way the HEAD alias is determined will change when we end up archiving the latest version of packages too, but in the mean time I guess it's fine to land this change)
Indeed it seems a better idea to handle versions sorting in package loaders instead.
I ended up with swh-loader-core!533 (merged) that defines a base implementation for sorting package versions.
I am closing this MR then.
Closing this in favor of swh-loader-core!533 (merged).