From 0687ae3b5976aa8564520eca5cff559b5c7a7ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 12:00:35 +0200 Subject: [PATCH 01/20] OP-273 - remove sylius 1.11 config files --- .../config/sylius/1.11/bundles.php | 7 ---- .../sylius/1.11/packages/swiftmailer.yaml | 2 - .../1.11/packages/test/swiftmailer.yaml | 6 --- .../packages/test_cached/swiftmailer.yaml | 6 --- tests/Application/package.json.~1.11.0.dist | 41 ------------------- 5 files changed, 62 deletions(-) delete mode 100644 tests/Application/config/sylius/1.11/bundles.php delete mode 100644 tests/Application/config/sylius/1.11/packages/swiftmailer.yaml delete mode 100644 tests/Application/config/sylius/1.11/packages/test/swiftmailer.yaml delete mode 100644 tests/Application/config/sylius/1.11/packages/test_cached/swiftmailer.yaml delete mode 100755 tests/Application/package.json.~1.11.0.dist diff --git a/tests/Application/config/sylius/1.11/bundles.php b/tests/Application/config/sylius/1.11/bundles.php deleted file mode 100644 index b8da49fb..00000000 --- a/tests/Application/config/sylius/1.11/bundles.php +++ /dev/null @@ -1,7 +0,0 @@ - ['all' => true], -]; diff --git a/tests/Application/config/sylius/1.11/packages/swiftmailer.yaml b/tests/Application/config/sylius/1.11/packages/swiftmailer.yaml deleted file mode 100644 index 80d780cc..00000000 --- a/tests/Application/config/sylius/1.11/packages/swiftmailer.yaml +++ /dev/null @@ -1,2 +0,0 @@ -swiftmailer: - url: '%env(MAILER_URL)' \ No newline at end of file diff --git a/tests/Application/config/sylius/1.11/packages/test/swiftmailer.yaml b/tests/Application/config/sylius/1.11/packages/test/swiftmailer.yaml deleted file mode 100644 index cf16fdfe..00000000 --- a/tests/Application/config/sylius/1.11/packages/test/swiftmailer.yaml +++ /dev/null @@ -1,6 +0,0 @@ -swiftmailer: - disable_delivery: true - logging: true - spool: - type: file - path: "%kernel.cache_dir%/spool" \ No newline at end of file diff --git a/tests/Application/config/sylius/1.11/packages/test_cached/swiftmailer.yaml b/tests/Application/config/sylius/1.11/packages/test_cached/swiftmailer.yaml deleted file mode 100644 index cf16fdfe..00000000 --- a/tests/Application/config/sylius/1.11/packages/test_cached/swiftmailer.yaml +++ /dev/null @@ -1,6 +0,0 @@ -swiftmailer: - disable_delivery: true - logging: true - spool: - type: file - path: "%kernel.cache_dir%/spool" \ No newline at end of file diff --git a/tests/Application/package.json.~1.11.0.dist b/tests/Application/package.json.~1.11.0.dist deleted file mode 100755 index 9ca35627..00000000 --- a/tests/Application/package.json.~1.11.0.dist +++ /dev/null @@ -1,41 +0,0 @@ -{ - "dependencies": { - "@babel/polyfill": "^7.0.0", - "chart.js": "^2.9.3", - "jquery": "^3.5.0", - "jquery.dirtyforms": "^2.0.0", - "lightbox2": "^2.9.0", - "semantic-ui-css": "^2.2.0", - "slick-carousel": "^1.8.1" - }, - "devDependencies": { - "@symfony/webpack-encore": "^1.6.1", - "babel-core": "^6.26.3", - "babel-plugin-external-helpers": "^6.22.0", - "babel-plugin-module-resolver": "^3.1.1", - "babel-plugin-transform-object-rest-spread": "^6.26.0", - "babel-preset-env": "^1.7.0", - "babel-register": "^6.26.0", - "dedent": "^0.7.0", - "eslint": "^4.19.1", - "eslint-config-airbnb-base": "^12.1.0", - "eslint-import-resolver-babel-module": "^4.0.0", - "eslint-plugin-import": "^2.11.0", - "merge-stream": "^1.0.0", - "sass": "^1.39.2", - "sass-loader": "^12.1.0" - }, - "scripts": { - "dev": "yarn encore dev", - "watch": "yarn encore dev --watch", - "prod": "yarn encore prod", - "lint": "yarn lint:js", - "lint:js": "eslint gulpfile.babel.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Sylius/Sylius.git" - }, - "author": "Paweł Jędrzejewski", - "license": "MIT" -} From c16b94a286575c92cc643240b949c843387baf54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 12:16:24 +0200 Subject: [PATCH 02/20] OP-273 - add missing changes from sylius upgrade guide --- src/Resources/config/services/transformer.xml | 2 +- tests/Application/config/packages/security.yaml | 10 +++++----- tests/Behat/Resources/services/contexts/setup.xml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Resources/config/services/transformer.xml b/src/Resources/config/services/transformer.xml index 0f91bfc7..bf5a3338 100644 --- a/src/Resources/config/services/transformer.xml +++ b/src/Resources/config/services/transformer.xml @@ -5,7 +5,7 @@ - + diff --git a/tests/Application/config/packages/security.yaml b/tests/Application/config/packages/security.yaml index 4ed342f8..c81f04ba 100644 --- a/tests/Application/config/packages/security.yaml +++ b/tests/Application/config/packages/security.yaml @@ -45,7 +45,7 @@ security: stateless: true entry_point: jwt json_login: - check_path: "%sylius.security.new_api_admin_route%/authentication-token" + check_path: "%sylius.security.new_api_admin_route%/administrators/token" username_path: email password_path: password success_handler: lexik_jwt_authentication.handler.authentication_success @@ -58,7 +58,7 @@ security: stateless: true entry_point: jwt json_login: - check_path: "%sylius.security.new_api_shop_route%/authentication-token" + check_path: "%sylius.security.new_api_shop_route%/customers/token" username_path: email password_path: password success_handler: lexik_jwt_authentication.handler.authentication_success @@ -116,9 +116,9 @@ security: - { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS } - { path: "%sylius.security.shop_regex%/account", role: ROLE_USER } - - { path: "%sylius.security.new_api_admin_route%/reset-password-requests", role: PUBLIC_ACCESS } + - { path: "%sylius.security.new_api_admin_route%/administrators/reset-password", role: PUBLIC_ACCESS } - { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS } - - { path: "%sylius.security.new_api_admin_route%/authentication-token", role: PUBLIC_ACCESS } + - { path: "%sylius.security.new_api_admin_route%/administrators/token", role: PUBLIC_ACCESS } - { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER } - - { path: "%sylius.security.new_api_shop_route%/authentication-token", role: PUBLIC_ACCESS } + - { path: "%sylius.security.new_api_shop_route%/customers/token", role: PUBLIC_ACCESS } - { path: "%sylius.security.new_api_shop_regex%/.*", role: PUBLIC_ACCESS } diff --git a/tests/Behat/Resources/services/contexts/setup.xml b/tests/Behat/Resources/services/contexts/setup.xml index 5bbd17ca..da958078 100644 --- a/tests/Behat/Resources/services/contexts/setup.xml +++ b/tests/Behat/Resources/services/contexts/setup.xml @@ -12,7 +12,7 @@ - + From f3a3c6e9ff0dbc0c36de9e4340b49f07e81543e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 12:16:47 +0200 Subject: [PATCH 03/20] OP-273 - set package.json.1.13 as default packages.json --- .../{package.json.1.13.x-dev as 1.13.0.dist => package.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/Application/{package.json.1.13.x-dev as 1.13.0.dist => package.json} (100%) diff --git a/tests/Application/package.json.1.13.x-dev as 1.13.0.dist b/tests/Application/package.json similarity index 100% rename from tests/Application/package.json.1.13.x-dev as 1.13.0.dist rename to tests/Application/package.json From ff8f78a7817ecd8f5f89cdd70cacde3b5241acc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 12:17:43 +0200 Subject: [PATCH 04/20] OP-273 - order composer packages in alphabetical order, remove sylius 1.11 support, update dependencies --- composer.json | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 91ee9ae8..00e1ad6d 100644 --- a/composer.json +++ b/composer.json @@ -6,8 +6,8 @@ "require": { "ext-json": "*", "php": "^8.0", - "sylius/sylius": "~1.11.0 || >=1.12.13 || ~1.13.0", "friendsofsymfony/elastica-bundle": "^6.0", + "sylius/sylius": ">=1.12.13 || ~1.13.0", "symfony/property-access": "^5.4 || ^6.0", "symfony/webpack-encore-bundle": "^1.16", "symfony/proxy-manager-bridge": "^5.4 || ^6.0" @@ -15,6 +15,7 @@ "require-dev": { "behat/behat": "^3.7", "behat/mink-selenium2-driver": "~1.6.0", + "bitbag/coding-standard": "^1.0.1", "dmore/behat-chrome-extension": "^1.3", "dmore/chrome-mink-driver": "^2.7", "friends-of-behat/mink": "^1.8", @@ -25,32 +26,30 @@ "friends-of-behat/suite-settings-extension": "^1.0", "friends-of-behat/symfony-extension": "^2.1", "friends-of-behat/variadic-extension": "^1.3", - "phpspec/phpspec": "^7.0", + "league/flysystem-bundle": "2.4.0", + "lchrusciel/api-test-case": "^5.2", + "phpspec/phpspec": "^7.2", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "0.12.82", "phpstan/phpstan-doctrine": "0.12.33", "phpstan/phpstan-strict-rules": "^0.12.0", "phpstan/phpstan-webmozart-assert": "0.12.12", "phpunit/phpunit": "^9.5", - "sylius-labs/coding-standard": "^4.0", + "polishsymfonycommunity/symfony-mocker-container": "^1.0", + "sylius-labs/coding-standard": "^4.2", + "sylius/mailer-bundle": "^1.8 || ^2.0@beta", "symfony/browser-kit": "^5.4 || ^6.0", "symfony/debug-bundle": "^5.4 || ^6.0", "symfony/dotenv": "^5.4 || ^6.0", + "symfony/flex": "^2.2.2", "symfony/intl": "^5.4 || ^6.0", - "symfony/web-profiler-bundle": "^5.4 || ^6.0", - "vimeo/psalm": "4.27.0", - "bitbag/coding-standard": "^1.0.1", - "league/flysystem-bundle": "2.4.0", - "polishsymfonycommunity/symfony-mocker-container": "^1.0", - "lchrusciel/api-test-case": "^5.2", "symfony/mailer": "^5.4 || ^6.0", - "sylius/mailer-bundle": "^1.8 || ^2.0@beta", - "twig/extra-bundle": "^3.4" + "symfony/web-profiler-bundle": "^5.4 || ^6.0", + "twig/extra-bundle": "^3.4", + "vimeo/psalm": "4.27.0" }, "conflict": { - "symfony/form": "4.4.11 || 4.4.12", - "api-platform/core": "v2.7.17", - "sylius/sylius": ">= 1.12.0 < 1.12.13" + "api-platform/core": "v2.7.17" }, "autoload": { "psr-4": { From 15a8605e8c9bd58cd28761e2cb3461ba46c285d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 12:33:04 +0200 Subject: [PATCH 05/20] OP-273 - update composer.json --- composer.json | 61 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/composer.json b/composer.json index 00e1ad6d..58a97eb6 100644 --- a/composer.json +++ b/composer.json @@ -9,13 +9,14 @@ "friendsofsymfony/elastica-bundle": "^6.0", "sylius/sylius": ">=1.12.13 || ~1.13.0", "symfony/property-access": "^5.4 || ^6.0", - "symfony/webpack-encore-bundle": "^1.16", + "symfony/webpack-encore-bundle": "^1.15", "symfony/proxy-manager-bridge": "^5.4 || ^6.0" }, "require-dev": { - "behat/behat": "^3.7", - "behat/mink-selenium2-driver": "~1.6.0", + "behat/behat": "^3.6.1", + "behat/mink-selenium2-driver": "^1.4", "bitbag/coding-standard": "^1.0.1", + "dbrekelmans/bdi": "^1.1", "dmore/behat-chrome-extension": "^1.3", "dmore/chrome-mink-driver": "^2.7", "friends-of-behat/mink": "^1.8", @@ -30,26 +31,43 @@ "lchrusciel/api-test-case": "^5.2", "phpspec/phpspec": "^7.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "0.12.82", - "phpstan/phpstan-doctrine": "0.12.33", - "phpstan/phpstan-strict-rules": "^0.12.0", - "phpstan/phpstan-webmozart-assert": "0.12.12", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^1.8.1", + "phpstan/phpstan-doctrine": "1.3.69", + "phpstan/phpstan-strict-rules": "^1.3.0", + "phpstan/phpstan-webmozart-assert": "^1.2.0", + "phpunit/phpunit": "^10.5", "polishsymfonycommunity/symfony-mocker-container": "^1.0", + "robertfausk/behat-panther-extension": "^1.1", "sylius-labs/coding-standard": "^4.2", - "sylius/mailer-bundle": "^1.8 || ^2.0@beta", + "sylius-labs/suite-tags-extension": "^0.2", "symfony/browser-kit": "^5.4 || ^6.0", "symfony/debug-bundle": "^5.4 || ^6.0", "symfony/dotenv": "^5.4 || ^6.0", - "symfony/flex": "^2.2.2", + "symfony/flex": "^2.4", "symfony/intl": "^5.4 || ^6.0", - "symfony/mailer": "^5.4 || ^6.0", - "symfony/web-profiler-bundle": "^5.4 || ^6.0", - "twig/extra-bundle": "^3.4", - "vimeo/psalm": "4.27.0" + "symfony/web-profiler-bundle": "^5.4 || ^6.0" }, "conflict": { - "api-platform/core": "v2.7.17" + "api-platform/core": "v2.7.17", + "symfony/framework-bundle": "6.2.8" + }, + "config": { + "sort-packages": true, + "allow-plugins": { + "composer/package-versions-deprecated": true, + "dealerdirect/phpcodesniffer-composer-installer": false, + "phpstan/extension-installer": true, + "symfony/flex": true, + "symfony/thanks": true + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.13-dev" + }, + "symfony": { + "require": "^5.4 || ^6.0" + } }, "autoload": { "psr-4": { @@ -74,14 +92,11 @@ ], "post-create-project-cmd": [ "php bin/create_node_symlink.php" - ] - }, - "config": { - "allow-plugins": { - "symfony/thanks": true, - "composer/package-versions-deprecated": true, - "dealerdirect/phpcodesniffer-composer-installer": true, - "phpstan/extension-installer": true + ], + "auto-scripts": { + "cache:clear": "symfony-cmd", + "assets:install %PUBLIC_DIR%": "symfony-cmd", + "security-checker security:check": "script" } } } From fdc021f36da5d30d76a13716872147f1333280a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 12:36:01 +0200 Subject: [PATCH 06/20] update symfony workflow build --- .github/workflows/build.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f930ed8d..22afe337 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,22 +14,18 @@ on: jobs: tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}" strategy: fail-fast: false matrix: - php: ["8.1"] - symfony: ["^5.4", "^6.0"] - sylius: ["~1.11.0", "~1.12.0", "1.13.x-dev as 1.13.0"] - node: ["14.x"] - mysql: ["8.0.36"] - - exclude: - - sylius: ~1.11.0 - symfony: "^6.0" + php: [ "8.0", "8.1", "8.2", "8.3" ] + symfony: [ "5.4.*", "^6.0" ] + sylius: [ "^1.12", "^1.13" ] + node: [ "14.x", "16.x", "18.x" ] + mysql: [ "5.7", "8.0" ] env: APP_ENV: test DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}" From fa1bb7f0e00218e5504bfa98d758f596c13842e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 12:37:52 +0200 Subject: [PATCH 07/20] upgrade bitbag coding standard package --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 58a97eb6..ae074860 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "require-dev": { "behat/behat": "^3.6.1", "behat/mink-selenium2-driver": "^1.4", - "bitbag/coding-standard": "^1.0.1", + "bitbag/coding-standard": "^v3.0.0", "dbrekelmans/bdi": "^1.1", "dmore/behat-chrome-extension": "^1.3", "dmore/chrome-mink-driver": "^2.7", From 08826277ee2dd86cab5660e3a9249a1b1084ac29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 12:39:51 +0200 Subject: [PATCH 08/20] fix gh action build configuration --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22afe337..8e65dbf7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,10 +21,10 @@ jobs: strategy: fail-fast: false matrix: - php: [ "8.0", "8.1", "8.2", "8.3" ] - symfony: [ "5.4.*", "^6.0" ] + php: [ "8.1", "8.2", "8.3" ] + symfony: [ "^5.4", "^6.0" ] sylius: [ "^1.12", "^1.13" ] - node: [ "14.x", "16.x", "18.x" ] + node: [ "18.x", "20.x" ] mysql: [ "5.7", "8.0" ] env: APP_ENV: test From 0f3f41bade88edccd17c759319f947a456a26ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 12:46:23 +0200 Subject: [PATCH 09/20] fix gh action config --- .github/workflows/build.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e65dbf7..b2011d6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -135,10 +135,10 @@ jobs: restore-keys: | ${{ runner.os }}-node-${{ matrix.node }}-yarn- - - - name: Copy package.json.dist to package.json - if: matrix.sylius != '' - run: (cd tests/Application && cp "package.json.${{ matrix.sylius }}.dist" package.json) +# - +# name: Copy package.json.dist to package.json +# if: matrix.sylius != '' +# run: (cd tests/Application && cp "package.json.${{ matrix.sylius }}.dist" package.json) - name: Install JS dependencies @@ -166,7 +166,6 @@ jobs: - name: Validate composer.json - if: ${{ matrix.sylius != '1.13.x-dev as 1.13.0' }} run: composer validate --ansi --strict - @@ -182,12 +181,10 @@ jobs: - name: Run Behat - if: ${{ matrix.sylius != '1.13.x-dev as 1.13.0' }} run: vendor/bin/behat --colors --strict -vvv --no-interaction --tags '~@sylius113' || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun --tags '~@sylius113' - name: Run Behat - if: ${{ matrix.sylius == '1.13.x-dev as 1.13.0' }} run: vendor/bin/behat --colors --strict -vvv --no-interaction --tags '~@sylius112' || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun --tags '~@sylius112' From f0f53dd2cd32439f3acfbc5bbea24638e4ade08b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 12:59:10 +0200 Subject: [PATCH 10/20] OP-273 - temporary disable gh action on push --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b2011d6f..9ad1c3ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,9 @@ name: Build on: - push: - branches-ignore: - - 'dependabot/**' +# push: +# branches-ignore: +# - 'dependabot/**' pull_request: ~ release: types: [created] From cfd10d1437d7faf8a7c2e7bcdcd1b0b7128ef171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 12:59:30 +0200 Subject: [PATCH 11/20] OP-273 - downgrade bitbag coding standards package --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ae074860..8fb443b0 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "require-dev": { "behat/behat": "^3.6.1", "behat/mink-selenium2-driver": "^1.4", - "bitbag/coding-standard": "^v3.0.0", + "bitbag/coding-standard": "^v2.0", "dbrekelmans/bdi": "^1.1", "dmore/behat-chrome-extension": "^1.3", "dmore/chrome-mink-driver": "^2.7", From dcf101cd236ce67888caee7a19dc4c11a6c0f4d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 12:59:48 +0200 Subject: [PATCH 12/20] OP-273 - update ecs configuration --- ecs.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ecs.php b/ecs.php index b088160e..abcfbcf8 100644 --- a/ecs.php +++ b/ecs.php @@ -2,15 +2,12 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -use Symplify\EasyCodingStandard\ValueObject\Option; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $containerConfigurator->import('vendor/bitbag/coding-standard/ecs.php'); +return static function (ECSConfig $config): void { - $parameters = $containerConfigurator->parameters(); - $parameters->set(Option::PATHS, [ - __DIR__ . '/src', - __DIR__ . '/tests', - ]); + putenv('ALLOW_BITBAG_OS_HEADER=1'); + + $config->import('vendor/bitbag/coding-standard/ecs.php'); + $config->paths(['src', 'tests']); }; From 8201327b1dc7dc71ac0cc88dc33392503cc87c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 13:00:09 +0200 Subject: [PATCH 13/20] OP-273 - fix ecs --- src/Controller/RequestDataHandler/PaginationDataHandler.php | 4 ++-- .../RequestDataHandler/ShopProductListDataHandler.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Controller/RequestDataHandler/PaginationDataHandler.php b/src/Controller/RequestDataHandler/PaginationDataHandler.php index ed3ce9c8..0a6c186d 100644 --- a/src/Controller/RequestDataHandler/PaginationDataHandler.php +++ b/src/Controller/RequestDataHandler/PaginationDataHandler.php @@ -31,7 +31,7 @@ public function retrieveData(array $requestData): array return $data; } - private function resolvePage(array $requestData, array & $data): void + private function resolvePage(array $requestData, array &$data): void { $page = 1; @@ -42,7 +42,7 @@ private function resolvePage(array $requestData, array & $data): void $data[self::PAGE_INDEX] = $page; } - private function resolveLimit(array $requestData, array & $data): void + private function resolveLimit(array $requestData, array &$data): void { $limit = $this->defaultLimit; diff --git a/src/Controller/RequestDataHandler/ShopProductListDataHandler.php b/src/Controller/RequestDataHandler/ShopProductListDataHandler.php index 55a749f3..22a8b323 100644 --- a/src/Controller/RequestDataHandler/ShopProductListDataHandler.php +++ b/src/Controller/RequestDataHandler/ShopProductListDataHandler.php @@ -71,7 +71,7 @@ public function retrieveData(array $requestData): array private function handleOptionsPrefixedProperty( array $requestData, - array & $data + array &$data ): void { if (!isset($requestData['options'])) { return; @@ -88,7 +88,7 @@ private function handleOptionsPrefixedProperty( private function handleAttributesPrefixedProperty( array $requestData, - array & $data, + array &$data, ?array $attributesDefinitions = [] ): void { if (!isset($requestData['attributes'])) { From fbde925ce3a9a54a9ec5524bbb92c66ff19113d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 13:22:18 +0200 Subject: [PATCH 14/20] OP-273 - remove symfony flex package --- composer.json | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 8fb443b0..b6d48b77 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,6 @@ "symfony/browser-kit": "^5.4 || ^6.0", "symfony/debug-bundle": "^5.4 || ^6.0", "symfony/dotenv": "^5.4 || ^6.0", - "symfony/flex": "^2.4", "symfony/intl": "^5.4 || ^6.0", "symfony/web-profiler-bundle": "^5.4 || ^6.0" }, @@ -54,11 +53,10 @@ "config": { "sort-packages": true, "allow-plugins": { + "symfony/thanks": true, "composer/package-versions-deprecated": true, - "dealerdirect/phpcodesniffer-composer-installer": false, - "phpstan/extension-installer": true, - "symfony/flex": true, - "symfony/thanks": true + "dealerdirect/phpcodesniffer-composer-installer": true, + "phpstan/extension-installer": true } }, "extra": { From ba52c27446afcfb5996b55f43082b4f2cc729e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 14:27:58 +0200 Subject: [PATCH 15/20] fix phpspec test --- spec/Controller/Action/Shop/ListProductsActionSpec.php | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/Controller/Action/Shop/ListProductsActionSpec.php b/spec/Controller/Action/Shop/ListProductsActionSpec.php index bdec5b97..30f9b070 100644 --- a/spec/Controller/Action/Shop/ListProductsActionSpec.php +++ b/spec/Controller/Action/Shop/ListProductsActionSpec.php @@ -70,6 +70,7 @@ function it_renders_product_list( ): void { $form->getData()->willReturn([]); $form->isValid()->willReturn(true); + $form->isSubmitted()->willReturn(true); $form->handleRequest($request)->willReturn($form); $form->createView()->willReturn($formView); From 028654e65d94be80fe4a2cd77ff6e3a891d1e38b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 14:33:49 +0200 Subject: [PATCH 16/20] OP-273 - add conflict with behat/mink-selenium2-driver --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b6d48b77..1a8a3399 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,8 @@ }, "conflict": { "api-platform/core": "v2.7.17", - "symfony/framework-bundle": "6.2.8" + "symfony/framework-bundle": "6.2.8", + "behat/mink-selenium2-driver": ">=1.7.0" }, "config": { "sort-packages": true, From 5d6f90973f1477e389752aa9808d50449f480d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 14:39:49 +0200 Subject: [PATCH 17/20] OP-273 - set 2 decimal digit in behat tests. Add node information in gh actions --- .github/workflows/build.yml | 2 +- .../shop/site_wide_searching_products.feature | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ad1c3ae..b31a6aed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: tests: runs-on: ubuntu-latest - name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}" + name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, Node ${{ matrix.node }}" strategy: fail-fast: false diff --git a/features/shop/site_wide_searching_products.feature b/features/shop/site_wide_searching_products.feature index 41dd6cc3..fd73933c 100644 --- a/features/shop/site_wide_searching_products.feature +++ b/features/shop/site_wide_searching_products.feature @@ -11,12 +11,12 @@ Feature: Site-wide products search And the store has a select product attribute "Car Type" with values "Cabrio" and "SUV" And the store has a select product attribute "Motorbike Type" with values "Enduro" and "Naked" And there is a product named "BMW Z4" in the store - And this product's price is "$42670" + And this product's price is "$42670.00" And this product has select attribute "Car Type" with value "Cabrio" And this product has a text attribute "Color" with value "Red" And this product has option "Supply" with values "Gasoline" and "Diesel" - And this product is available in "Gasoline" supply priced at "$42670" - And this product is available in "Diesel" supply priced at "$45670" + And this product is available in "Gasoline" supply priced at "$42670.00" + And this product is available in "Diesel" supply priced at "$45670.00" And this product belongs to "Cars" And there is a product named "Volvo XC90" in the store And this product's price is "$64505.80" @@ -24,21 +24,21 @@ Feature: Site-wide products search And this product has a text attribute "Color" with value "Black" And this product belongs to "Cars" And there is a product named "BMW 5 Series" in the store - And this product's price is "$52070" + And this product's price is "$52070.00" And this product has select attribute "Car Type" with value "Cabrio" And this product has a text attribute "Color" with value "Red" And this product belongs to "Cars" And there is a product named "Lamborghini Aventador" in the store - And this product's price is "$450000" + And this product's price is "$450000.00" And this product has a text attribute "Color" with value "Yellow" And this product belongs to "Cars" And there is a product named "BMW GS" in the store - And this product's price is "$18070" + And this product's price is "$18070.00" And this product has select attribute "Motorbike Type" with value "Enduro" And this product has a text attribute "Color" with value "Grey" And this product belongs to "Motorbikes" And there is a product named "Ducati Monster" in the store - And this product's price is "$14995" + And this product's price is "$14995.00" And this product has select attribute "Motorbike Type" with value "Naked" And this product has a text attribute "Color" with value "Black" And this product's short description is: @@ -49,7 +49,7 @@ Feature: Site-wide products search And there is a product named "Honda Africa Twin" in the store And this product has select attribute "Motorbike Type" with value "Enduro" And this product has a text attribute "Color" with value "Green & White" - And this product's price is "$13490" + And this product's price is "$13490.00" And this product's description is: """ This is the Honda Africa Twin which is like the BMW GS but from Honda. From 88ab370b5a51aebf1da679ab52bf352dddf23a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Fri, 10 May 2024 14:46:06 +0200 Subject: [PATCH 18/20] OP-273 - set thousends coma in behat scenarios. --- .../shop/site_wide_searching_products.feature | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/features/shop/site_wide_searching_products.feature b/features/shop/site_wide_searching_products.feature index fd73933c..fe712590 100644 --- a/features/shop/site_wide_searching_products.feature +++ b/features/shop/site_wide_searching_products.feature @@ -11,34 +11,34 @@ Feature: Site-wide products search And the store has a select product attribute "Car Type" with values "Cabrio" and "SUV" And the store has a select product attribute "Motorbike Type" with values "Enduro" and "Naked" And there is a product named "BMW Z4" in the store - And this product's price is "$42670.00" + And this product's price is "$42,670.00" And this product has select attribute "Car Type" with value "Cabrio" And this product has a text attribute "Color" with value "Red" And this product has option "Supply" with values "Gasoline" and "Diesel" - And this product is available in "Gasoline" supply priced at "$42670.00" - And this product is available in "Diesel" supply priced at "$45670.00" + And this product is available in "Gasoline" supply priced at "$42,670.00" + And this product is available in "Diesel" supply priced at "$45,670.00" And this product belongs to "Cars" And there is a product named "Volvo XC90" in the store - And this product's price is "$64505.80" + And this product's price is "$64,505.80" And this product has select attribute "Car Type" with value "SUV" And this product has a text attribute "Color" with value "Black" And this product belongs to "Cars" And there is a product named "BMW 5 Series" in the store - And this product's price is "$52070.00" + And this product's price is "$52,070.00" And this product has select attribute "Car Type" with value "Cabrio" And this product has a text attribute "Color" with value "Red" And this product belongs to "Cars" And there is a product named "Lamborghini Aventador" in the store - And this product's price is "$450000.00" + And this product's price is "$450,000.00" And this product has a text attribute "Color" with value "Yellow" And this product belongs to "Cars" And there is a product named "BMW GS" in the store - And this product's price is "$18070.00" + And this product's price is "$18,070.00" And this product has select attribute "Motorbike Type" with value "Enduro" And this product has a text attribute "Color" with value "Grey" And this product belongs to "Motorbikes" And there is a product named "Ducati Monster" in the store - And this product's price is "$14995.00" + And this product's price is "$14,995.00" And this product has select attribute "Motorbike Type" with value "Naked" And this product has a text attribute "Color" with value "Black" And this product's short description is: @@ -49,7 +49,7 @@ Feature: Site-wide products search And there is a product named "Honda Africa Twin" in the store And this product has select attribute "Motorbike Type" with value "Enduro" And this product has a text attribute "Color" with value "Green & White" - And this product's price is "$13490.00" + And this product's price is "$13,490.00" And this product's description is: """ This is the Honda Africa Twin which is like the BMW GS but from Honda. From d92bf536edb829b11ba81df5533d53a44ed4d7d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Mon, 13 May 2024 09:05:53 +0200 Subject: [PATCH 19/20] OP-273 - try to fix plugin on symfony 6 --- src/Model/SearchFacets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/SearchFacets.php b/src/Model/SearchFacets.php index f138cf0a..f275cf95 100644 --- a/src/Model/SearchFacets.php +++ b/src/Model/SearchFacets.php @@ -34,7 +34,7 @@ public function __set(string $facetId, $selectedBuckets) public function __isset(string $facetId) { - return isset($this->selectedBuckets[$facetId]); + return true; } /** From a45261a9edf677171f9e525bbc4f71c8d01f11af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wojda=C5=82owicz?= Date: Mon, 13 May 2024 11:40:46 +0200 Subject: [PATCH 20/20] OP-273 - restore gh actions on push --- .github/workflows/build.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b31a6aed..95be71f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,9 @@ name: Build on: -# push: -# branches-ignore: -# - 'dependabot/**' + push: + branches-ignore: + - 'dependabot/**' pull_request: ~ release: types: [created] @@ -135,11 +135,6 @@ jobs: restore-keys: | ${{ runner.os }}-node-${{ matrix.node }}-yarn- -# - -# name: Copy package.json.dist to package.json -# if: matrix.sylius != '' -# run: (cd tests/Application && cp "package.json.${{ matrix.sylius }}.dist" package.json) - - name: Install JS dependencies run: (cd tests/Application && yarn install)