-
Notifications
You must be signed in to change notification settings - Fork 19
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
build: don't commit the composer.lock
file
#113
Comments
composer.lock
filecomposer.lock
file
Hey @adevade, thanks for opening the issue and the PR. I can see why committing the lock file is inconvenient. I would like to keep dependencies pinned as that keeps future maintainers and CI from inadvertently updating a dependency, making the build output slightly different from the distributable. But to your point, the Composer docs explicitly state committing the lock file is optional and probably not needed.
In your opinion, do you see it as an insignificant risk to potentially have dependency versions vary between maintainers so long as CI is always pulling in the latest dependency? |
From what I've seen in the PHP community, it's most common not to commit the lock file. As seen in my examples above. Besides, this library has very few dependencies compared to most. Both PHPUnit and the Laravel team are respectable developers, and handle the semantic versioning very well. As long as the version definitions in You could configure CI to run twice as well. Once with the latest versions, and once with the lowest supported versions according to
matrix:
php: ['8.0', 8.1, 8.2]
stability: [prefer-lowest, prefer-stable] |
I like the CI suggestion a lot, and your explanation regarding relying on |
Right now, the
composer.lock
file is committed to the repo. This is usually not done for packages, because it locks it to the PHP version of the person generating the lock file. (See bottom of file)I think the removal of this file could solve the problem where you have to run
composer update
in CI as well. Since if the lock file is missing, a new one will be generated upon runningcomposer install
. This will happen for each version of PHP in the matrix, letting Composer install the latest packages compatible with the current PHP version.The lock file is not used when installing this as a package in a project in any case.
Hope you understand my ramblings! 😅
Popular packages without composer.lock files:
The text was updated successfully, but these errors were encountered: