-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Merge API Platform 3 to 2.0 branch #16847
Conversation
…fikooo) This PR was merged into the api-platform-3 branch. Discussion ---------- | Q | A |-----------------|----- | Branch? | api-platform-3 <!-- see the comment below --> | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no <!-- don't forget to update the UPGRADE-*.md file --> | License | MIT <!-- - Bug fixes must be submitted against the 1.13 branch - Features and deprecations must be submitted against the 1.14 branch - Features, removing deprecations and BC breaks must be submitted against the 2.0 branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html --> Commits ------- [Unit] Update Channels tests to include embedded shop billing data [Unit] Improve channel fixtures with more descriptive data [Unit] Remove obsolete shop billing data response files [Unit] Update channel tests responses to include shop billing data [API] Remove obsolete serialization groups from Channel resource [API] Update serialization groups of ShopBillingData resource [API] Configure ShopBillingData field as embedded Channel's resource [Behat] Update ManagingChannelsBillingDataContext class [Unit] ChannelsTest code refactor [Unit] Add requestPost util function and other related code [Unit] Use requestPost util method in ChannelsTest [Unit] Enable deleting the only channel test
| Q | A |-----------------|----- | Branch? | api-platform-3 | Bug fix? | no | New feature? | somewhat | BC breaks? | no | Deprecations? | no | Related tickets | - | License | MIT
| Q | A |-----------------|----- | Branch? | api-platform-3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | n/a | License | MIT
| Q | A |-----------------|----- | Branch? | api-platform-3 <!-- see the comment below --> | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no <!-- don't forget to update the UPGRADE-*.md file --> | License | MIT
* 2.0: (64 commits) [Admin] Rename parameter [Admin] Change command handlers and console command ids to dotted notation [Core] Change command handlers and console command ids to dotted notation [Core] Use new services [Core] Rename Message to Command [Admin] Rename Message to Command [Promotion] Remove deprecated commands [Ui] Remove deprecated commands [User] Remove deprecated commands [Admin] Configure and use anonymous view in store component [Admin] Add missing order notes information [Behat] Use test attribute to retrieve order notes [Admin] Render pagination and enabled filter test attributes [Behat] Enable scenarios and improve implementation for filtered pages redirections [Admin] Render view in store button in the variant edit page [CS][DX] Refactor [Behat] Improve view product in store action [Behat] Enable viewing product in store from variant edit page scenarios [Behat] Enable deleting multiple product variants scenario [Behat] Enable remaining managing users scenario ...
* 2.0: [CS][DX] Refactor [CS][DX] Refactor [CS][DX] Refactor [CI] Update Sylius branches in refactor workflow [Behat] Switch another random JS failed scenarios to Chromedriver [Behat] Switch another random JS failed scenarios to Chromedriver [Behat] Switch random JS failed scenarios to Chromedriver [CS][DX] Refactor
| Q | A |-----------------|----- | Branch? | api-platform-3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no<!-- don't forget to update the UPGRADE-*.md file --> | Related tickets | | License | MIT <!-- - Bug fixes must be submitted against the 1.13 branch - Features and deprecations must be submitted against the 1.14 branch - Features, removing deprecations and BC breaks must be submitted against the 2.0 branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html -->
| Q | A |-----------------|----- | Branch? | api-platform-3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no<!-- don't forget to update the UPGRADE-*.md file --> | Related tickets | | License | MIT <!-- - Bug fixes must be submitted against the 1.13 branch - Features and deprecations must be submitted against the 1.14 branch - Features, removing deprecations and BC breaks must be submitted against the 2.0 branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html -->
| Q | A |-----------------|----- | Branch? | api-platform-3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no<!-- don't forget to update the UPGRADE-*.md file --> | Related tickets | | License | MIT <!-- - Bug fixes must be submitted against the 1.13 branch - Features and deprecations must be submitted against the 1.14 branch - Features, removing deprecations and BC breaks must be submitted against the 2.0 branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html -->
| Q | A |-----------------|----- | Branch? | api-platform-3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no<!-- don't forget to update the UPGRADE-*.md file --> | Related tickets | | License | MIT <!-- - Bug fixes must be submitted against the 1.13 branch - Features and deprecations must be submitted against the 1.14 branch - Features, removing deprecations and BC breaks must be submitted against the 2.0 branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html -->
* 2.0: Fix data grid sorting when there are no defaults [Admin][CatalogPromotion] Fix icon for show variants link
Bunnyshell Preview Environment deletedAvailable commands:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scenario: Filtering tax categories by name | ||
When I search by "Food" name | ||
When I search by "ood" name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--- When I search by "ood" name
+++ When I search by "Food" name
If Food
is not a desired search string, then some other human readable word should be used.
- `Sylius\Bundle\ApiBundle\DataPersister\*DataPersister` => `Sylius\Bundle\ApiBundle\StateProcessor\*Processor` | ||
- `Sylius\Bundle\ApiBundle\DataProvider\*DataProvider` => `Sylius\Bundle\ApiBundle\StateProvider\*Provider` | ||
|
||
* API Platform has also dropped `DataTransformers` in favor of which `some of them` have been refactored into `SerializerContextBuilders` as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bold or italic would suit better than code for text accent.
--- * API Platform has also dropped `DataTransformers` in favor of which `some of them` have been refactored into `SerializerContextBuilders` as follows:
+++ * API Platform has also dropped `DataTransformers` in favor of which **some of them** have been refactored into `SerializerContextBuilders` as follows:
+ protected ?string $channelCode, | ||
+ protected ?string $localeCode, | ||
+ protected ?string $email = null, | ||
+ protected ?string $message = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it's a correct sorting order from CS point of view, that's strange from business point of view.
* The constructor of `Sylius\Bundle\ApiBundle\Command\Account\RequestShopUserVerification` has been created: | ||
```php | ||
public function __construct( | ||
+ protected string|int|null $shopUserId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$shopUserId
typehint should be identical between ChangeShopUserPassword
and RequestShopUserVerification
(Other commands?)
Currently it's
+ protected mixed $shopUserId,
+ protected string|int|null $shopUserId,
|
||
## Decision Drivers | ||
|
||
* Moving from DataProviders to StateProviders |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since previous parts of document highlight these words as code, then this probably should as well.
--- * Moving from DataProviders to StateProviders
+++ * Moving from `DataProviders` to `StateProviders`
|
||
## Decision Outcome | ||
|
||
Chosen option: `Separate StateProviders by sections and resources`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've browsed other ADRs and there is no clear syntax to highlight chosen option, but bold, italic or underline should be better choice.
Chosen option: Separate StateProviders by sections and resources
,
Chosen option: Separate StateProviders by sections and resources
Chosen option: Separate StateProviders by sections and resources
Chosen option: Separate StateProviders by sections and resources
Chosen option: Separate StateProviders by sections and resources
Chosen option: Separate StateProviders by sections and resources
Doctrine/ORM/QueryExtension/ | ||
/Admin | ||
/Product | ||
ExampleExtension.php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be cool to show extension types over here, like
ItemExtension.php
CollectionExtension.php
|
||
## Decision Drivers | ||
|
||
* Migrate from DataPersisters to StateProcessors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--- * Migrate from DataPersisters to StateProcessors
+++ * Migrate from `DataPersisters` to `StateProcessors`
|
||
## Decision Outcome | ||
|
||
Chosen option: Separate StateProcessors by sections, resources, and operations, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chosen option needs to be highlighted as in two previous ADRs.
Following existing scheme,
--- Chosen option: Separate StateProcessors by sections, resources, and operations,
+++ Chosen option: `Separate StateProcessors by sections, resources, and operations`,
Suggested change,
--- Chosen option: Separate StateProcessors by sections, resources, and operations,
+++ Chosen option: **<ins>Separate StateProcessors by sections, resources, and operations</ins>**,
orderTokenValue: $tokenValue, | ||
shipmentId: $shipmentId, | ||
shippingMethodCode: $shippingMethodCode, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spacing issue
--- );
+++ );
$this->addItemToCart($productVariantCode, $quantity, $tokenValue); | ||
$cart = $this->updateCartWithAddressAndCouponCode($tokenValue, $email, $couponCode); | ||
$this->dispatchShippingMethodChooseCommand( | ||
$tokenValue, | ||
'UPS', | ||
(string) $cart->getShipments()->first()->getId(), | ||
$cart->getShipments()->first()->getId(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to getLastPayment
, you should use last available shipment, so
--- $cart->getShipments()->first()->getId(),
+++ $cart->getShipments()->last()->getId(),
@@ -60,12 +60,12 @@ protected function fulfillOrder( | |||
$this->dispatchShippingMethodChooseCommand( | |||
$tokenValue, | |||
'UPS', | |||
(string) $cart->getShipments()->first()->getId(), | |||
$cart->getShipments()->first()->getId(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--- $cart->getShipments()->first()->getId(),
+++ $cart->getShipments()->last()->getId(),
|
||
/** @var ProductImageInterface $productImage */ | ||
$productImage = $fixtures['product_mug_thumbnail']; | ||
/** @var ProductInterface $product */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outside of scope of current PR, but we should add return type to ProductImage/TaxonImage instead.
'shop/product_attribute/get_product_attribute_value', | ||
Response::HTTP_OK, | ||
); | ||
$this->requestGet('/api/v2/shop/product-attribute-values/' . $attributeValue->getId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A matter of taste, but would be cool to use same syntax over all tests.
--- $this->requestGet('/api/v2/shop/product-attribute-values/' . $attributeValue->getId());
+++ $this->requestGet(sprintf('/api/v2/shop/product-attribute-values/%s', $attributeValue->getId()));
$order = $this->placeOrder('token', 'guest@doe.com'); | ||
|
||
$this->requestGet( | ||
uri: sprintf('/api/v2/shop/orders/token/payments/%s/configuration', $order->getPayments()->first()->getId()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--- uri: sprintf('/api/v2/shop/account/orders/token/payments/%s', $order->getPayments()->first()->getId()),
+++ uri: sprintf('/api/v2/shop/account/orders/token/payments/%s', $order->getLastPayment()->getId()),
$order = $this->placeOrder('token', 'guest@doe.com'); | ||
|
||
$this->requestGet( | ||
uri: sprintf('/api/v2/shop/orders/token/payments/%s/configuration', $order->getPayments()->first()->getId()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--- uri: sprintf('/api/v2/shop/account/orders/token/payments/%s', $order->getPayments()->first()->getId()),
+++ uri: sprintf('/api/v2/shop/account/orders/token/payments/%s', $order->getLastPayment()->getId()),
$this->placeOrder('token', $customer->getEmailCanonical()); | ||
|
||
$this->requestGet( | ||
uri: '/api/v2/shop/orders/token/items', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use nAWw2jewp
token, which is commonly used through tests?
); | ||
|
||
$response = $this->client->getResponse(); | ||
$this->requestGet('/api/v2/shop/customers/' . $customer->getId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--- $this->requestGet('/api/v2/shop/customers/' . $customer->getId());
+++ $this->requestGet(sprintf('/api/v2/shop/customers/%s', $customer->getId()));
]); | ||
|
||
$this->requestPatch( | ||
'/api/v2/shop/customers/reset-password/valid_token', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--- '/api/v2/shop/customers/reset-password/valid_token',
+++ '/api/v2/shop/customers/reset-password/expired_token',
As the upgrade of our API to API Platform 3 is almost completed, it is high time to merge these changes to branch 2.0 and finish the work there.