I noticed that composer.lock was recently automatically ignored from the version control f954bdd
I have read the commit notes and agree that the file has many issues as updates in production do not (to my knowledge) update composer.lock and packages in composer.json have no fixed version most of the time.
As a background we have usually added the WordPress.org plugins via composer and kept premium and custom plugins in version control. Now, when you add a new plugin via composer, there is pre-made git hook in production that also installs it if there is change in composer.lock. If this file is not in version control, this automation will not work (manual command needed in production).
As a developer I don't want to have this manual and easy to forget thing in the workflow which leaves (at least) two strategies:
- Manually re-add the
composer.lock to the version control and keep workflow the same.
- Add all the plugins to the version control to minimize the need for
composer.json in the first place. This will lead to more uncommited changes in production situations, but fix all issues with composer.lock. For this option, we'll need to change the default .gitignore for plugins each time.
What do you think? With this change there is a hole in the workflow when a new (WordPress.org) plugin is added to the site in local development that needs some kind of solution.