conficient/versionReaderTask

error : '0.3.0.' is not a valid version string.

olafsep01 opened this issue · 3 comments

Hi @conficient,

I have used your versionReaderTask without problem until yesterday in an azure build pipeline. I found out you did change "v1.10 - ensure ver ends in ." and now I get this error message 'is not a valid version string'.
In the envirionvariable VERSION: 0.3.0. now a '.' at the end. This gives an error in the restore command of .net core. ([command]"C:\Program Files\dotnet\dotnet.exe" restore ...)
I do not know why you did this change. I used the parameter 'Build Prefix: .' (VERSION) to get the 'VERSION_BUILD' right.
So first I removed the build prefix, but the same error, but VERSION_BUILD is correct.
Now I copied your code in a devops powershell command without the "v1.10 - ensure ver ends in ." and this works fine.
Could you have a look into this?

Regards,
Olaf

I'm having the exact same problem.
Been using this task happily for a while, but this latest version has completely blocked my build pipeline.

I'm not sure why it was necessary to add the dot. The default value for the buildPrefix variable is . (see #1), but this can be overridden, such as in my case, where I use -alpha{build_number} for builds from my development branch and -rc{build_number} for builds off my release, so the . should be present, unless it has been manually override.

Sorry if this has caused issues. I made the change because some of my pipelines were reading "1.2" in the version and creating a build version like 1.26789 which obviously breaks the versioning.

I'll investigate and do some testing and release a fix.

Sorry @olafsep01 and @christophano !

I'd updated this quickly, forgetting this was supposed to be handled using the Build Prefix variable.

The Build Prefix is supposed to default to '.' when a Version Reader task is created (that's what's in the code) but it seems to get ignored by DevOps.

I've reverted this change in v1.13 and run tests for a .NET Standard and a .NET Framework library (both using 2017 project format). This should now be fixed.