Skip to content

PRE-3864: Test Sylius 2.1 and 2.2 on Symfony 6.4 and 7.4 in CI and drop Sylius 2.0 support - #343

Draft
jhoaraupp wants to merge 2 commits into
developfrom
feature/PRE-3864
Draft

jhoaraupp wants to merge 2 commits into
developfrom
feature/PRE-3864

Conversation

@jhoaraupp

@jhoaraupp jhoaraupp commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

The PHPUnit matrix now installs the Sylius and Symfony versions written in each cell's label and prints them in the log. Sylius 2.0 support is dropped (sylius/sylius ^2.0 → ^2.1). Only CI, build files and docs change. No PHP code changes.

Two commits:

  • 2c79feb: matrix, pins, show-versions, Sylius 2.0 drop, 2.1 advisory ignore in CI, Symfony 7.3 → 7.4.
  • 9289db4: webpack cap for the Sylius 2.1 test-application build.

Motivation: the cells labelled "Sylius 2.0.0" and "Sylius 2.1.0" all installed Sylius 2.2.x, so 2.0, 2.1 and Symfony 6.4 were never tested. Run 40897039497 shows Sylius 2.2.12 in every cell. The root causes and every later problem are listed under "Problems found and fixes" below.

What changes

  • Makefile (2c79feb):

    • sylius/sylius:"~X.Y.0" and sylius/test-application:"~X.Y.0-alpha@alpha", where X.Y comes from SYLIUS_VERSION. The label means "latest patch of that minor".
    • Symfony is pinned with ~${SYMFONY_VERSION}.0.
    • New show-versions target (PHP version, then sylius/sylius, sylius/test-application, symfony/framework-bundle). It runs right after composer require.
    • For Sylius 2.1 only: the audit.ignore for sylius/sylius, set before the require and removed right after.
  • Makefile (9289db4): for Sylius 2.1 only, a yarn resolutions cap webpack: ">=5.72 <5.109" is written into vendor/sylius/test-application/package.json.dist before composer test-application:install. The 2.1-only conditional is renamed SYLIUS_2_1 and shared by both 2.1 steps.

  • New local reusable workflow .github/workflows/phpunit-matrix.yml, called by ci.yml (job sylius-matrix) and release.yml (job phpunit). payplug/template-ci is not modified. sylius_phpunit.yml has no exclude input, so PHP 8.4 gets its own job.

    Job PHP Sylius Symfony Cells
    php-8-2 8.2 2.1.0, 2.2.0 6.4, 7.4 4
    php-8-4 8.4 2.2.0 7.4 1
  • Coverage job: PHP 8.2 / Sylius 2.1.0 / Symfony 7.4. The install line, cache key and comment were updated (it used to be 7.3, which in practice installed 2.2.x).

  • Sylius 2.0 dropped (merchant-facing):

    • composer.json: sylius/sylius ^2.1.
    • composer.lock: content-hash line only, no package changes.
    • CHANGELOG.md, under ### Changed: "Dropped support for Sylius 2.0: requires Sylius 2.1 or later".
    • README.md compatibility table and .github/copilot-instructions.md updated to match.
  • composer.json Symfony constraints (^6.4 || ^7.2) are unchanged, so 7.2 and 7.3 stay declared but untested.

Related issue(s): Ticket: PRE-3864


