Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OP-273 - Feature/sylius 1.13 update #241

Merged
merged 20 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0687ae3
OP-273 - remove sylius 1.11 config files
BartoszWojdalowicz May 10, 2024
c16b94a
OP-273 - add missing changes from sylius upgrade guide
BartoszWojdalowicz May 10, 2024
f3a3c6e
OP-273 - set package.json.1.13 as default packages.json
BartoszWojdalowicz May 10, 2024
ff8f78a
OP-273 - order composer packages in alphabetical order, remove sylius…
BartoszWojdalowicz May 10, 2024
15a8605
OP-273 - update composer.json
BartoszWojdalowicz May 10, 2024
fdc021f
update symfony workflow build
BartoszWojdalowicz May 10, 2024
fa1bb7f
upgrade bitbag coding standard package
BartoszWojdalowicz May 10, 2024
0882627
fix gh action build configuration
BartoszWojdalowicz May 10, 2024
0f3f41b
fix gh action config
BartoszWojdalowicz May 10, 2024
f0f53dd
OP-273 - temporary disable gh action on push
BartoszWojdalowicz May 10, 2024
cfd10d1
OP-273 - downgrade bitbag coding standards package
BartoszWojdalowicz May 10, 2024
dcf101c
OP-273 - update ecs configuration
BartoszWojdalowicz May 10, 2024
8201327
OP-273 - fix ecs
BartoszWojdalowicz May 10, 2024
fbde925
OP-273 - remove symfony flex package
BartoszWojdalowicz May 10, 2024
ba52c27
fix phpspec test
BartoszWojdalowicz May 10, 2024
028654e
OP-273 - add conflict with behat/mink-selenium2-driver
BartoszWojdalowicz May 10, 2024
5d6f909
OP-273 - set 2 decimal digit in behat tests. Add node information in …
BartoszWojdalowicz May 10, 2024
88ab370
OP-273 - set thousends coma in behat scenarios.
BartoszWojdalowicz May 10, 2024
d92bf53
OP-273 - try to fix plugin on symfony 6
BartoszWojdalowicz May 13, 2024
a45261a
OP-273 - restore gh actions on push
BartoszWojdalowicz May 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, Node ${{ matrix.node }}"

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.1", "8.2", "8.3" ]
symfony: [ "^5.4", "^6.0" ]
sylius: [ "^1.12", "^1.13" ]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^1.12 installs the Sylius 1.13, so now version 1.12 is not tested at all, you need to change that to ~1.12.0

node: [ "18.x", "20.x" ]
mysql: [ "5.7", "8.0" ]
env:
APP_ENV: test
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}"
Expand Down Expand Up @@ -139,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)
Expand All @@ -170,7 +161,6 @@ jobs:

-
name: Validate composer.json
if: ${{ matrix.sylius != '1.13.x-dev as 1.13.0' }}
run: composer validate --ansi --strict

-
Expand All @@ -186,12 +176,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'


Expand Down
73 changes: 43 additions & 30 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
"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/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": "^v2.0",
"dbrekelmans/bdi": "^1.1",
"dmore/behat-chrome-extension": "^1.3",
"dmore/chrome-mink-driver": "^2.7",
"friends-of-behat/mink": "^1.8",
Expand All @@ -25,32 +27,46 @@
"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",
"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-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/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"
},
"conflict": {
"symfony/form": "4.4.11 || 4.4.12",
"api-platform/core": "v2.7.17",
"sylius/sylius": ">= 1.12.0 < 1.12.13"
"symfony/framework-bundle": "6.2.8",
"behat/mink-selenium2-driver": ">=1.7.0"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"symfony/thanks": true,
"composer/package-versions-deprecated": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
}
},
"extra": {
"branch-alias": {
"dev-master": "1.13-dev"
},
"symfony": {
"require": "^5.4 || ^6.0"
}
},
"autoload": {
"psr-4": {
Expand All @@ -75,14 +91,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"
}
}
}
15 changes: 6 additions & 9 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
};
18 changes: 9 additions & 9 deletions features/shop/site_wide_searching_products.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
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"
And this product is available in "Diesel" supply priced at "$45670"
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"
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"
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"
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"
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:
Expand All @@ -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 "$13,490.00"
And this product's description is:
"""
This is the Honda Africa Twin which is like the BMW GS but from Honda.
Expand Down
1 change: 1 addition & 0 deletions spec/Controller/Action/Shop/ListProductsActionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/Controller/RequestDataHandler/PaginationDataHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -88,7 +88,7 @@ private function handleOptionsPrefixedProperty(

private function handleAttributesPrefixedProperty(
array $requestData,
array & $data,
array &$data,
?array $attributesDefinitions = []
): void {
if (!isset($requestData['attributes'])) {
Expand Down
2 changes: 1 addition & 1 deletion src/Model/SearchFacets.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __set(string $facetId, $selectedBuckets)

public function __isset(string $facetId)
{
return isset($this->selectedBuckets[$facetId]);
return true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to remember this solution is very temporary 🖖

}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/config/services/transformer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<service id="BitBag\SyliusElasticsearchPlugin\Transformer\Product\ChannelPricingTransformer">
<argument type="service" id="sylius.context.channel" />
<argument type="service" id="sylius.context.locale" />
<argument type="service" id="sylius.product_variant_resolver.default" />
<argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" />
<argument type="service" id="sylius.money_formatter" />
</service>

Expand Down
10 changes: 5 additions & 5 deletions tests/Application/config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 }
7 changes: 0 additions & 7 deletions tests/Application/config/sylius/1.11/bundles.php

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading