-
-
Notifications
You must be signed in to change notification settings - Fork 373
Example code: remove --no-interaction
from Composer commands
#547
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
Example code: remove --no-interaction
from Composer commands
#547
Conversation
Good question. I'm not sure. There are couple of questions which come up in my mind thinking about it and I don't know the answers:
If needs be, I could go and do some investigating into this. If setting |
Oh.. another question which comes to mind - when was support for this env added to Composer ? I.e. is it supported in Composer 1.x ? |
There is a way to set it for all steps below using environment files. If setup-php sets Yes, it can be changed in later steps with the Yes, documentation can be updated to reflect this if added. Support for this was added in |
In that case, I think setting the env will probably be a great improvement! If you like, I can convert this PR to one removing the |
Yes, please do that. I have added |
All Composer commands used in CI should use `--no-interaction` to prevent them hanging in case interaction is expected. However, as setupPHP sets the `COMPOSER_NO_INTERACTION` flag (as of this version), this is not needed when using setupPHP. This removes redundant `--no-interaction` arguments from the example code. Also see: https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution
--no-interaction
with Composer commands--no-interaction
from Composer commands
d744915
to
94aecb1
Compare
Done! (including updating the PR title and description to match) |
Eh well, now it turns out this change (well really e7e1eee) broke the Composer build ;) https://github.com/composer/composer/runs/5109766175?check_suite_focus=true The reason is the tests do not expect COMPOSER_PROCESS_TIMEOUT to be present in env. I guess I'll clean up the env before running the tests though as people may have this set locally as well. Probably no action to be taken here, just wanted to share because I found it somewhat funny that the tweak making Composer more reliable for others broke Composer's build. |
@Seldaek While adding more configurations it made sense to shift to an env file instead of calling composer for each of them. |
Really no worries, it makes complete sense here, and it's already fixed on my end, just confused me for a sec what changed. I didn't notice those env vars magically appeared in the middle of the run, I assumed I had set this myself :) |
@Seldaek Oh cricky... of course it would... sorry about that. Then again "cleaning the environment" in the test bootstrap may actually be a good thing as I can imagine there may be contributors out there who also have ENV settings in place which could break the tests. |
Oh yeah this was absolutely a failure of the tests, and easily fixed composer/composer@3cb44bc |
... as since `setup-php` version `2.17.0`, this is no longer needed as this is now the default via an environtment variable set by `setup-php`. Refs: * https://github.com/shivammathur/setup-php/releases/tag/2.17.0 * shivammathur/setup-php#547
name: ⚙ Improvement
about: You found a bug, want to improve something or add a new feature
labels: enhancement
Description
All Composer commands used in CI should use--no-interaction
to prevent them hanging in case interaction is expected.This adds the--no-interaction
argument to all Composer example code which did not have the argument yet.All Composer commands used in CI should use
--no-interaction
to prevent them hanging in case interaction is expected. However, as setupPHP sets theCOMPOSER_NO_INTERACTION
flag (as of this version), this is not needed when using setupPHP.This removes redundant
--no-interaction
arguments from the example code.Also see: https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution