Fix build metadata in workflow version causing semver parsing to fail #1786
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not important for 2.8.3. The official release builds don't have build meadata so this doesn't affect them.
Bonsai has randomly been telling me that it has "upgraded" workflows I literally just saved. I finally got annoyed enough to poke around to figure out why it thought my workflow was upgraded.
Turns out it was "upgrading" them because the
version
was null here, causing the check to always succeed:bonsai/Bonsai.Editor/GraphModel/UpgradeHelper.cs
Lines 229 to 231 in 88a2412
It was null because the parsing in
SemanticVersion
was not handling the build metadata. This change properly ignores it per the semver spec.I considered adding a
BuildMetadata
property toSemanticVersion
, but I felt it wasn't super valuable as this type is internal and is built around handling comparisons for the semver spec and the build metadata is completely ignored for those purposes.This type currently has symmetry between equality operators and
Equals
/GetHashCode
as well as comparison operators andCompareTo
, but introducing this member properly should probably involve refactoring everything to break that symmetry. (Similar to howfloat.Equals
is bitwise equality butfloat.operator==
is IEEE-754 equality.)