-
-
Notifications
You must be signed in to change notification settings - Fork 196
Check if symfony.lock
is up to date
#825
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
Comments
Can you try |
Doesn't modify the |
You can use the |
Perhaps a worked example would help explain things. Environment set upcd $(mktemp -d)
git init .
echo /vendor > .gitignore
git add .gitignore
git commit -m init
composer require symfony/flex
$ git add . && git commit -m flex I'm not talking about recipes directly, if you install a new package it gets added to the $ composer require psr/log
$ git diff symfony.lock
diff --git a/symfony.lock b/symfony.lock
index d67ef32..a45ba9c 100644
--- a/symfony.lock
+++ b/symfony.lock
@@ -1,4 +1,7 @@
{
+ "psr/log": {
+ "version": "1.1.4"
+ },
"symfony/flex": {
"version": "1.17",
"recipe": {
$ git reset --hard However if you install a no package without the flex plugin loaded (e.g. dependabot): $ composer require --no-plugins psr/log
$ git diff symfony.lock
# Nothing It's not an out of date recipes so the following doesn't help:
Now run $ composer symfony:recipes:install
$ git diff symfony.lock
diff --git a/symfony.lock b/symfony.lock
index d67ef32..a45ba9c 100644
--- a/symfony.lock
+++ b/symfony.lock
@@ -1,4 +1,7 @@
{
+ "psr/log": {
+ "version": "1.1.4"
+ },
"symfony/flex": {
"version": "1.17",
"recipe": { What would be ideal is having a command (or option) that either does that modification without talking to remote package repositories or one that simply checks if the |
|
We run
composer symfony:recipes:install
in our CI pipeline to check that thesymfony.lock
file doesn't have any updates that are missing from the PR, usually these originate from dependabot, if thesymfony.lock
file has uncommitted changes after running flex we fail the build.We've since discovered that the
symfony:recipes:install
command will exit with an error if you are not authenticated with any of your repositories, however by the time it exitssymfony.lock
has already been modified with the packages that are missing. If you run the command again it now passes even though the previous run failed, perhaps it should reverse the changes tosymfony.lock
?Could a new command that just checks if the
symfony.lock
file is up to date and exits with an error if not, skipping the rest of the work that thesymfony:recipes:install
command does, be added for use in CI pipelines?The text was updated successfully, but these errors were encountered: