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

Fix incorrect check if CI variable is set to true #2501

Merged
merged 2 commits into from Jun 19, 2017

Conversation

Projects
None yet
4 participants
@varnav
Copy link
Contributor

commented Jun 8, 2017

Originally build would fail on warnings with any value of CI environment variable. Now it will correctly check if it's true.

Discussed here: #2453

Did a simple test with this shell script:

CI='true'
echo $CI
node -e "if (process.env.CI && process.env.CI.toLowerCase() === 'true') console.log('Yes')"

CI='True'
echo $CI
node -e "if (process.env.CI && process.env.CI.toLowerCase() === 'true') console.log('Yes')"

CI='false'
echo $CI
node -e "if (process.env.CI && process.env.CI.toLowerCase() === 'true') console.log('Yes')"

unset CI
echo $CI
node -e "if (process.env.CI && process.env.CI.toLowerCase() === 'true') console.log('Yes')"
Fix incorrect check if CI variable is set to true
Originally build would fail on warnings with any value of CI environment variable. Now it will correctly check if it's true.

Discussed here: #2453
@facebook-github-bot

This comment has been minimized.

Copy link

commented Jun 8, 2017

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot

This comment has been minimized.

Copy link

commented Jun 8, 2017

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@Timer
Copy link
Collaborator

left a comment

Just one concern.

@@ -112,7 +112,7 @@ function build(previousFileSizes) {
if (messages.errors.length) {
return reject(new Error(messages.errors.join('\n\n')));
}
if (process.env.CI && messages.warnings.length) {
if (process.env.CI && process.env.CI.toLowerCase() === 'true' && messages.warnings.length) {

This comment has been minimized.

Copy link
@Timer

Timer Jun 8, 2017

Collaborator

I have a feeling people might set this to things like travis, etc.

How about checking !== 'false'?

This comment has been minimized.

Copy link
@varnav

varnav Jun 8, 2017

Author Contributor

I'm not sure about real practice of using this variable, I think we need some discussion first.

This comment has been minimized.

Copy link
@Timer

Timer Jun 8, 2017

Collaborator

Given the way it works currently (truthy), using !== false would retain current functionality and wouldn't be a breaking change (if you consider 'false' a bug).

Even if 'true' is the proper value to evaluate against, we would have to postpone that to 2.0.0.

This comment has been minimized.

Copy link
@varnav

varnav Jun 8, 2017

Author Contributor

Hmm, I agree then.

@Timer Timer added the tag: bug fix label Jun 8, 2017

@Timer Timer added this to the 1.0.8 milestone Jun 8, 2017

Check for "not false" instead of "not true"
After discussion we decided that this will be closer to current functionality and not break anything.
@varnav

This comment has been minimized.

Copy link
Contributor Author

commented Jun 8, 2017

Oops, 2nd commit from me seems to be wrong.

@Timer

This comment has been minimized.

Copy link
Collaborator

commented Jun 19, 2017

Great, thanks for making that change!
Sorry for the slow turn around, I've been really busy lately.

@Timer Timer merged commit 5b38c54 into facebook:master Jun 19, 2017

1 of 2 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@gaearon

This comment has been minimized.

Copy link
Member

commented Jun 28, 2017

romaindso added a commit to romaindso/create-react-app that referenced this pull request Jul 10, 2017

Check if CI variable is set to `'false'` (facebook#2501)
* Fix incorrect check if CI variable is set to true

Originally build would fail on warnings with any value of CI environment variable. Now it will correctly check if it's true.

Discussed here: facebook#2453

* Check for "not false" instead of "not true"

After discussion we decided that this will be closer to current functionality and not break anything.

wmonk referenced this pull request in wmonk/create-react-app-typescript Aug 7, 2017

Check if CI variable is set to `'false'` (#2501)
* Fix incorrect check if CI variable is set to true

Originally build would fail on warnings with any value of CI environment variable. Now it will correctly check if it's true.

Discussed here: facebook/create-react-app#2453

* Check for "not false" instead of "not true"

After discussion we decided that this will be closer to current functionality and not break anything.

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.