Closed gastaldi closed 3 years ago
Since dealing with version qualifiers (
CR
,SP
and productized RedHat versions) can be a nightmare, it was recommended that if more than one result is returned from the query, the ordering would happen in the application layer.
About ordering in the application layer, io.smallrye.common.version.VersionScheme extends Comparator
so you can directly sort the result strings using VersionScheme#MAVEN
what does "latest" mean here? do you want latest supported version or latest published maven version ? they aren't necessarily the same.
like, I assume you are after just being able to sort a list of versions and wouldn't actually use the "top one" as the latest ?
By latest, I mean the greatest. Eg. If there are 1.9.0.Final, 1.10.Final and 1.11.0.Final platform or extension releases, the latest will be 1.11.0.Final
Using versioned columns formatted as %05d.%05d.%05d%s
A common use case in the registry is knowing what is the latest version of a platform or an extension. Since versions cannot be compared as Strings (eg. 1.9.0 would be higher than 1.13.0), it would be nice to have some sort of comparison in the DB, which can be further reordered in the application if necessary.
After chatting with the team, it was decided that the best approach is to have a non-unique indexed
semver
column (using thepg-semver
extension) containing amajor.minor.micro
representation of the actual platform/extension release (which the original value is kept in a separateversion
column). Since dealing with version qualifiers (CR
,SP
and productized RedHat versions) can be a nightmare, it was recommended that if more than one result is returned from the query, the ordering would happen in the application layer.