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

Don't turn on analytics on CI unless explicitly set #1163

Merged
merged 2 commits into from
Mar 11, 2014

Conversation

nschonni
Copy link
Contributor

The recent change to prompt for analytics started breaking CI builds (#1102, #1162). Most CI servers set an environmental variable of "CI" so scripts can sniff if they are running on a CI system. This would still allow analytics collection if the configuration is explicitly set.

@@ -15,7 +15,7 @@ if (config.interactive == null) {
// If `analytics` hasn't been explicitly set, we disable
// it when ran programatically.
if (config.analytics == null) {
config.analytics = config.interactive;
config.analytics = config.interactive && !!process.env.CI;
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this backwards? Shouldn't it be ! rather than !!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it is 😦

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Amended and added a line comment

@benschwarz
Copy link
Member

Before this is merged, I'd like to see something added to the README that covers how to set up bower for CI. Do you think you'd be able to add something @nschonni?

@nschonni
Copy link
Contributor Author

Sure, does it make more sense under the "Installing Bower" or "Usage" section?

@benschwarz
Copy link
Member

The README is pretty long already, so I think it'd be best if we broke it up a little bit more… I think we could have a title for CI, what do you think?

@nschonni
Copy link
Contributor Author

Sure, I'll create a separate section after "Configuration" called "Running on a continuous integration server"

@paulirish
Copy link
Member

👍

@wibblymat
Copy link
Member

👍

@benschwarz
Copy link
Member

@nschonni If we get the docs right, this is going in.

@nschonni
Copy link
Contributor Author

I will try to push the docs after GitHub resolves it's current API issue. Below is the rough text I was thinking


Running on a continuous integration server

Bower will skip some interactive and analytics operations if it finds a CI environmental variable set to true. You will find that the CI variable is already set for you on many continuous integration servers, e.g., CircleCI and Travis-CI.

If you cannot set the CI flag, you may need to pass --config.interactive=false to the Bower CLI in your build scripts.

@nschonni
Copy link
Contributor Author

OK, I was able to push the text to the README, let me know if the text is alright.

@@ -179,6 +179,11 @@ The current spec can be read
[here](https://docs.google.com/document/d/1APq7oA9tNao1UYWyOm8dKqlRP2blVkROYLZ2fLIjtWc/edit#heading=h.4pzytc1f9j8k)
in the `Configuration` section.

## Running on a continuous integration server

Bower will skip some interactive and analytics operations if it finds a `CI` environmental variable set to `true`. You will find that the `CI` variable is already set for you on many continuous integration servers, e.g., [CircleCI](https://circleci.com/docs/environment-variables#basics) and [Travis-CI](http://docs.travis-ci.com/user/ci-environment/#Environment-variables).
Copy link
Member

Choose a reason for hiding this comment

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

My only question is "what should the environment variable value be?"
Perhaps you should add an example of that too?

Copy link
Member

Choose a reason for hiding this comment

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

Eg.

export CI=true

Sorry, worded that really strangely… trying to hurry too much

@paulirish
Copy link
Member

Landing now so we can ship 1.3.1

Docs can happen alongside.

paulirish added a commit that referenced this pull request Mar 11, 2014
Don't turn on analytics on CI unless explicitly set
@paulirish paulirish merged commit eabfee6 into bower:master Mar 11, 2014
@nschonni nschonni deleted the no-analytics-on-ci branch March 11, 2014 23:33
@paulirish
Copy link
Member

1.3.1 shipped.

bclozel added a commit to bclozel/gulp-cram that referenced this pull request Mar 12, 2014
Since bower/bower#1163 - added an `interactive:false` flag to avoid
fails on CI.
afj176 added a commit to afj176/generator-mongoose that referenced this pull request Mar 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants