Skip to content

fix(shared): compare prerelease versions without locale or precision loss - #32169

Open
luke2x wants to merge 1 commit into
pingdotgg:mainfrom
luke2x:fix/semver-prerelease-order-nov6
Open

luke2x wants to merge 1 commit into
pingdotgg:mainfrom
luke2x:fix/semver-prerelease-order-nov6

Conversation

@luke2x

@luke2x luke2x commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Prerelease versions were ordered with locale collation and floating-point parsing. This can put Z after a, or treat distinct large numeric identifiers as equal, affecting update/version comparisons.

Change

Compare text identifiers by code point and numeric identifiers with BigInt. Extend the existing prerelease regression case to cover both failures.

Scope and approval

A small, focused fix for an obvious version-ordering bug. It corrects prerelease comparisons in the existing helper and its regression case, without introducing a new version policy or product behavior.

Verification

Validation: regression failed before the fix; vp test run packages/shared/src/semver.test.ts and vp run check:changed pass (format, lint, knip, affected-package typechecks, adjacent tests).

Model: gpt-6.1-sol. Harness: Codex in T3 Code.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T20:18:09.479198Z 6619109 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 6, 2026
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Prerelease comparison now uses BigInt for numeric identifiers and direct string ordering for nonnumeric identifiers. Tests add cases for uppercase and lowercase ordering, hyphenated identifiers, and large numeric identifiers.

Changes: Prerelease comparison

Layer / File(s) Summary
Compare prerelease identifiers
packages/shared/src/semver.ts, packages/shared/src/semver.test.ts
Numeric identifiers are compared with BigInt. Nonnumeric identifiers use direct string ordering. Tests cover case-sensitive ordering, hyphenated identifiers, and large numeric values.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: romil-bijarnia

Merge Risk: Minimal · up to 66191

No merge-blocking risk was identified in the prerelease comparison change.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly describes the main change to prerelease comparison.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description covers the problem, change, scope, and verification. It explains the exception to prior approval and identifies the model and harness.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between bdb8d5d and 6619109.

Files selected for processing: 2

  • packages/shared/src/semver.test.ts
  • packages/shared/src/semver.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant