-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins Core 2.426.2
Pipeline Utility Steps 2.16.0
According to the documentation, the possible return values of the step compareVersions are -1, 0 and 1.
The following code snippet gives a return value of -2.
// Scripted syntax node { stage('test') { String tag1 = '1.2.3' String tag2 = '1.2.3-myBranch-SNAPSHOT' def comparisonResult = compareVersions(v1: tag1, v2: tag2) echo comparisonResult.toString() } }
Inverting arguments v1 and v2 results in -2 as the return value.
This return value is not documented.
- Is this a bug?
- Is the documentation incomplete?
If the latter, what is the logic behind this return value, and how does it differ from -1 (or 1)?