Problems found and fixes

  1. Every cell installed Sylius 2.2.x.
    • Cause: make install required sylius/sylius:"<2.3", which has no lower bound, so Composer always took the newest 2.2.x (run 40897039497: 2.2.12 in every cell).
    • Fix: sylius/sylius:"~X.Y.0", with the minor taken from SYLIUS_VERSION (latest patch of that minor).
  2. Sylius 2.0 test-application pre-releases excluded.
    • Cause: sylius/test-application:">=${SYLIUS_VERSION},<2.3@alpha" excluded 2.0.0-ALPHA.x, because pre-releases sort below 2.0.0.
    • Fix: ~X.Y.0-alpha@alpha (resolves v2.1.0-ALPHA.6 and v2.2.0-ALPHA.1).
  3. Symfony caret pin.
    • Cause: extra.symfony.require "^X.Y" let a "7.3" cell install 7.4. The matrix also passed only ["7.3"], so Symfony 6.4 was never built.
    • Fix: ~X.Y.0, and the matrix covers 6.4 and 7.4.
  4. Sylius 2.0 dropped.
    • Cause 1: every sylius/sylius 2.0.x (up to 2.0.18) requires doctrine/orm ^2.18, which conflicts with the plugin's doctrine/orm >=3.5 <3.7. Resolver dry-run: exit 2 even with the advisories ignored.
    • Cause 2: every 2.0.x is blocked by advisories that were never patched in 2.0.
    • Fix: composer.json ^2.1, lock content-hash refreshed, CHANGELOG entry, README and copilot-instructions updated.
  5. Sylius 2.1 blocked by Composer's advisory policy.
    • Cause: Composer 2.9+ refuses every 2.1.x. The latest, 2.1.17, is affected by PKSA-4j8y-7y7g-12nz, PKSA-4bv5-whyg-w8m1 and PKSA-9hkr-rfsw-bmqz (2026-11-18, >=2.1.0,<2.2.0, no 2.1 fix; Sylius 2.1 is out of security support).
    • Fix: when SYLIUS_VERSION is 2.1.x only, config.audit.ignore ["sylius/sylius"] is set before composer require and removed with composer config --unset audit right after; the require exit status is kept.
    • 2.2 cells get no ignore (2.2.13 is patched), so new 2.2 advisories still block CI.
    • Why audit.ignore: policy.advisories.ignore fails on Composer 2.9, while audit.ignore works on 2.8 to 2.11. It only affects sylius/sylius, and set + unset leaves composer.json byte for byte unchanged.
  6. Symfony 7.3 replaced by 7.4.
    • Cause: no 7.3.x can be installed. Every 7.3.x is blocked by advisories (symfony/validator, symfony/web-profiler-bundle, symfony/config), and sylius/refund-plugin 2.2.1 requires symfony/messenger ^6.4 || ^7.4 || ^8.0.
    • Fix: the matrix and Coverage use 7.4.
  7. show-versions ordering.
    • Cause: the versions block printed after test-application:install, so a failure there hid the installed versions.
    • Fix: it runs right after composer require, and only if the require succeeded.
  8. webpack on Sylius 2.1 (9289db4; failure seen on run 45351270063).
    • Symptom: the 2.1 cells and Coverage failed in composer test-application:install → yarn build (encore dev) with Cannot find module 'webpack/lib/dependencies/LoaderDependency', thrown by the @symfony/stimulus-bridge loader on controllers.merged.shop.json / controllers.merged.admin.json.
    • Cause:
      • Sylius v2.1.17's src/Sylius/Bundle/{Admin,Shop}Bundle/package.json declare "webpack": "^5.72"; v2.2.13 declares ">=5.72 <5.109".
      • test-application v2.1.0-ALPHA.6 and v2.2.0-ALPHA.1 have identical package.json and scripts/merge-plugin-dependencies.js.
      • There is no yarn lockfile, so yarn classic 1.22.22 (the runner's) resolved the newest webpack, and 5.109+ breaks the stimulus-bridge loader.
    • Reproduction (Docker, node 20.20.2, yarn 1.22.22, the same tags plus symfony/ux-autocomplete and ux-live-component v2.36.3):
      • without the cap: webpack 5.113.0, the identical error, build exit 1;
      • with the cap: webpack 5.108.4 (the only copy), all 4 configs compile, build exit 0.
    • Fix: the same cap Sylius 2.2 ships, >=5.72 <5.109, as a yarn resolutions entry written into the test-application's package.json.dist, for 2.1 only.
      • It goes into package.json.dist because the preinstall script rebuilds package.json from it.
      • The plugin's tests/TestApplication/package.json only contributes dependencies, so a resolutions key there would be dropped.
      • vendor/ is gitignored, so this edit can't be committed by mistake.
  9. Required status check names changed. The PHPUnit checks are now nested under the local workflow (sylius-matrix / php-8-2 / …, sylius-matrix / php-8-4 / …). A repo admin has to update the required checks on develop (see Notes for Reviewer).

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue) [x] (the CI matrix tested Sylius 2.2 under every label)
  • ✨ New feature (non-breaking change that adds functionality) [ ]
  • 💥 Breaking change (fix or feature that causes existing functionality to change and that could impact other libs) [ ]
  • 🔧 Refactor (no functional changes, code improvement only) [ ]
  • 📦 Dependency update [x] (sylius/sylius ^2.0 → ^2.1)
  • 🔒 Security fix [ ]
  • 📝 Documentation update [x] (README compatibility table, CHANGELOG)

