ipm icon indicating copy to clipboard operation
ipm copied to clipboard

Package Manager should not throw errors incorrectly on valid semantic versions

Open isc-kiyer opened this issue 1 year ago • 1 comments

The package manager incorrectly throws errors on a semantic version like the following:

2.1.0-1m1

This had to be tweaked to 2.1.0-1.m1 for the package manager to consider it valid. However, such a version is valid as per semver: https://semver.org/.

The bug is is %IPM.General.SemanticVersion:%OnValidateObject().

The logic there should probably be re-written entirely to validate simply against a regular expression.

isc-kiyer avatar Jul 30 '24 17:07 isc-kiyer

@isc-kiyer This bug seems to have been fixed already. On v1-next, I did the following successfully

USER>set ver =  ##class(%IPM.General.SemanticVersion).FromString("2.1.0-1m1")

USER>zw ver
ver=54@%IPM.General.SemanticVersion  ; <OREF>
+----------------- general information ---------------
|      oref value: 54
|      class name: %IPM.General.SemanticVersion
| reference count: 2
+----------------- attribute values ------------------
|              Build = ""
|              Major = 2
|              Minor = 1
|              Patch = 0
|         Prerelease = "1m1"
+-----------------------------------------------------

isc-shuliu avatar Sep 13 '24 15:09 isc-shuliu

Verified once again that this works on v1 and v1-next. Closing for now.

isc-shuliu avatar Oct 24 '24 16:10 isc-shuliu