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

Remove rest dependencies #173

Merged
merged 7 commits into from
Oct 13, 2020

Conversation

loic425
Copy link
Member

@loic425 loic425 commented Jul 5, 2020

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #170
License MIT

@loic425 loic425 requested a review from a team as a code owner July 5, 2020 12:56
@loic425 loic425 force-pushed the feature/remove-rest-dependencies branch 7 times, most recently from 20dbf31 to 4919a03 Compare July 6, 2020 08:49
@loic425 loic425 changed the title [WIP] Remove rest dependencies Remove rest dependencies Jul 6, 2020
Copy link
Member

@lchrusciel lchrusciel left a comment

Choose a reason for hiding this comment

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

Seems very much ok, but I would prefer to have someone else to check it as well

@loic425
Copy link
Member Author

loic425 commented Jul 9, 2020

I think we have to add these librairies on conflict to prevent installing older versions than compatible ones. See Symfony composer requirements...

@loic425
Copy link
Member Author

loic425 commented Jul 9, 2020

I'd like to test prod requirements too. but I don't manage to launch clear cache command on --env=prod after composer install --no-dev. Test app still have test env...

@loic425
Copy link
Member Author

loic425 commented Jul 13, 2020

@pamil @lchrusciel I need help to test prod requirements. It doesn't work with my last commit.
When I run this command "(cd src/Bundle/test && app/console cache:clear --env=prod)" I am on test environment.

@loic425 loic425 force-pushed the feature/remove-rest-dependencies branch 6 times, most recently from 16efd54 to e45c941 Compare July 13, 2020 15:50
@lchrusciel
Copy link
Member

Hey Loic, sorry for not being to responsive. We had a few commitments that we had to fulfill recently. However, with 1.8 release coming, you can expect more power to review and push things further.

In the same time, thanks a lot for your patience and work :)

@loic425 loic425 force-pushed the feature/remove-rest-dependencies branch 6 times, most recently from 039cbd6 to 6458a38 Compare July 15, 2020 09:11
@loic425 loic425 requested a review from lchrusciel July 15, 2020 09:14
@loic425 loic425 force-pushed the feature/remove-rest-dependencies branch from 6458a38 to 0467038 Compare September 2, 2020 13:32
@loic425
Copy link
Member Author

loic425 commented Sep 2, 2020

@pamil @lchrusciel I rebased this PR to fix conflicts. I can squash all commits into one if you want.

@lchrusciel
Copy link
Member

Hey Loic,

thanks for your contribution and again sorry for the long feedback loop. However, we have to fix the main build before we can go anywhere further.

@loic425 loic425 force-pushed the feature/remove-rest-dependencies branch 2 times, most recently from dbe6b0b to b26bba8 Compare September 9, 2020 07:32
@lchrusciel lchrusciel linked an issue Sep 9, 2020 that may be closed by this pull request
@loic425 loic425 force-pushed the feature/remove-rest-dependencies branch from b26bba8 to 3cb71cc Compare September 9, 2020 13:54
@loic425
Copy link
Member Author

loic425 commented Sep 9, 2020

@lchrusciel I fixed the Ci build.

@loic425
Copy link
Member Author

loic425 commented Sep 25, 2020

@lchrusciel @pamil This one is ready and build is fixed. Is there anything else to improve?

@loic425 loic425 force-pushed the feature/remove-rest-dependencies branch from bc44a0d to 606e4b2 Compare September 29, 2020 09:03
@loic425
Copy link
Member Author

loic425 commented Sep 29, 2020

@lchrusciel I made a little change to use on-invalid="null", it allows to remove a compiler pass just for that case.

