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

Poc rebased #718

Merged
merged 258 commits into from
Jun 22, 2023
Merged

Poc rebased #718

merged 258 commits into from
Jun 22, 2023

Conversation

loic425
Copy link
Member

@loic425 loic425 commented Jun 21, 2023

Q A
Bug fix? no/yes
New feature? no/yes
BC breaks? no/yes
Deprecations? no/yes
Related tickets fixes #X, partially #Y, mentioned in #Z
License MIT

loic425 and others added 5 commits June 21, 2023 10:07
This PR was merged into the poc-rebased branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | yes
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | 
| License         | MIT

Based on #714

Commits
-------

673b2d2 Fix Debug resource commnd test
37ddf17 Skip running Phpspec on PHP 8.2
@loic425 loic425 requested a review from a team as a code owner June 21, 2023 09:18
Zales0123 and others added 13 commits June 21, 2023 22:02
This PR was merged into the poc-rebased branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | no/yes
| New feature?    | no/yes
| BC breaks?      | no/yes
| Deprecations?   | no/yes <!-- don't forget to update the UPGRADE-*.md file -->
| Related tickets | fixes #X, partially #Y, mentioned in #Z
| License         | MIT


Commits
-------

d29d514 [Maintenance] Update the copyright block in all PHP classes
bcf4e4e [Maintenance] Update the copyright block in all XML files
8b2b512 [Maintenance] Update the copyright block in all YML files
39b8e1e [Maintenance] Update the copyright and dates in the LICENSE files
This PR was merged into the poc-rebased branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | fixes #686
| License         | MIT


Commits
-------

a8dec75 [New docs] Configure the resource name
8100200 Add item on table of contents
0c54190 Reapply missing commit
Co-authored-by: Mateusz Zalewski <zaleslaw@gmail.com>
This PR was merged into the poc-rebased branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | fixes #688 
| License         | MIT


Commits
-------

0dbec8d [New docs] Configure the resource plural name
5080334 Apply suggestions from code review
This PR was merged into the poc-rebased branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | 
| License         | MIT

[Preview](https://github.com/Sylius/SyliusResourceBundle/blob/8bdb41f96799c19a6832bdc1b2f50c24e70f82ba/docs/index.md)

Commits
-------

7355dfd [New docs] docs' pagination
22599aa Fix next page on configure your operations to redirect page
Copy link
Member

@Zales0123 Zales0123 left a comment

Choose a reason for hiding this comment

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

Obviously, it was impossible to review it fully, but it was already reviewed in partial PRs so it seems as be ready to merge 🖖

@@ -1,3 +1,19 @@
## UPGRADE FOR `1.11.x`

### FROM `1.10.x` to `1.11.x`
Copy link
Member

Choose a reason for hiding this comment

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

It would be probably wise to test this upgrade before (or just after) merge on some real project (Monfony? 😅), as it's very suspicious it needs only one thing to be changed 😄

Copy link
Member

Choose a reason for hiding this comment

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

truth been told, there are chances that this is the only needed change as we wanted to be backward compatible 🎉

Comment on lines +37 to +38
$this->registerWinzouStateMachine($container);
$this->registerSymfonyWorkflowStateMachine($container);
Copy link
Member

Choose a reason for hiding this comment

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

It the same as two lines below 🤔

Comment on lines +111 to +113
$container->setDefinition($metadata->getServiceId('factory'), $definition)
->addTag('sylius.resource_factory')
;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$container->setDefinition($metadata->getServiceId('factory'), $definition)
->addTag('sylius.resource_factory')
;
$container
->setDefinition($metadata->getServiceId('factory'), $definition)
->addTag('sylius.resource_factory')
;

?

Comment on lines +73 to +75
$container->registerForAutoconfiguration(ProviderInterface::class)
->addTag('sylius.state_provider')
;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$container->registerForAutoconfiguration(ProviderInterface::class)
->addTag('sylius.state_provider')
;
$container
->registerForAutoconfiguration(ProviderInterface::class)
->addTag('sylius.state_provider')
;

or

Suggested change
$container->registerForAutoconfiguration(ProviderInterface::class)
->addTag('sylius.state_provider')
;
$container->registerForAutoconfiguration(ProviderInterface::class)->addTag('sylius.state_provider');

if it fits the line characters limit 💃

I know I'm meticulous, but it's what makes Sylius Sylius xD

@@ -39,6 +39,8 @@ final class SyliusResourceBundle extends Bundle

public const DRIVER_DOCTRINE_PHPCR_ODM = 'doctrine/phpcr-odm';

public const NO_DRIVER = false;
Copy link
Member

Choose a reason for hiding this comment

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

It seems to not be used anywhere

Comment on lines +43 to +47
if (str_contains($resource, '.')) {
$metadata = $this->resourceRegistry->get($resource);
} else {
$metadata = $this->resourceRegistry->getByClass($resource);
}
Copy link
Member

Choose a reason for hiding this comment

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

There are a few places where this if-else statement is repeated - probably a space for some ResourceMetadataProvider 💃

use Sylius\Component\Resource\Symfony\Request\State\Responder;
use Sylius\Component\Resource\Symfony\Routing\Factory\OperationRouteNameFactory;

final class AttributesResourceMetadataCollectionFactory implements ResourceMetadataCollectionFactoryInterface
Copy link
Member

Choose a reason for hiding this comment

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

Let's obviously leave it as it is right now, but we should think about some refactoring of this class - its spec has almost 1000 lines of code 😅

$request = $context->get(RequestOption::class)?->request();

if (
'html' === $request?->getRequestFormat() &&
Copy link
Member

Choose a reason for hiding this comment

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

Let's avoid hardcoding strings in the code and use a private constant here

Comment on lines +35 to +37
if (
null === $operation
) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (
null === $operation
) {
if (null === $operation)
{

💃

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\ViewEvent;

final class FormListener
Copy link
Member

Choose a reason for hiding this comment

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

There is not spec for this file, as far as I see

@loic425
Copy link
Member Author

loic425 commented Jun 22, 2023

Thx a lot for this huge review. I'll male the change this morning.

@@ -1,3 +1,19 @@
## UPGRADE FOR `1.11.x`

### FROM `1.10.x` to `1.11.x`
Copy link
Member

Choose a reason for hiding this comment

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

truth been told, there are chances that this is the only needed change as we wanted to be backward compatible 🎉

@lchrusciel lchrusciel merged commit 8ff079f into 1.11 Jun 22, 2023
69 checks passed
@lchrusciel
Copy link
Member

Thank you, @loic425!

@lchrusciel lchrusciel deleted the poc-rebased branch June 22, 2023 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants