Distribution.serieses is sorted by debversion, but versions are sane_version

Bug #404613 reported by Curtis Hovey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

in the schema, distroseries.version is constrained by sane_version, but the the model, Distribution.series is sorted using the stricter lp.archivepublisher.debversion. Example versions that are acceptible to sane_version are not acceptible to debversion, causing an exception.

This is wrong since a distro other than Ubuntu or Debian may choose rules that differ than debversion. The issue in the code appears to be sorting, so a better sort rule is needed, such as sorted_version_numbers.

This may be a blocker for bug 47864 and bug 42809.

Revision history for this message
Curtis Hovey (sinzui) wrote :

Hi Celso.

I see you added the sort by Version() rule. The tests you modified pass when I switch to sorted_version_numbers which is used for milestones and releases to resolve string confusions in version. This change will make the code behave as the schema expects, while preserving the sorted order.

However, is the schema wrong? Since this code has been in place for 3 months, I think we know that all distroseries versions conform to debversion. Should they always? I can use debversion to ensure all distroseries versions (for all distros) are debversion compatible.

Revision history for this message
Celso Providelo (cprov) wrote :

Hi Curtis,

Ubuntu and Debian series version will always conform to debversions (I presume due to dpkg), but I think this is not necessarily intentional or needed. All the other series and milestones hosted in LP might not follow the peculiar interpretation of '~', '+' and ':', for instance.

debversion is strictly necessary for debian sources and binaries, that we can't change, however series and milestones could follow a much simpler and more natural version mechanism.

We must consult the ubuntu team and verify if they depend on something special from debversion before deciding. Noting that, as far as I can see, 'sane_version' sorting will be identical with sorted_version_numbers or debversion.

Revision history for this message
Curtis Hovey (sinzui) wrote :

Thanks for your opinion Celso.

I have decided to not let this bug block the fixed to the distroseries views. Since every distroseries in production does conform to the debversion, I think we delay changing validation until other distro owners see this bug. DistributionMirrors also user Version, and the use appears to be very credible. If this were a real problem for registered distros, we would have noted the discrepancy in the database sooner.

I think the correct fix will be to make the database constraint be sane_debian_version.

Curtis Hovey (sinzui)
Changed in launchpad-registry:
assignee: Curtis Hovey (sinzui) → nobody
Curtis Hovey (sinzui)
tags: added: tech-debt
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.