-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Conversation
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
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! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
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.
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) { |
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.
I have a feeling people might set this to things like travis
, etc.
How about checking !== 'false'
?
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.
I'm not sure about real practice of using this variable, I think we need some discussion first.
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.
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.
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.
Hmm, I agree then.
After discussion we decided that this will be closer to current functionality and not break anything.
Oops, 2nd commit from me seems to be wrong. |
Great, thanks for making that change! |
Fixed in 1.0.8. Please verify. |
* 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.
* 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.
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: