fix: version parsing failure on nightly tags#2249
Merged
Merged
Conversation
Contributor
56459cb to
0e5f94b
Compare
Refactors the update-checking logic to use regular expression matching
instead of basic string replacement when parsing version tags.
Previously, passing a nightly string like "1.12.5-nightly.xxxx" through
`.replace("v", "").split(".")` resulted in non-numeric array elements
(e.g., "5-nightly"), which evaluated to `NaN` and broke downstream version
comparison checks.
Changes implemented:
* Replaced string replacement with `.match(/^v?(\d+(?:\.\d+)*)/)[1]` to cleanly
isolate the leading numeric SemVer elements.
* Applied matching symmetrically across both `release.tag_name` and
`BuildInfo.version` arrays to guarantee structural parsing alignment.
(AI generated commit message)
3aec1e8 to
7a63f1d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refactors the update-checking logic to use regular expression matching instead of basic string replacement when parsing version tags.
Previously, passing a nightly string like "1.12.5-nightly.xxxx" through
.replace("v", "").split(".")resulted in non-numeric array elements (e.g., "5-nightly"), which evaluated toNaNand broke downstream version comparison checks.Changes implemented:
.match(/^v?(\d+(?:\.\d+)*)/)?.[1]to cleanly isolate the leading numeric SemVer elements.release.tag_nameandBuildInfo.versionarrays to guarantee structural parsing alignment.(PR name and description are AI generated)