Skip to content
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

(PDK-1414) Detect common CI environments and set non-interactive #689

Merged
merged 2 commits into from
Jun 30, 2019

Conversation

glennsarti
Copy link
Contributor

Previously PDK detected whether a session was interactive by using the isatty
method on STDERR. However it is still possible to create TTY based STDERR in
CI environments such as Travis. This commit adds additional Environment
Variable checks for common CI systems to ensure that PDK is non-interactive in
CI.

@coveralls
Copy link

coveralls commented Jun 28, 2019

Coverage Status

Coverage decreased (-0.02%) to 93.059% when pulling a457244 on glennsarti:detect-ci into 5d49829 on puppetlabs:master.

@glennsarti glennsarti force-pushed the detect-ci branch 3 times, most recently from fbacb7a to 8bd9707 Compare June 28, 2019 06:09
@glennsarti glennsarti requested a review from rodjek June 28, 2019 06:53
Previously PDK detected whether a session was interactive by using the isatty
method on STDERR. However it is still possible to create TTY based STDERR in
CI environments such as Travis.  This commit adds additional Environment
Variable checks for common CI systems to ensure that PDK is non-interactive in
CI.
@scotje
Copy link
Contributor

scotje commented Jun 28, 2019

Created https://tickets.puppetlabs.com/browse/PDK-1414 to track and amended the commit message to include ticket number.

@scotje scotje changed the title (maint) Detect common CI environments and set non-interactive (PDK-1414) Detect common CI environments and set non-interactive Jun 28, 2019
Copy link
Contributor

@scotje scotje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some day we should memoize these Util things that are extremely unlikely to change over the course of an invocation.

lib/pdk/cli/util.rb Outdated Show resolved Hide resolved
Also refactored slightly to use Enum#any? instead of #each with return
@rodjek rodjek merged commit d7565ab into puppetlabs:master Jun 30, 2019
@glennsarti glennsarti deleted the detect-ci branch August 19, 2019 08:11
logicminds pushed a commit to nwops/pdk that referenced this pull request Nov 30, 2020
…petlabs#689)

* (PDK-1414) Detect common CI environments and set non-interactive

Previously PDK detected whether a session was interactive by using the isatty
method on STDERR. However it is still possible to create TTY based STDERR in
CI environments such as Travis.  This commit adds additional Environment
Variable checks for common CI systems to ensure that PDK is non-interactive in
CI.

* (FIXUP) Add "CI" and "CONTINUOUS_INTEGRATION" to list

Also refactored slightly to use Enum#any? instead of #each with return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants