fix(versioncheck): normalize semver before comparison#49
Conversation
Signed-off-by: astro_dally <animemedia64@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR fixes version comparison failures by normalizing semantic version strings before comparison. A new ChangesVersion Comparison Normalization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
matthyx
left a comment
There was a problem hiding this comment.
thanks @astro-dally it won't solve the real issue, but the fix is valuable and appreciated
Summary
Normalize semantic versions before calling
semver.Compare()to avoid incorrect comparisons whenBuildNumberdoes not contain a leadingv.Example:
treats
"4.0.6"as an invalid semantic version and incorrectly evaluates it as lower.Changes
Added
normalizeVersion()helperNormalized versions before comparison
Added regression tests covering:
Testing
Fixes #48
Summary by CodeRabbit
Bug Fixes
Tests