Breaking change is left unticked: no released version of the plugin supports Sylius 2.0 (2.0.0 is still Unreleased). Merchants installing 2.0.0 will need Sylius 2.1 or later.


Checklist

Code Quality

  • Code is linted and formatted (actionlint on the 3 workflows: 0 new findings; composer validate --strict passes; the quality job, with composer validate, ECS and PHPStan, passes on run 45353915696)
  • No unnecessary commented-out code or debug logs
  • No hardcoded values (use env variables or config)

Testing

  • Unit tests added / updated (N/A: Makefile and workflows only, no unit-test harness for them. See Testing notes)
  • New/changed code is covered by tests — SonarCloud Quality Gate (coverage on new code) passes on the sonarcloud CI job

Security & Ops

  • No sensitive data or secrets introduced
  • Logging and error handling are appropriate (show-versions fails the step if a package is missing; the require exit status is kept after the audit unset; a failing webpack cap stops make before test-application:install)

Testing notes

CI results: run 45353915696 (head 9289db4)

Job Result Installed (from show-versions) PHPUnit
quality / PHP Quality ✅ pass n/a n/a
sylius-matrix / php-8-2 / PHPUnit (PHP 8.2 Sylius 2.1.0 Symfony 6.4) ✅ pass PHP 8.2.36, sylius v2.1.17, test-application v2.1.0-ALPHA.6, framework-bundle v6.4.49 OK (1160 tests, 2656 assertions)
sylius-matrix / php-8-2 / PHPUnit (PHP 8.2 Sylius 2.1.0 Symfony 7.4) ✅ pass PHP 8.2.36, v2.1.17, v2.1.0-ALPHA.6, v7.4.23 OK (1160 tests, 2656 assertions)
sylius-matrix / php-8-2 / PHPUnit (PHP 8.2 Sylius 2.2.0 Symfony 6.4) ✅ pass PHP 8.2.36, v2.2.13, v2.2.0-ALPHA.1, v6.4.49 OK (1160 tests, 2656 assertions)
sylius-matrix / php-8-2 / PHPUnit (PHP 8.2 Sylius 2.2.0 Symfony 7.4) ✅ pass PHP 8.2.36, v2.2.13, v2.2.0-ALPHA.1, v7.4.23 OK (1160 tests, 2656 assertions)
sylius-matrix / php-8-4 / PHPUnit (PHP 8.4 Sylius 2.2.0 Symfony 7.4) ✅ pass PHP 8.4.28, v2.2.13, v2.2.0-ALPHA.1, v7.4.23 OK (1160 tests, 2656 assertions)
Coverage ✅ pass PHP 8.2.36, v2.1.17, v2.1.0-ALPHA.6, v7.4.23 OK (1160 tests, 2656 assertions), Clover report generated
  • Every cell installs the versions in its label.
  • The first composer install from the lock (locked sylius/sylius v2.2.10, which has advisories) is not blocked.
  • The earlier run 45351270063 (head 2c79feb) failed on the webpack problem on the 2.1 cells and Coverage (item 8). Resolved by 9289db4.

Automated, local (Docker; host PHP is 7.4)

