Skip to content

fix(ci): link monorepo root in laravel e2e so siblings resolve from working tree#8363

Merged
soyuka merged 1 commit into
api-platform:4.3from
soyuka:fix/laravel-e2e-link-root
Jun 29, 2026
Merged

fix(ci): link monorepo root in laravel e2e so siblings resolve from working tree#8363
soyuka merged 1 commit into
api-platform:4.3from
soyuka:fix/laravel-e2e-link-root

Conversation

@soyuka

@soyuka soyuka commented Jun 29, 2026

Copy link
Copy Markdown
Member

Problem

The Laravel E2E installation job fails on the 5.0 line with:

PHP Fatal error: Uncaught Error: Interface "ApiPlatform\Metadata\SortFilterInterface"
not found in src/Laravel/Eloquent/Filter/OrderFilter.php:26

The install resolves api-platform/metadata (and other siblings) to the stale stable v4.3.15, which predates SortFilterInterface.

Root cause

The install step ran composer global link ../src/Laravel, pointing pmu at the laravel subdir. pmu discovers monorepo packages from the directory it's given, so it found only api-platform/laravel and registered a path repo for it alone.

The sibling packages had no path repo, so they resolved from packagist. pmu's link rewrites inter-package constraints to @dev, and @dev + prefer-stable makes composer pick the highest stable version — v4.3.15 — which lacks SortFilterInterface.

api-platform/laravel itself came from the working tree (the failing log shows 5.0.x-dev 369bb2c, composer's path-repo reference), which is why the runtime crash hit the working-tree OrderFilter against 4.3.15 metadata.

Fix

Link the monorepo root instead. pmu then registers path repos for every split package, and path repositories win over packagist even under prefer-stable, so all api-platform/* resolve from the working tree while the Laravel ecosystem stays on stable releases.

- composer global link ../src/Laravel --permanent
+ composer global link ../ --working-directory=$(pwd) --permanent

Verification

Reproduced both the failure and the fix locally (composer dry-run) against an untagged checkout (PR-like), confirming source resolution:

package before (link subdir) after (link root)
api-platform/laravel 5.0.x-dev (working tree) dev-main (working tree)
api-platform/metadata v4.3.15 (packagist) dev-main (working tree)
api-platform/state v4.3.15 (packagist) dev-main (working tree)
laravel/framework stable stable

Targets 4.3 to propagate up to 4.4 and main. pmu needs no change — the job linked the wrong directory.

…orking tree

`composer global link ../src/Laravel` pointed pmu at the laravel subdir, so
only api-platform/laravel got a path repo. The sibling packages (metadata,
state, ...) fell back to packagist, where pmu's `@dev` constraint rewrite plus
`prefer-stable` selected the top stable release (v4.3.15) — predating
SortFilterInterface and crashing OrderFilter at runtime.

Linking the monorepo root registers path repos for every split package; path
repos win over packagist even under prefer-stable, so all api-platform/*
resolve from the working tree while the Laravel ecosystem stays on stable.
@soyuka soyuka merged commit f1f33ca into api-platform:4.3 Jun 29, 2026
110 of 112 checks passed
@soyuka soyuka deleted the fix/laravel-e2e-link-root branch June 29, 2026 15:09
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.

1 participant