python-poetry/cleo

Default --no-interactive to on when CI=true

djmattyg007 opened this issue · 5 comments

By setting --no-interactive to on when the environment variable CI is true, we can help avoid situations where a CI pipeline accidentally blocks waiting for user input when none will arrive. This will help prevent precious compute resources from being wasted.

I like the idea, but I am hesitant. Is the CI variable present in all CI/CD systems? I would like to avoid adding a big list of variables that could potentially break someone's setup.

I’ve never heard of a CI system that doesn’t set that environment variable to true.

I’ve never heard of a CI system that doesn’t set that environment variable to true.

There are certainly plenty that don't do it automatically, but it certainly is a common convention. Most users of environments where it is not set implicitly will set it manually @Secrus, so I do not see the harm (though Poetry should probably grow a 'using Poetry in CI' FAQ entry that mentions this).

Thanks for the suggestion!

I think we should go a step further and default --no-interaction when stdin is not a tty, since that will cover more cases than just CI.

See #245

@branchvincent @Secrus I don’t think the implemented solution necessarily solves the problem I reported. Some CI systems (like Buildkite) allocate a TTY by default because they want processes to output colour. However they still set the CI environment variable to true.