From 992bdd4bc4bcc594a6725d9c7722545cfaa2100c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Fr=C3=A9mont?= Date: Wed, 24 Jun 2026 08:08:27 +0200 Subject: [PATCH] feat(php-grids): Tests with Legacy grid config # Conflicts: # .github/workflows/ci_e2e-mariadb.yaml # .github/workflows/matrix.json --- .env | 1 + .github/workflows/ci_e2e-mariadb.yaml | 6 ++- .github/workflows/matrix.json | 12 +++-- config/packages/_sylius.yaml | 72 +-------------------------- 4 files changed, 16 insertions(+), 75 deletions(-) diff --git a/.env b/.env index fda3586c51..a86f1447f6 100644 --- a/.env +++ b/.env @@ -46,3 +46,4 @@ MAILER_DSN=null://null ###< symfony/mailer ### SYLIUS_PAYMENT_ENCRYPTION_KEY_PATH=%kernel.project_dir%/config/encryption/dev.key +TEST_SYLIUS_USE_LEGACY_GRID_CONFIG=0 diff --git a/.github/workflows/ci_e2e-mariadb.yaml b/.github/workflows/ci_e2e-mariadb.yaml index d0e72bc8c5..2f5d422dce 100644 --- a/.github/workflows/ci_e2e-mariadb.yaml +++ b/.github/workflows/ci_e2e-mariadb.yaml @@ -44,7 +44,7 @@ jobs: phpunit-cli-api: needs: get-matrix runs-on: ubuntu-latest - name: "PHPUnit, CLI, API, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MariaDB ${{ matrix.mariadb }}, State Machine Adapter ${{ matrix.state_machine_adapter }}${{ matrix.doctrine_bundle && format(', DoctrineBundle {0}', matrix.doctrine_bundle) || '' }}${{ matrix.api_platform && format(', ApiPlatform {0}', matrix.api_platform) || '' }}" + name: "PHPUnit, CLI, API, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MariaDB ${{ matrix.mariadb }}, State Machine Adapter ${{ matrix.state_machine_adapter }}${{ matrix.doctrine_bundle && format(', DoctrineBundle {0}', matrix.doctrine_bundle) || '' }}${{ matrix.api_platform && format(', ApiPlatform {0}', matrix.api_platform) || '' }}${{ matrix.legacy_grid_config && format(', LegacyGridConfig {0}', matrix.legacy_grid_config) || '' }" timeout-minutes: 20 strategy: fail-fast: false @@ -53,6 +53,7 @@ jobs: env: APP_ENV: test_cached TEST_SYLIUS_STATE_MACHINE_ADAPTER: "${{ matrix.state_machine_adapter }}" + TEST_SYLIUS_USE_LEGACY_GRID_CONFIG: ${{ matrix.legacy_grid_config || true }} BEHAT_BASE_CMD: "vendor/bin/behat --colors --strict --no-interaction -vvv -f progress" BEHAT_RERUN_CMD: "vendor/bin/behat --colors --strict --no-interaction -vvv -f pretty --rerun" @@ -153,7 +154,7 @@ jobs: behat-ui: needs: get-matrix runs-on: ubuntu-latest - name: "UI, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MariaDB ${{ matrix.mariadb }}, State Machine Adapter ${{ matrix.state_machine_adapter }}${{ matrix.doctrine_bundle && format(', DoctrineBundle {0}', matrix.doctrine_bundle) || '' }}${{ matrix.api_platform && format(', ApiPlatform {0}', matrix.api_platform) || '' }}" + name: "UI, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MariaDB ${{ matrix.mariadb }}, State Machine Adapter ${{ matrix.state_machine_adapter }}${{ matrix.doctrine_bundle && format(', DoctrineBundle {0}', matrix.doctrine_bundle) || '' }}${{ matrix.api_platform && format(', ApiPlatform {0}', matrix.api_platform) || '' }}${{ matrix.legacy_grid_config && format(', LegacyGridConfig {0}', matrix.legacy_grid_config) || '' }}" timeout-minutes: 20 strategy: fail-fast: false @@ -162,6 +163,7 @@ jobs: env: APP_ENV: test_cached TEST_SYLIUS_STATE_MACHINE_ADAPTER: "${{ matrix.state_machine_adapter }}" + TEST_SYLIUS_USE_LEGACY_GRID_CONFIG: ${{ matrix.legacy_grid_config || true }} BEHAT_BASE_CMD: "vendor/bin/behat --colors --strict --no-interaction -vvv -f progress" BEHAT_RERUN_CMD: "vendor/bin/behat --colors --strict --no-interaction -vvv -f pretty --rerun" diff --git a/.github/workflows/matrix.json b/.github/workflows/matrix.json index 419200a3e4..a9837b0d92 100644 --- a/.github/workflows/matrix.json +++ b/.github/workflows/matrix.json @@ -23,14 +23,16 @@ "symfony": "~6.4.0", "mariadb": "10.11.13", "doctrine_bundle": "^2.0", - "state_machine_adapter": "winzou_state_machine" + "state_machine_adapter": "winzou_state_machine", + "legacy_grid_config": true }, { "php": "8.5", "symfony": "~7.4.0", "mariadb": "11.4.7", "doctrine_bundle": "^3.0", - "state_machine_adapter": "symfony_workflow" + "state_machine_adapter": "symfony_workflow", + "legacy_grid_config": false } ] }, @@ -166,13 +168,17 @@ "state_machine_adapter": [ "symfony_workflow" ], + "legacy_grid_config": [ + false + ], "include": [ { "php": "8.3", "symfony": "~7.4.0", "mariadb": "11.4.7", "doctrine_bundle": "^2.0", - "state_machine_adapter": "winzou_state_machine" + "state_machine_adapter": "winzou_state_machine", + "legacy_grid_config": true } ] }, diff --git a/config/packages/_sylius.yaml b/config/packages/_sylius.yaml index 5a4505b6f9..e21f092b69 100644 --- a/config/packages/_sylius.yaml +++ b/config/packages/_sylius.yaml @@ -8,80 +8,12 @@ imports: parameters: sylius_core.public_dir: '%kernel.project_dir%/public' + sylius_core.grids_configuration: + use_legacy_config: '%env(bool:TEST_SYLIUS_USE_LEGACY_GRID_CONFIG)%' sylius_api: enabled: true -sylius_core: - grid: - grids: - sylius_admin_admin_user: - use_legacy_config: false - sylius_admin_catalog_promotion: - use_legacy_config: false - sylius_admin_channel: - use_legacy_config: false - sylius_admin_channel_pricing_log_entry: - use_legacy_config: false - sylius_admin_country: - use_legacy_config: false - sylius_admin_currency: - use_legacy_config: false - sylius_admin_customer: - use_legacy_config: false - sylius_admin_customer_group: - use_legacy_config: false - sylius_admin_customer_order: - use_legacy_config: false - sylius_admin_exchange_rate: - use_legacy_config: false - sylius_admin_inventory: - use_legacy_config: false - sylius_admin_locale: - use_legacy_config: false - sylius_admin_order: - use_legacy_config: false - sylius_admin_payment: - use_legacy_config: false - sylius_admin_payment_method: - use_legacy_config: false - sylius_admin_payment_request: - use_legacy_config: false - sylius_admin_product_association_type: - use_legacy_config: false - sylius_admin_product_attribute: - use_legacy_config: false - sylius_admin_product: - use_legacy_config: false - sylius_admin_product_option: - use_legacy_config: false - sylius_admin_product_review: - use_legacy_config: false - sylius_admin_product_taxon: - use_legacy_config: false - sylius_admin_product_variant: - use_legacy_config: false - sylius_admin_product_variant_with_catalog_promotion: - use_legacy_config: false - sylius_admin_promotion: - use_legacy_config: false - sylius_admin_promotion_coupon: - use_legacy_config: false - sylius_admin_shipment: - use_legacy_config: false - sylius_admin_shipping_category: - use_legacy_config: false - sylius_admin_shipping_method: - use_legacy_config: false - sylius_admin_tax_category: - use_legacy_config: false - sylius_admin_tax_rate: - use_legacy_config: false - sylius_admin_taxon: - use_legacy_config: false - sylius_admin_zone: - use_legacy_config: false - sylius_shop: product_grid: include_all_descendants: true