chore: fix review comments leftovers [ED-24451]#43
Merged
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses leftover review feedback for ED-24451 by refactoring tag parsing/sorting to use semver, tightening a PHP version replacement regex, and cleaning up section structure in the version utility.
Changes:
- Refactored
parseLatestTagFromLsRemote()to sanitize regex flags, validate tags viasemver.valid(), and sort withsemver.compare()(with-betaNnormalization). - Adjusted the
patchPhpVersion()regex to remove the global flag. - Added a local
normalizeVersion()helper for beta tag normalization.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Cursor <cursoragent@cursor.com>
Ntnelbaba
previously approved these changes
Jul 15, 2026
Ntnelbaba
approved these changes
Jul 15, 2026
Comment on lines
15
to
19
| "dependencies": { | ||
| "@actions/core": "^1.11.1", | ||
| "ansi-styles": "^6.2.1" | ||
| "ansi-styles": "^6.2.1", | ||
| "semver": "^7.7.2" | ||
| }, |
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.
✨ PR Description
1. Problem & Context
Fixes review comments from ED-24451: removes custom semver sorting logic, delegates to
semverlibrary, and sanitizes regex pattern to prevent unintended global/sticky matching.2. What Changed (Where)
version-files.ts: Importsemver, addnormalizeVersion()helper, replace inline sorting withsemver.compare(), remove global flag from version regex, sanitize pattern flags.package.json: Addsemver^7.7.2 dependency; remove staleansi-stylesdependency.3. How It Works
Tag parsing now: (1) creates safe pattern by stripping
g/yflags to avoid stateful matching bugs, (2) normalizes beta versions (e.g.,1.0.0-beta1→1.0.0-beta.1), (3) filters valid semver tags, (4) sorts using standard semver comparison instead of custom logic. Removes comment separator line as cleanup.4. Risks
None — semver library is well-tested and handles edge cases better than custom sorting. Pattern sanitization prevents potential bugs with stateful regexes. Normalization required since
semver.valid()expects dots between version parts.Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how