Skip to content

lockfile: Composer 2.11's <1.0-RC1 and >=1.0-RC1, without -dev - #388

Merged
ChALkeR merged 1 commit into
mainfrom
claude/happy-hopper-dr58kj
Nov 3, 2026
Merged

ChALkeR merged 1 commit into
mainfrom
claude/happy-hopper-dr58kj

Conversation

@ChristopherTuring

Copy link
Copy Markdown
Collaborator

Why CI failed on #387

The test job on #387 failed in lockfile/tests/composer/differential.test.js on a Composer constraint. #387 only changed rn/, so the failure has nothing to do with it:

">=1p3 <1-RC1|trunk"
+ '[[>= 1.0.0.0-patch3-dev < 1.0.0.0-RC1-dev] || == dev-trunk]'   (port)
- '[[>= 1.0.0.0-patch3-dev < 1.0.0.0-RC1] || == dev-trunk]'       (Composer)

The differential test uses whichever composer is on PATH as its reference, and on GitHub's runners that is the one in the ubuntu-latest image. Composer 2.11.0 came out on 2026-10-29 and bundles composer/semver 3.6.0. Composer 2.10.3 bundles 3.4.4. composer/semver 3.5.0 changed this on purpose (composer/semver#187):

-if (!preg_match('/-' . self::$modifierRegex . '$/', strtolower($matches[2]))) {
+if (!preg_match('/-' . self::$modifierRegex . '$/i', $matches[2])) {

The old check lowercased the operand, so -rc1 never matched the regex's RC, and </>= on an RC version got -dev added. Beta and alpha versions did not. Now RC is handled the same way as beta and alpha. Once the runner image picked up Composer 2.11, every PR's CI, and main, failed on this case.

Change

  • src/composer/semver.js: the port now follows composer/semver 3.5 and later. MODIFIED matches caselessly, using i without u so that only ASCII letters fold, as in PCRE. It tests the operand as written instead of lowercased. <1-RC1 now reads as < 1.0.0.0-RC1.
  • tests/composer/differential.test.js: same pattern as the existing before84 check for PHP's version_compare. The test asks the reference Composer how it reads <1-RC1. If that Composer is older than 2.11, constraints containing rc are left out of the constraint-reading test and the matching test. Composer 2.11 and later still compare every constraint.

The port has no counterpart to the other changes in composer/semver 3.5 and 3.6: Intervals compaction, MultiConstraint bounds, CompilingMatcher caching and isValid(). Nothing else needed to change.

Checks

  • node --run lint passes.
  • Lockfile tests against Composer 2.11.1, the release CI now gets: 2065 pass, 0 fail. Before the fix, the same failure as on rn: simplify src/ and bin/rn-cli.js #387 reproduced.
  • Lockfile tests against Composer 2.8.12, which bundles semver 3.4.4: 2064 pass, 0 fail, 1 skipped. The skipped test is the existing schema test, which runs on Composer 2.10 and later only.

Generated by Claude Code

composer/semver 3.5 (composer/semver#187), which Composer 2.11 ships,
matches the modifier of a `<` or `>=` constraint caselessly instead of on
the lowered text, so `-RC1` now counts as a modifier the way `-beta1`
already did, and no `-dev` is added. GitHub's runners now have Composer
2.11, so the differential test failed on `>=1p3 <1-RC1|trunk`.

The port follows 3.5 and later. Against an older Composer, which the test
detects by asking it, constraints with an `rc` in them are left out of
the comparison.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M1K1Mt8jcz94iFhsJAEpzU
@chatgpt-codex-connector

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

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T14:27:22.499877Z 9fe1175 PR opened
🔒 Security Review ✅ Completed 2026-11-03T14:29:05.796845Z 9fe1175 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.

@ChALkeR
ChALkeR merged commit 1c0d10a into main Nov 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants