I have a couple of large Symfony projects, and have noticed that after updating everything to Symfony 4 (Flex), when our deployment automation runs its normal process of:
composer install --no-dev
We end up with (for example) this:
Symfony operations: 2 recipes (72fad9713126cf1479bb25a53d64d744)
- Unconfiguring symfony/maker-bundle (>=1.0): From github.com/symfony/recipes:master
- Unconfiguring phpunit/phpunit (>=4.7): From github.com/symfony/recipes:master
Then, as expected, this results in changes to symfony.lock
and config/bundles.php
, plus whatever else, depending on what was included in require-dev
in composer.json
.
None of this is breaking, exactly, but it is annoying to have a production deploy that no longer has a clean git status
output, and can lead to confusion as to what is actually deployed.
There are various workarounds for this, for example I could just put everything in require
rather than require-dev
since there is no real harm in deploying that stuff, or I could omit the --no-dev
part of the Composer command.
But really, what is the right practice here? It seems odd that there is no way to tell Flex to make no changes to configuration if you are just deploying a locked piece of software. Is this a feature request, or have I missed some bit of configuration here?
symfony.lock
file to the repo? It's required to avoid this issue on deploying. – Cheddarsymfony.lock
is under version control. It's actually the opposite problem: since the--no-dev
is specified, Flex thinks that the members ofrequire-dev
are being removed, so it runs the unconfigure steps based on themanifest.json
in the appropriate recipes. In my example, that would mean deleting thephpunit.xml.dist
file and removing the Maker bundle fromconfig/bundles.php
. It just seems like there should be a way to prevent this behavior on a production deploy. – Fortsymfony.lock
has diff on deploying then I can see the issue. – Cheddar