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

Report in http header if we're in CI #129

Merged
merged 1 commit into from Oct 7, 2016
Merged

Report in http header if we're in CI #129

merged 1 commit into from Oct 7, 2016

Conversation

@iarna
Copy link
Contributor

@iarna iarna commented Jan 21, 2016

Per a lunch conversation with @ceejbot, this adds an npm-in-ci header to requests that is true or false based on the following environment checks:

CI="true": Travis, CircleCI, Gitlab CI, Snap CI, Codeship, semaphore, drone.io, Buildkite, PlatformIO
JENKINS_URL is set: Jenkins
bamboo.buildKey is set: Bamboo
TDDIUM is set: Solano

@iarna iarna added the in progress label Jan 21, 2016
@iarna iarna force-pushed the ci-header branch 2 times, most recently from f01d0f6 to 8adacae Jul 5, 2016
@coveralls
Copy link

@coveralls coveralls commented Jul 5, 2016

Coverage Status

Coverage increased (+0.03%) to 92.162% when pulling 8adacae on ci-header into 0b595c4 on master.

Copy link
Contributor

@othiym23 othiym23 left a comment

One cosmetic tweak would be nice, otherwise looks good (albeit heuristic). 🐑🚀🔥

@@ -11,6 +11,9 @@ function initialize (uri, method, accept, headers) {
this.config.sessionToken = crypto.randomBytes(8).toString('hex')
this.log.verbose('request id', this.config.sessionToken)
}
if (this.config.isFromCI == null) {
this.config.isFromCI = Boolean(process.env['CI'] === 'true' || process.env['TDDIUM'] || process.env['JENKINS_URL'] || process.env['bamboo.buildKey'])

This comment has been minimized.

@othiym23

othiym23 Sep 23, 2016
Contributor

This line is too long, unlike this comment. Wrap?

This comment has been minimized.

@iarna

iarna Sep 23, 2016
Author Contributor

agreed

@iarna iarna force-pushed the ci-header branch from 8adacae to 713e1e5 Oct 7, 2016
@iarna iarna merged commit 713e1e5 into master Oct 7, 2016
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
@iarna iarna deleted the ci-header branch Oct 7, 2016
iarna added a commit to npm/npm that referenced this pull request Oct 20, 2016
iarna added a commit to npm/npm that referenced this pull request Oct 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.