Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

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 force-pushed the ci-header branch 2 times, most recently from f01d0f6 to 8adacae Compare July 5, 2016 23:03
@coveralls
Copy link

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

Choose a reason for hiding this comment

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

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'])
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed

@iarna iarna merged commit 713e1e5 into master Oct 7, 2016
@iarna iarna deleted the ci-header branch October 7, 2016 22:35
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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants