-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New flags to disable/configure blocking #12617
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
Conversation
doc/03-cli.md
Outdated
|
|
||
| ### COMPOSER_NO_SECURITY_BLOCKING | ||
|
|
||
| If set to `1`, it is the equivalent of passing the `--no-security-blocking` option to `require`, `update`, `remove`, or `create-project` command. This allows installing packages with security advisories or that are abandoned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason not to have this flag for the install command?
It doesn't work, if you don't have a composer.lock file.
In DDEV, we split composer create-project in several steps https://docs.ddev.com/en/stable/users/usage/developer-tools/#ddev-and-composer (needed for internal reasons).
If I run this, it doesn't let me to install:
composer create-project "typo3/cms-base-distribution:^11" . --no-install
COMPOSER_NO_SECURITY_BLOCKING=1 composer installBut at the same time I can do this:
composer create-project "typo3/cms-base-distribution:^11" . --no-install
COMPOSER_NO_SECURITY_BLOCKING=1 composer updateThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you run the install command without a lock file you are performing an update, so call the update command if you don't have a lock file. The install command should not be used without a lock file as is evident from its output too, hopefully.
But since people insist on doing this, I guess it would only be consistent to pass along these flags to any update triggered by the install command when it finds the lock file it requires is missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The create-project command does this internally and executes an update if there is no lock file present: https://github.com/composer/composer/blob/main/src/Composer/Command/CreateProjectCommand.php#L253
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think I'd rather not add it so that it remains very clear that install itself does NOT do any filtering of vulnerable dependencies, it installs a lock file as is and that's it.
Co-authored-by: Nils Adermann <[email protected]>
Refs #12612 - first part (see individual commits). Will do the
apply: ...stuff in a follow-up PR as that is likely to grow a bit more complex.