Check Command Exit Result
Makefile, 4 combos make -n install -e SYLIUS_VERSION=2.1.0|2.2.0 SYMFONY_VERSION=6.4|7.4 0 each pins as expected; audit ignore and webpack cap only on 2.1; show-versions before test-application:install
Recipe with a stub composer, 5 scenarios make install-sylius COMPOSER=<stub> (scratch copy of the Makefile) see right 2.1 require fails: exit 2, unset runs, nothing after. 2.1 passes: exit 0, set → require → unset → show → cap → install. 2.2 fails: exit 2, no audit. 2.2 passes: exit 0, no audit, no cap. 2.1 with package.json.dist missing: exit 2 before test-application:install
webpack reproduction Docker node:20, yarn install + yarn build on the 2.1 test application 1 without cap, 0 with cap webpack 5.113.0 → 5.108.4 (item 8)
show-versions, real vendor make show-versions (PHP 8.5 container, repo read-only) 0 prints PHP and the 3 package versions
YAML parse python3 -c 'import yaml…' on the 3 workflows 0 5 cells; needs targets unchanged
actionlint 1.7.12 actionlint on the 3 workflows 1 0 new findings; 1 SC2086 info on the untouched coverage cache step, also on develop
composer validate composer validate --strict (container) 0 valid, lock up to date

Resolver dry-run per cell: Composer 2.11.2 with the plugin's composer.json and composer.lock, symfony/flex loaded, platform.php per cell, the Makefile's sequence, composer require --dev --dry-run -W.

PHP · Sylius · Symfony Advisory ignore Exit sylius/sylius test-application framework-bundle
8.2 · 2.1 · 6.4 yes 0 v2.1.17 v2.1.0-ALPHA.6 v6.4.49
8.2 · 2.1 · 7.4 (also Coverage) yes 0 v2.1.17 v2.1.0-ALPHA.6 v7.4.23
8.2 · 2.2 · 6.4 no 0 v2.2.13 v2.2.0-ALPHA.1 v6.4.49
8.2 · 2.2 · 7.4 no 0 v2.2.13 v2.2.0-ALPHA.1 v7.4.23
8.4 · 2.2 · 7.4 no 0 v2.2.13 v2.2.0-ALPHA.1 v7.4.23

Controls:

  • 2.1 without the ignore: exit 2 (advisory block) on Composer 2.11 and 2.9.
  • 2.1 × 7.4 with the ignore on Composer 2.9.8: exit 0.
  • Sylius 2.0, even with the ignore: exit 2 (doctrine/orm ^2.18 conflict).

Manual tests: none run (CI-only change).

Not tested locally: PHPUnit, PHPStan, ECS, Behat. No PHP changed and the local vendor/ is out of date; the CI results above cover PHPUnit, ECS and PHPStan.

Notes for Reviewer

  • Admin action before merge: the PHPUnit check names changed. Old names looked like sylius-matrix / PHPUnit (PHP 8.2 Sylius 2.0.0 Symfony 7.3). New names, confirmed on run 45353915696:

    • sylius-matrix / php-8-2 / PHPUnit (PHP 8.2 Sylius 2.1.0 Symfony 6.4)
    • sylius-matrix / php-8-2 / PHPUnit (PHP 8.2 Sylius 2.1.0 Symfony 7.4)
    • sylius-matrix / php-8-2 / PHPUnit (PHP 8.2 Sylius 2.2.0 Symfony 6.4)
    • sylius-matrix / php-8-2 / PHPUnit (PHP 8.2 Sylius 2.2.0 Symfony 7.4)
    • sylius-matrix / php-8-4 / PHPUnit (PHP 8.4 Sylius 2.2.0 Symfony 7.4)

    If branch protection on develop requires the old names, a repo admin must update it, or merges stay blocked waiting for checks that never report. I could not read the current required checks (no access).

  • Sonar numbers: Coverage now really runs on Sylius 2.1 / Symfony 7.4 (before, it silently ran on 2.2.x), so coverage numbers may move.

  • release.yml calls the same local workflow, but it only runs on the next *-rc* tag, so it is not exercised by this PR.

  • CI on this PR (base develop): quality (composer validate, ECS, PHPStan), sylius-matrix (5 cells), Coverage (JS tests + PHPUnit with PCOV), sonarcloud (quality gate enforced).

  • Local make install still rewrites composer.json (extra.symfony.require and the Sylius constraints), as it did before. The audit ignore leaves nothing behind. The 2.1 webpack cap only edits vendor/sylius/test-application/package.json.dist (gitignored).

  • Impact: PHP floor unchanged (^8.2). No UPC impact. No upgrade script. Sylius 2.3 is still not supported: it drops knp-gaufrette-bundle, which sylius/refund-plugin still loads.

🤖 Generated with Claude Code

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