src/Bundle/DependencyInjection/Driver/AbstractDriver.php Outdated Show resolved Hide resolved
src/Bundle/Resources/config/services/controller.xml Outdated Show resolved Hide resolved
if ('prod' === $this->getEnvironment()) {
$loader = require __DIR__ . '/../../../../vendor/autoload.php';
$loader->addPsr4('AppBundle\\', __DIR__ . '/../src/AppBundle/');
$loader->addPsr4('Webmozart\\Assert\\', __DIR__ . '/../../../Component/vendor/webmozart/assert/src/');
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it's related to #188 and it should be fixed.

Copy link
Member Author

Choose a reason for hiding this comment

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

@pamil Maybe, we could fix #188 and rebase this one (again).

Copy link
Contributor

Choose a reason for hiding this comment

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

Done in #189 🎉

Copy link
Member Author

Choose a reason for hiding this comment

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

@pamil I rebased (again)

@loic425 loic425 force-pushed the feature/remove-rest-dependencies branch 3 times, most recently from 742819e to 1f86800 Compare October 12, 2020 16:04
@loic425 loic425 force-pushed the feature/remove-rest-dependencies branch from 1f86800 to 6a359ff Compare October 12, 2020 19:21
composer.json Outdated
"winzou/state-machine-bundle": "^0.3.2 || ^0.4.3 || ^0.5"
},
"replace": {
"sylius/resource": "self.version"
},
"conflict": {
"amphp/amp": "^2.4.3"
"amphp/amp": "^2.4.3",
"friendsofsymfony/rest-bundle": "<3.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder whether we shouldn't also add conflict for the next major version (to be removed when we decide to support it). Then it would be <3.0 >=4.0 (and similar for other requirements here). What do you think?

src/Bundle/DependencyInjection/Driver/AbstractDriver.php Outdated Show resolved Hide resolved
return [
if ('prod' === $this->getEnvironment()) {
$loader = require __DIR__ . '/../../../../vendor/autoload.php';
$loader->addPsr4('AppBundle\\', __DIR__ . '/../src/AppBundle/');
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it needed? autoload-dev in composer.json should already do the job.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, it's removed on "prod" env.

Copy link
Contributor

Choose a reason for hiding this comment

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

When do we run the test application in prod environment?

src/Bundle/test/app/AppKernel.php Outdated Show resolved Hide resolved

$application = new Application(new AppKernel('test', true));
$application = new Application(new AppKernel($env, true));
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the idea behind that? Do we really need it?

Copy link
Member Author

Choose a reason for hiding this comment

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

The idea is to test prod requirements (without optional rest bundles).

Copy link
Member Author

Choose a reason for hiding this comment

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

@pamil Maybe you have a better idea to test without optional bundles...

loic425 and others added 2 commits October 13, 2020 12:00
Co-authored-by: Kamil Kokot <kamil@kokot.me>
Co-authored-by: Kamil Kokot <kamil@kokot.me>
.travis.yml Outdated

- composer require doctrine/orm:^2.5 --no-update --no-scripts --prefer-dist
- composer update --no-dev --prefer-dist
- (cd src/Bundle/test && app/console cache:clear --env=prod)
Copy link
Member Author

Choose a reason for hiding this comment

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

@pamil we test prod environment here.

@pamil pamil force-pushed the feature/remove-rest-dependencies branch from 3298d3e to c197044 Compare October 13, 2020 14:13

return parent::getContainerBaseClass();
$loader->load(__DIR__ . '/config/{config}.{php,xml,yaml,yml}', 'glob');
$loader->load(__DIR__ . '/config/{config}_' . $this->getEnvironment() . '.{php,xml,yaml,yml}', 'glob');
Copy link
Contributor

Choose a reason for hiding this comment

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

Makes the environment config file optional, it's the same behaviour as in Symfony 4+ apps.

@@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;

$input = new ArgvInput();
$env = $input->getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'test');
$env = $input->getParameterOption(['--env', '-e'], getenv('APP_ENV') ?? 'test');
Copy link
Contributor

Choose a reason for hiding this comment

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

Replaced SYMFONY_ENV to more recent APP_ENV.

@pamil pamil merged commit 3b19604 into Sylius:master Oct 13, 2020
@pamil
Copy link
Contributor

pamil commented Oct 13, 2020

Thank you, Loïc! 🥇

@loic425
Copy link
Member Author

loic425 commented Oct 13, 2020

Thank you, Loïc! 🥇

Thank you too @pamil. You worked a lot on this one too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove FosRestBundle and BazingaHateoasBundle dependency. Symfony 5 support
4 participants