-
Notifications
You must be signed in to change notification settings - Fork 155
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
Remove rest dependencies #173
Conversation
loic425
commented
Jul 5, 2020
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Related tickets | fixes #170 |
License | MIT |
20dbf31
to
4919a03
Compare
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.
Seems very much ok, but I would prefer to have someone else to check it as well
src/Bundle/DependencyInjection/Compiler/RegisterViewHandlerPass.php
Outdated
Show resolved
Hide resolved
I think we have to add these librairies on conflict to prevent installing older versions than compatible ones. See Symfony composer requirements... |
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... |
@pamil @lchrusciel I need help to test prod requirements. It doesn't work with my last commit. |
16efd54
to
e45c941
Compare
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 :) |
039cbd6
to
6458a38
Compare
6458a38
to
0467038
Compare
@pamil @lchrusciel I rebased this PR to fix conflicts. I can squash all commits into one if you want. |
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. |
dbe6b0b
to
b26bba8
Compare
b26bba8
to
3cb71cc
Compare
@lchrusciel I fixed the Ci build. |
@lchrusciel @pamil This one is ready and build is fixed. Is there anything else to improve? |
bc44a0d
to
606e4b2
Compare
@lchrusciel I made a little change to use |
src/Bundle/test/app/AppKernel.php
Outdated
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/'); |
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 guess it's related to #188 and it should be fixed.
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.
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.
Done in #189 🎉
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.
@pamil I rebased (again)
742819e
to
1f86800
Compare
1f86800
to
6a359ff
Compare
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", |
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 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/test/app/AppKernel.php
Outdated
return [ | ||
if ('prod' === $this->getEnvironment()) { | ||
$loader = require __DIR__ . '/../../../../vendor/autoload.php'; | ||
$loader->addPsr4('AppBundle\\', __DIR__ . '/../src/AppBundle/'); |
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.
Is it needed? autoload-dev
in composer.json
should already do the job.
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.
Nope, it's removed on "prod" env.
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 do we run the test application in prod
environment?
|
||
$application = new Application(new AppKernel('test', true)); | ||
$application = new Application(new AppKernel($env, true)); |
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.
What's the idea behind that? Do we really need it?
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.
The idea is to test prod requirements (without optional rest bundles).
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.
@pamil Maybe you have a better idea to test without optional bundles...
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) |
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.
@pamil we test prod environment here.
3298d3e
to
c197044
Compare
|
||
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'); |
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.
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'); |
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.
Replaced SYMFONY_ENV
to more recent APP_ENV
.
Thank you, Loïc! 🥇 |
Thank you too @pamil. You worked a lot on this one too. |