How can you verify that updating the kernel (or any other dependency that is being updated) does not interrupt the work of projects if it is not executed by the developer?
This is why a normal workflow expects composer update be run on a developer's computer that has enough RAM (i.e. maybe more than 1 GB is set as the memory limit for PHP), and the update should be started manually by the developer (and if it starts automatically continuous assembly integration, memory requirements apply to this machine as well).
There is no way around this memory requirement. A web server with only 512 MB of RAM installed can function as an intermediate server with only some concurrent users present, but should not be used to update Composer dependencies.
Personally, I am fixing the merge conflicts in composer.lock with a very simple system: delete the lock file and run composer update . This will update all the dependencies to the latest versions that meet the version requirements and create a new composer.lock working file which will be committed during the merge.
I'm not afraid to potentially upgrade everything, because either it works as expected, or my tests will quickly detect errors.
I choose third-party packages that I use carefully:
- they should tag their versions, preferably using semantic version control.
- I donβt use branches for release versions (rare cases when someone used them during development were painful)
- they must submit a new major version if they make incompatible changes
- locally developed packages also meet these requirements
This works with approximately 270 packages serviced by our local Satis instance (perhaps this is also a factor that should be considered when trying to reduce the amount of memory - only packages known to Composer can end up in memory: compare the ten thousand packages potentially available on packagist.org , with 270 local packages). 60 out of 270 packages are developed locally by 20 developers and randomly release new versions. Update failures over the past 2 years are very rare and should be handled like other errors: if an incompatibility of the marked version is detected, we release a patch that returns the change and mark the original change with a new major release if an incompatible change is needed.
So, the workflow you are requesting looks something like this:
- At any time, any developer should be able to run
composer update on their local computer. - They should be able to detect if it breaks things on their local machine.
- If nothing is broken, they commit the changes, including the
composer.lock file in Git - The intermediate server runs only
composer install and will use exactly the versions that the developer used on his computer. - If nothing is broken during the production, this version is ready for use in production.
Merging an already committed version on another developer's computer can lead to merge conflicts with composer.lock .
- Resolve conflicts on all other files.
- The
composer.lock file must be deleted. - From here, the workflow, as stated above, that is:
- The developer should be able to run
composer update on his local computer. - They should be able to detect if it breaks things on his local machine.
- If nothing is broken ... and so on.
source share