-
Notifications
You must be signed in to change notification settings - Fork 1
Description
.NET Framework Used:
- .NET 9.0
- Something else
OS Environment:
- Windows 10
- Windows 10 IoT Core
- Windows Server 2012
- Windows Server 2012 R2
- Windows Server 2016
OS Version: ####.####...
I have already...
- Reproduced the problem using the latest stable release.
- Reviewed the documentation.
- Reviewed the current issues to check that the issue isn't already known.
Description:
CI version strings are incorrectly eliminating the Prereelease and Fix number when 0. The
behavior of these is confusing as a CSemVer drops the unneccesary 0. However a CSemVer-CI NEVER drops them and always includes the 0. See Formatting illustrated in CSemVer-CI §6
Steps to reproduce the problem:
- Reviewed the documentation.
- Included Sample code or link to repository/gist to reproduce the bug (This is the fastest way to a resolution as it reduces the time to reproduce the problem. The smaller the sample is the better.)
Run standard tests and they all pass. While they should pass, they should also validate correct behavior. Unfortunately, the current implementation of the task AND the tests
will incorrectly assume that CI and non CI behavior is the same, when it should not be. In particular the test case BuildTaskTests.PreReleaseFixOfZeroNotShownIfNumber
is using a
CI build with an expected result of $"20.1.6-delta.1.ci.{expectedIndex}.QRP"
but that is incorrect (but sadly what the task produces so passes the tests...)
Expected Behavior
The tests should not assume syntax requirements of a CSemVer is the same as CSemVer-CI. They should test actual requirements that include non-CI builds (with or without pre-release number or fix), as well as CI builds. That is the matrix of things to test and that
the task must correctly handle is far greater than what is presently covered.
Specifically, the tests should expect a result of
$"20.1.6.delta.1.0.ci.expectedIndex}.QRP"
for a CI build. However, the test name suggests it is trying to validate the rule for CSemVer §10 which is for a non-CI build and should NOT include the 0
value. So, the tested behavior should account for all possible combinations of support for the pre-release Number and CI.
Number | Fix | CI | Result |
---|---|---|---|
0 | 0 | No | Empty Pre-release string |
0 | 1 | No | "0.1" |
1 | 0 | No | "1" |
1 | 1 | No | "1.1" |
0 | 0 | Yes | "0.0" |
0 | 1 | Yes | "0.1" |
1 | 0 | Yes | "1.0" |
1 | 1 | Yes | "1.1" |
Actual Behavior
Task, and tests (as mentioned) incorrectly assume CI version strings should NOT show the 0 values for pre-release Number and fix, but the CSemVer-CI spec illustrates them as doing exactly that.
Additional context
Sadly, the CSemVer/CSemVer-CI "spec" is lacking on [ahem...] actual specification and relies on illustrative examples a LOT. It is easy to miss such a thing as a requirement.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status