fix: use greedy regex for version parsing#147
Open
ss251 wants to merge 2 commits intosolana-foundation:masterfrom
Open
fix: use greedy regex for version parsing#147ss251 wants to merge 2 commits intosolana-foundation:masterfrom
ss251 wants to merge 2 commits intosolana-foundation:masterfrom
Conversation
The VERSION_REGEX used a non-greedy quantifier (\d+?) for the patch version, causing versions like "0.4.11" to be incorrectly parsed as "0.4.1". This resulted in false "update available" warnings when tools were already at the latest version. Changed from: /(?:[\w-]+\s+)?(\d+\.\d+\.?\d+?)/ Changed to: /(?:[\w-]+\s+)?(\d+\.\d+\.?\d+)/
🦋 Changeset detectedLatest commit: 2cf73b9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Problem
The
VERSION_REGEXinsrc/lib/shell/index.tsuses a non-greedy quantifier (\d+?) for the patch version, causing versions like0.4.11to be incorrectly parsed as0.4.1. This results in false "update available" warnings when tools are already at the latest version.Example:
When
solana-verify --versionactually returns0.4.11.Summary of Changes
Changed from non-greedy to greedy quantifier in
VERSION_REGEX:Test:
Related PR
See also #150 which fixes a separate issue where the "update available" warning shows even when
needsUpdateis false. Both PRs together fully resolve the false warning issue:0.4.11parsed correctly)needsUpdate: true)Fixes #148