Skip to content

Name dropping build metadata unvalidated as a semver concession - #7502

Merged
ajpallares merged 1 commit into
mainfrom
pallares/rules-engine-semver-build-metadata
Aug 25, 2026
Merged

Name dropping build metadata unvalidated as a semver concession#7502
ajpallares merged 1 commit into
mainfrom
pallares/rules-engine-semver-build-metadata

Conversation

@ajpallares

@ajpallares ajpallares commented Aug 25, 2026

Copy link
Copy Markdown
Member

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-android and hybrids

Motivation

Raised reviewing the Android port, RevenueCat/purchases-android#4077: rc.semverCompare discards everything from the first + on without checking it, so "1.0.0++junk" compares as "1.0.0". That is intended, but it sat outside the documented list of concessions and read as an oversight.

Description

The doc now counts it as the third concession, alongside partial versions and leading zeros, and a fixture pins it.

Behavior is unchanged.


Note

Low Risk
Comment and test-only change; rc.semverCompare runtime behavior is unchanged.

Overview
Documents and tests an existing rc.semverCompare behavior—no parsing or comparison logic changes.

The SemanticVersion doc comment now lists a third real-world concession: everything from the first + is stripped for precedence without validating build metadata (e.g. "1.0.0++not a valid identifier" still compares as "1.0.0"). That matches the existing prefix { $0 != "+" } parsing, which was already implied by §10 but easy to read as an oversight when porting.

A predicate fixture semver_build_metadata_is_dropped_unvalidated pins that case, and the fixture suite count is bumped 518 → 519.

Reviewed by Cursor Bugbot for commit 13caee5. Bugbot is set up for automated code reviews on this repo. Configure here.

Raised in review on the Android port: everything from the first + on is
discarded without being checked, so "1.0.0++junk" compares as "1.0.0".
That is intended, but it sat outside the list of concessions and read as
an oversight. A fixture now pins it.

Co-authored-by: Cursor <cursoragent@cursor.com>
ajpallares added a commit to RevenueCat/purchases-android that referenced this pull request Aug 25, 2026
Raised in review: everything from the first + on is discarded without
being checked, so "1.0.0++junk" compares as "1.0.0". That is intended, but
it sat outside the list of concessions and read as an oversight. A fixture
now pins it.

iOS counterpart: RevenueCat/purchases-ios#7502.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ajpallares
ajpallares marked this pull request as ready for review August 25, 2026 10:53
@ajpallares
ajpallares requested a review from a team as a code owner August 25, 2026 10:53
@ajpallares
ajpallares requested a review from a team August 25, 2026 10:53
@ajpallares
ajpallares merged commit 343ba22 into main Aug 25, 2026
18 of 20 checks passed
@ajpallares
ajpallares deleted the pallares/rules-engine-semver-build-metadata branch August 25, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants