diff --git a/benchmark/sirun/Dockerfile b/benchmark/sirun/Dockerfile index 93b18a244e3..743e69031d7 100644 --- a/benchmark/sirun/Dockerfile +++ b/benchmark/sirun/Dockerfile @@ -1,3 +1,4 @@ +# The version of this file in master is used across all PRs regardless of upstream branch FROM --platform=linux/amd64 ubuntu:22.04 RUN apt-get update && apt-get install --no-install-recommends -y \ @@ -25,11 +26,14 @@ RUN wget -O sirun.tar.gz https://github.com/DataDog/sirun/releases/download/v0.1 && rm sirun.tar.gz \ && mv sirun /usr/bin/sirun +# This list of installed Node.js versions should include all versions used by any active release line RUN mkdir -p /usr/local/nvm \ && wget -q -O - https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \ && . $NVM_DIR/nvm.sh \ - && nvm install --no-progress 14.20.1 \ - && nvm install --no-progress 16.17.1 \ - && nvm install --no-progress 18.10.0 \ + && nvm install --no-progress 12.22.12 \ + && nvm install --no-progress 14.21.3 \ + && nvm install --no-progress 16.20.1 \ + && nvm install --no-progress 18.16.1 \ + && nvm install --no-progress 20.4.0 \ && nvm alias default 18 \ && nvm use 18 diff --git a/benchmark/sirun/appsec-iast/common.js b/benchmark/sirun/appsec-iast/common.js index 3d9b9c93c4e..a29888a26bb 100644 --- a/benchmark/sirun/appsec-iast/common.js +++ b/benchmark/sirun/appsec-iast/common.js @@ -2,5 +2,5 @@ module.exports = { port: 3331 + parseInt(process.env.CPU_AFFINITY || '0'), - reqs: 200 + reqs: 100 } diff --git a/benchmark/sirun/appsec-iast/meta.json b/benchmark/sirun/appsec-iast/meta.json index 8af3619c66d..2908eb3cc62 100644 --- a/benchmark/sirun/appsec-iast/meta.json +++ b/benchmark/sirun/appsec-iast/meta.json @@ -2,7 +2,7 @@ "name": "appsec-iast", "cachegrind": false, "instructions": true, - "iterations": 30, + "iterations": 15, "variants": { "no-vulnerability-control": { "setup": "bash -c \"nohup node client.js >/dev/null 2>&1 &\"", diff --git a/docs/API.md b/docs/API.md index c80af395fd4..5902b284e60 100644 --- a/docs/API.md +++ b/docs/API.md @@ -134,6 +134,7 @@ tracer.use('pg', { * [net](./interfaces/plugins.net.html) * [next](./interfaces/plugins.next.html) * [opensearch](./interfaces/plugins.opensearch.html) +* [openai](./interfaces/plugins.openai.html) * [oracledb](./interfaces/plugins.oracledb.html) * [paperplane](./interfaces/plugins.paperplane.html) * [pino](./interfaces/plugins.pino.html) diff --git a/integration-tests/ci-visibility.spec.js b/integration-tests/ci-visibility.spec.js index 0c07858ad3a..8b716d560e3 100644 --- a/integration-tests/ci-visibility.spec.js +++ b/integration-tests/ci-visibility.spec.js @@ -617,6 +617,40 @@ testFrameworks.forEach(({ } ) }) + it('sets _dd.ci.itr.tests_skipped to false if the received suite is not skipped', (done) => { + receiver.setSuitesToSkip([{ + type: 'suite', + attributes: { + suite: 'ci-visibility/test/not-existing-test.js' + } + }]) + const eventsPromise = receiver + .gatherPayloadsMaxTimeout(({ url }) => url.endsWith('/api/v2/citestcycle'), (payloads) => { + const events = payloads.flatMap(({ payload }) => payload.events) + const testSession = events.find(event => event.type === 'test_session_end').content + assert.propertyVal(testSession.meta, TEST_ITR_TESTS_SKIPPED, 'false') + assert.propertyVal(testSession.meta, TEST_CODE_COVERAGE_ENABLED, 'true') + assert.propertyVal(testSession.meta, TEST_ITR_SKIPPING_ENABLED, 'true') + const testModule = events.find(event => event.type === 'test_module_end').content + assert.propertyVal(testModule.meta, TEST_ITR_TESTS_SKIPPED, 'false') + assert.propertyVal(testModule.meta, TEST_CODE_COVERAGE_ENABLED, 'true') + assert.propertyVal(testModule.meta, TEST_ITR_SKIPPING_ENABLED, 'true') + }, 25000) + + childProcess = exec( + runTestsWithCoverageCommand, + { + cwd, + env: getCiVisAgentlessConfig(receiver.port), + stdio: 'inherit' + } + ) + childProcess.on('exit', () => { + eventsPromise.then(() => { + done() + }).catch(done) + }) + }) }) describe('evp proxy', () => { @@ -921,6 +955,40 @@ testFrameworks.forEach(({ } ) }) + it('sets _dd.ci.itr.tests_skipped to false if the received suite is not skipped', (done) => { + receiver.setSuitesToSkip([{ + type: 'suite', + attributes: { + suite: 'ci-visibility/test/not-existing-test.js' + } + }]) + const eventsPromise = receiver + .gatherPayloadsMaxTimeout(({ url }) => url.endsWith('/api/v2/citestcycle'), (payloads) => { + const events = payloads.flatMap(({ payload }) => payload.events) + const testSession = events.find(event => event.type === 'test_session_end').content + assert.propertyVal(testSession.meta, TEST_ITR_TESTS_SKIPPED, 'false') + assert.propertyVal(testSession.meta, TEST_CODE_COVERAGE_ENABLED, 'true') + assert.propertyVal(testSession.meta, TEST_ITR_SKIPPING_ENABLED, 'true') + const testModule = events.find(event => event.type === 'test_module_end').content + assert.propertyVal(testModule.meta, TEST_ITR_TESTS_SKIPPED, 'false') + assert.propertyVal(testModule.meta, TEST_CODE_COVERAGE_ENABLED, 'true') + assert.propertyVal(testModule.meta, TEST_ITR_SKIPPING_ENABLED, 'true') + }, 25000) + + childProcess = exec( + runTestsWithCoverageCommand, + { + cwd, + env: getCiVisEvpProxyConfig(receiver.port), + stdio: 'inherit' + } + ) + childProcess.on('exit', () => { + eventsPromise.then(() => { + done() + }).catch(done) + }) + }) }) }) }) diff --git a/integration-tests/cucumber/cucumber.spec.js b/integration-tests/cucumber/cucumber.spec.js index c9a037e4c4f..954f28e95dc 100644 --- a/integration-tests/cucumber/cucumber.spec.js +++ b/integration-tests/cucumber/cucumber.spec.js @@ -485,6 +485,40 @@ versions.forEach(version => { } ) }) + it('sets _dd.ci.itr.tests_skipped to false if the received suite is not skipped', (done) => { + receiver.setSuitesToSkip([{ + type: 'suite', + attributes: { + suite: 'ci-visibility/features/not-existing.feature' + } + }]) + const eventsPromise = receiver + .gatherPayloadsMaxTimeout(({ url }) => url.endsWith('/api/v2/citestcycle'), (payloads) => { + const events = payloads.flatMap(({ payload }) => payload.events) + const testSession = events.find(event => event.type === 'test_session_end').content + assert.propertyVal(testSession.meta, TEST_ITR_TESTS_SKIPPED, 'false') + assert.propertyVal(testSession.meta, TEST_CODE_COVERAGE_ENABLED, 'true') + assert.propertyVal(testSession.meta, TEST_ITR_SKIPPING_ENABLED, 'true') + const testModule = events.find(event => event.type === 'test_module_end').content + assert.propertyVal(testModule.meta, TEST_ITR_TESTS_SKIPPED, 'false') + assert.propertyVal(testModule.meta, TEST_CODE_COVERAGE_ENABLED, 'true') + assert.propertyVal(testModule.meta, TEST_ITR_SKIPPING_ENABLED, 'true') + }, 25000) + + childProcess = exec( + runTestsWithCoverageCommand, + { + cwd, + env: envVars, + stdio: 'inherit' + } + ) + childProcess.on('exit', () => { + eventsPromise.then(() => { + done() + }).catch(done) + }) + }) if (!isAgentless) { context('if the agent is not event platform proxy compatible', () => { it('does not do any intelligent test runner request', (done) => { diff --git a/integration-tests/cypress/cypress.spec.js b/integration-tests/cypress/cypress.spec.js index 40db9ac6834..e978f6ce6a6 100644 --- a/integration-tests/cypress/cypress.spec.js +++ b/integration-tests/cypress/cypress.spec.js @@ -364,7 +364,7 @@ describe(`cypress@${version}`, function () { }).catch(done) }) }) - it('can skip suites received by the intelligent test runner API and still reports code coverage', (done) => { + it('can skip tests received by the intelligent test runner API and still reports code coverage', (done) => { receiver.setSuitesToSkip([{ type: 'test', attributes: { @@ -473,5 +473,55 @@ describe(`cypress@${version}`, function () { }).catch(done) }) }) + it('sets _dd.ci.itr.tests_skipped to false if the received test is not skipped', (done) => { + receiver.setSuitesToSkip([{ + type: 'test', + attributes: { + name: 'fake name', + suite: 'i/dont/exist.spec.js' + } + }]) + const eventsPromise = receiver + .gatherPayloadsMaxTimeout(({ url }) => url.endsWith('/api/v2/citestcycle'), (payloads) => { + const events = payloads.flatMap(({ payload }) => payload.events) + const testSession = events.find(event => event.type === 'test_session_end').content + assert.propertyVal(testSession.meta, TEST_ITR_TESTS_SKIPPED, 'false') + assert.propertyVal(testSession.meta, TEST_CODE_COVERAGE_ENABLED, 'true') + assert.propertyVal(testSession.meta, TEST_ITR_SKIPPING_ENABLED, 'true') + const testModule = events.find(event => event.type === 'test_module_end').content + assert.propertyVal(testModule.meta, TEST_ITR_TESTS_SKIPPED, 'false') + assert.propertyVal(testModule.meta, TEST_CODE_COVERAGE_ENABLED, 'true') + assert.propertyVal(testModule.meta, TEST_ITR_SKIPPING_ENABLED, 'true') + }, 25000) + + const skippableRequestPromise = receiver + .payloadReceived(({ url }) => url.endsWith('/api/v2/ci/tests/skippable')) + .then(skippableRequest => { + assert.propertyVal(skippableRequest.headers, 'dd-api-key', '1') + assert.propertyVal(skippableRequest.headers, 'dd-application-key', '1') + }) + + const { + NODE_OPTIONS, + ...restEnvVars + } = getCiVisAgentlessConfig(receiver.port) + + childProcess = exec( + `./node_modules/.bin/cypress run --quiet ${commandSuffix}`, + { + cwd, + env: { + ...restEnvVars, + CYPRESS_BASE_URL: `http://localhost:${webAppPort}` + }, + stdio: 'pipe' + } + ) + childProcess.on('exit', () => { + Promise.all([eventsPromise, skippableRequestPromise]).then(() => { + done() + }).catch(done) + }) + }) }) }) diff --git a/integration-tests/playwright/playwright.spec.js b/integration-tests/playwright/playwright.spec.js index 914315b105d..f78e2a78032 100644 --- a/integration-tests/playwright/playwright.spec.js +++ b/integration-tests/playwright/playwright.spec.js @@ -13,7 +13,7 @@ const { } = require('../helpers') const { FakeCiVisIntake } = require('../ci-visibility-intake') const webAppServer = require('../ci-visibility/web-app-server') -const { TEST_STATUS, TEST_SOURCE_START } = require('../../packages/dd-trace/src/plugins/util/test') +const { TEST_STATUS, TEST_SOURCE_START, TEST_TYPE } = require('../../packages/dd-trace/src/plugins/util/test') // TODO: remove when 2.x support is removed. // This is done because from playwright@>=1.22.0 node 12 is not supported @@ -73,7 +73,8 @@ versions.forEach((version) => { assert.equal(testSessionEvent.content.meta[TEST_STATUS], 'fail') assert.include(testModuleEvent.content.resource, 'test_module.playwright test') assert.equal(testModuleEvent.content.meta[TEST_STATUS], 'fail') - + assert.equal(testSessionEvent.content.meta[TEST_TYPE], 'browser') + assert.equal(testModuleEvent.content.meta[TEST_TYPE], 'browser') assert.includeMembers(testSuiteEvents.map(suite => suite.content.resource), [ 'test_suite.todo-list-page-test.js', 'test_suite.landing-page-test.js', diff --git a/package.json b/package.json index 0697863ce44..b28662fde7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dd-trace", - "version": "3.27.0", + "version": "3.28.0", "description": "Datadog APM tracing client for JavaScript", "main": "index.js", "typings": "index.d.ts", @@ -70,7 +70,7 @@ "@datadog/native-iast-rewriter": "2.0.1", "@datadog/native-iast-taint-tracking": "^1.5.0", "@datadog/native-metrics": "^2.0.0", - "@datadog/pprof": "2.2.3", + "@datadog/pprof": "3.0.0", "@datadog/sketches-js": "^2.1.0", "@opentelemetry/api": "^1.0.0", "@opentelemetry/core": "^1.14.0", @@ -94,7 +94,7 @@ "node-abort-controller": "^3.0.1", "opentracing": ">=0.12.1", "path-to-regexp": "^0.1.2", - "protobufjs": "^7.1.2", + "protobufjs": "^7.2.4", "retry": "^0.10.1", "semver": "^7.3.8" }, diff --git a/packages/datadog-instrumentations/src/cucumber.js b/packages/datadog-instrumentations/src/cucumber.js index 22296e4d1db..48b634e0676 100644 --- a/packages/datadog-instrumentations/src/cucumber.js +++ b/packages/datadog-instrumentations/src/cucumber.js @@ -37,6 +37,7 @@ const patched = new WeakSet() let pickleByFile = {} const pickleResultByFile = {} +let isSuitesSkipped = false function getSuiteStatusFromTestStatuses (testStatuses) { if (testStatuses.some(status => status === 'fail')) { @@ -264,7 +265,9 @@ addHook({ const { err, skippableSuites } = await skippableSuitesPromise if (!err) { - this.pickleIds = getPicklesToRun(this, skippableSuites) + const newPickleIds = getPicklesToRun(this, skippableSuites) + isSuitesSkipped = newPickleIds.length !== this.pickleIds.length + this.pickleIds = newPickleIds } pickleByFile = getPickleByFile(this) @@ -292,7 +295,7 @@ addHook({ asyncResource.runInAsyncScope(() => { sessionFinishCh.publish({ status: success ? 'pass' : 'fail', - isSuitesSkipped: skippableSuites ? !!skippableSuites.length : false, + isSuitesSkipped, testCodeCoverageLinesTotal }) }) diff --git a/packages/datadog-instrumentations/src/grpc/client.js b/packages/datadog-instrumentations/src/grpc/client.js index 305e76fad7f..c1a97d96b45 100644 --- a/packages/datadog-instrumentations/src/grpc/client.js +++ b/packages/datadog-instrumentations/src/grpc/client.js @@ -1,7 +1,7 @@ 'use strict' const types = require('./types') -const { addHook, channel, AsyncResource } = require('../helpers/instrument') +const { addHook, channel } = require('../helpers/instrument') const shimmer = require('../../../datadog-shimmer') const nodeMajor = parseInt(process.versions.node.split('.')[0]) @@ -10,8 +10,10 @@ const patched = new WeakSet() const instances = new WeakMap() const startChannel = channel('apm:grpc:client:request:start') +const asyncStartChannel = channel('apm:grpc:client:request:asyncStart') const errorChannel = channel('apm:grpc:client:request:error') const finishChannel = channel('apm:grpc:client:request:finish') +const emitChannel = channel('apm:grpc:client:request:emit') function createWrapMakeRequest (type) { return function wrapMakeRequest (makeRequest) { @@ -101,45 +103,39 @@ function wrapMethod (method, path, type) { return wrapped } -function wrapCallback (requestResource, parentResource, callback) { +function wrapCallback (ctx, callback = () => { }) { return function (err) { if (err) { - requestResource.runInAsyncScope(() => { - errorChannel.publish(err) - }) + ctx.error = err + errorChannel.publish(ctx) } - if (callback) { - return parentResource.runInAsyncScope(() => { - return callback.apply(this, arguments) - }) - } + return asyncStartChannel.runStores(ctx, () => { + return callback.apply(this, arguments) + // No async end channel needed + }) } } -function wrapStream (call, requestResource, parentResource) { - if (!call || typeof call.emit !== 'function') return - - shimmer.wrap(call, 'emit', emit => { - return function (eventName, ...args) { - requestResource.runInAsyncScope(() => { - switch (eventName) { - case 'error': - errorChannel.publish(args[0]) - - break - case 'status': - finishChannel.publish(args[0]) - - break - } - }) +function createWrapEmit (ctx) { + return function wrapEmit (emit) { + return function (event, arg1) { + switch (event) { + case 'error': + ctx.error = arg1 + errorChannel.publish(ctx) + break + case 'status': + ctx.result = arg1 + finishChannel.publish(ctx) + break + } - return parentResource.runInAsyncScope(() => { + return emitChannel.runStores(ctx, () => { return emit.apply(this, arguments) }) } - }) + } } function callMethod (client, method, args, path, metadata, type) { @@ -147,25 +143,31 @@ function callMethod (client, method, args, path, metadata, type) { const length = args.length const callback = args[length - 1] - const parentResource = new AsyncResource('bound-anonymous-fn') - const requestResource = new AsyncResource('bound-anonymous-fn') - return requestResource.runInAsyncScope(() => { - startChannel.publish({ metadata, path, type }) + const ctx = { metadata, path, type } - if (type === types.unary || type === types.client_stream) { - if (typeof callback === 'function') { - args[length - 1] = wrapCallback(requestResource, parentResource, callback) - } else { - args[length] = wrapCallback(requestResource, parentResource) + return startChannel.runStores(ctx, () => { + try { + if (type === types.unary || type === types.client_stream) { + if (typeof callback === 'function') { + args[length - 1] = wrapCallback(ctx, callback) + } else { + args[length] = wrapCallback(ctx) + } } - } - const call = method.apply(client, args) + const call = method.apply(client, args) - wrapStream(call, requestResource, parentResource) + if (call && typeof call.emit === 'function') { + shimmer.wrap(call, 'emit', createWrapEmit(ctx)) + } - return call + return call + } catch (e) { + ctx.error = e + errorChannel.publish(ctx) + } + // No end channel needed }) } diff --git a/packages/datadog-instrumentations/src/grpc/server.js b/packages/datadog-instrumentations/src/grpc/server.js index 8aa62c82abe..f3fc2c5a1a8 100644 --- a/packages/datadog-instrumentations/src/grpc/server.js +++ b/packages/datadog-instrumentations/src/grpc/server.js @@ -1,15 +1,17 @@ 'use strict' const types = require('./types') -const { channel, addHook, AsyncResource } = require('../helpers/instrument') +const { channel, addHook } = require('../helpers/instrument') const shimmer = require('../../../datadog-shimmer') const nodeMajor = parseInt(process.versions.node.split('.')[0]) const startChannel = channel('apm:grpc:server:request:start') +const asyncStartChannel = channel('apm:grpc:server:request:asyncStart') const errorChannel = channel('apm:grpc:server:request:error') const updateChannel = channel('apm:grpc:server:request:update') const finishChannel = channel('apm:grpc:server:request:finish') +const emitChannel = channel('apm:grpc:server:request:emit') // https://github.com/grpc/grpc/blob/master/doc/statuscodes.md const OK = 0 @@ -33,28 +35,38 @@ function wrapHandler (func, name) { const type = types[this.type] const isStream = type !== 'unary' - const parentResource = new AsyncResource('bound-anonymous-fn') - const requestResource = new AsyncResource('bound-anonymous-fn') - - return requestResource.runInAsyncScope(() => { - startChannel.publish({ name, metadata, type }) - - const onCancel = requestResource.bind(() => { - finishChannel.publish({ code: CANCELLED }) - }) - - // Finish the span if the call was cancelled. - call.once('cancelled', onCancel) + const ctx = { name, metadata, type } + + return startChannel.runStores(ctx, () => { + try { + const onCancel = () => { + ctx.code = CANCELLED + finishChannel.publish(ctx) + } + + // Finish the span if the call was cancelled. + call.once('cancelled', onCancel) + + if (isStream) { + wrapStream(call, ctx, onCancel) + } else { + arguments[1] = wrapCallback(callback, call, ctx, onCancel) + } + + shimmer.wrap(call, 'emit', emit => { + return function () { + return emitChannel.runStores(ctx, () => { + return emit.apply(this, arguments) + }) + } + }) - if (isStream) { - wrapStream(call, requestResource, onCancel) - } else { - arguments[1] = wrapCallback(callback, call, requestResource, parentResource, onCancel) + return func.apply(this, arguments) + } catch (e) { + ctx.error = e + errorChannel.publish(ctx) } - - shimmer.wrap(call, 'emit', emit => requestResource.bind(emit)) - - return func.apply(this, arguments) + // No end channel needed }) } } @@ -69,69 +81,66 @@ function wrapRegister (register) { } } -function wrapStream (call, requestResource, onCancel) { - if (call.call && call.call.sendStatus) { - call.call.sendStatus = wrapSendStatus(call.call.sendStatus, requestResource) - } - - shimmer.wrap(call, 'emit', emit => { - return function (eventName, ...args) { - switch (eventName) { +function createWrapEmit (call, ctx, onCancel) { + return function wrapEmit (emit) { + return function (event, arg1) { + switch (event) { case 'error': - errorChannel.publish(args[0]) - finishChannel.publish({ code: args[0].code }) - + ctx.error = arg1 + errorChannel.publish(ctx) + ctx.code = arg1.code + finishChannel.publish(ctx) call.removeListener('cancelled', onCancel) - break - - // Finish the span of the response only if it was successful. - // Otherwise it'll be finished in the `error` listener. case 'finish': if (call.status) { updateChannel.publish(call.status) } - if (!call.status || call.status.code === 0) { - finishChannel.publish() + finishChannel.publish(ctx) } - call.removeListener('cancelled', onCancel) - break } return emit.apply(this, arguments) } - }) + } } -function wrapCallback (callback, call, requestResource, parentResource, onCancel) { - return function (err, value, trailer, flags) { - requestResource.runInAsyncScope(() => { - if (err) { - errorChannel.publish(err) - finishChannel.publish(err) - } else { - finishChannel.publish({ code: OK, trailer }) - } +function wrapStream (call, ctx, onCancel) { + if (call.call && call.call.sendStatus) { + call.call.sendStatus = wrapSendStatus(call.call.sendStatus, ctx) + } - call.removeListener('cancelled', onCancel) - }) + shimmer.wrap(call, 'emit', createWrapEmit(call, ctx, onCancel)) +} - if (callback) { - return parentResource.runInAsyncScope(() => { - return callback.apply(this, arguments) - }) +function wrapCallback (callback = () => {}, call, ctx, onCancel) { + return function (err, value, trailer, flags) { + if (err) { + ctx.error = err + errorChannel.publish(ctx) + } else { + ctx.code = OK + ctx.trailer = trailer } + + finishChannel.publish(ctx) + + call.removeListener('cancelled', onCancel) + + return asyncStartChannel.runStores(ctx, () => { + return callback.apply(this, arguments) + // No async end channel needed + }) } } -function wrapSendStatus (sendStatus, requestResource) { +function wrapSendStatus (sendStatus, ctx) { return function (status) { - requestResource.runInAsyncScope(() => { - updateChannel.publish(status) - }) + ctx.status = status + updateChannel.publish(ctx) return sendStatus.apply(this, arguments) } diff --git a/packages/datadog-instrumentations/src/http2/client.js b/packages/datadog-instrumentations/src/http2/client.js index 0a4d9ffe0ea..e5a3cd9f4ad 100644 --- a/packages/datadog-instrumentations/src/http2/client.js +++ b/packages/datadog-instrumentations/src/http2/client.js @@ -1,32 +1,27 @@ 'use strict' const shimmer = require('../../../datadog-shimmer') -const { addHook, channel, AsyncResource } = require('../helpers/instrument') +const { addHook, channel } = require('../helpers/instrument') const connectChannel = channel('apm:http2:client:connect:start') const startChannel = channel('apm:http2:client:request:start') -const finishChannel = channel('apm:http2:client:request:finish') +const endChannel = channel('apm:http2:client:request:end') +const asyncStartChannel = channel('apm:http2:client:request:asyncStart') +const asyncEndChannel = channel('apm:http2:client:request:asyncEnd') const errorChannel = channel('apm:http2:client:request:error') -const responseChannel = channel('apm:http2:client:response') -function createWrapEmit (requestResource, parentResource) { +function createWrapEmit (ctx) { return function wrapEmit (emit) { return function (event, arg1) { - requestResource.runInAsyncScope(() => { - switch (event) { - case 'response': - responseChannel.publish(arg1) - break - case 'error': - errorChannel.publish(arg1) - case 'close': // eslint-disable-line no-fallthrough - finishChannel.publish() - break - } - }) + ctx.eventName = event + ctx.eventData = arg1 - return parentResource.runInAsyncScope(() => { - return emit.apply(this, arguments) + return asyncStartChannel.runStores(ctx, () => { + try { + return emit.apply(this, arguments) + } finally { + asyncEndChannel.publish(ctx) + } }) } } @@ -35,17 +30,21 @@ function createWrapEmit (requestResource, parentResource) { function createWrapRequest (authority, options) { return function wrapRequest (request) { return function (headers) { - const parentResource = new AsyncResource('bound-anonymous-fn') - const requestResource = new AsyncResource('bound-anonymous-fn') + const ctx = { headers, authority, options } - return requestResource.runInAsyncScope(() => { - startChannel.publish({ headers, authority, options }) + return startChannel.runStores(ctx, () => { + try { + const req = request.apply(this, arguments) - const req = request.apply(this, arguments) + shimmer.wrap(req, 'emit', createWrapEmit(ctx)) - shimmer.wrap(req, 'emit', createWrapEmit(requestResource, parentResource)) - - return req + return req + } catch (e) { + ctx.error = e + errorChannel.publish(ctx) + } finally { + endChannel.publish(ctx) + } }) } } diff --git a/packages/datadog-instrumentations/src/jest.js b/packages/datadog-instrumentations/src/jest.js index 88f8ca05787..e76240a2dad 100644 --- a/packages/datadog-instrumentations/src/jest.js +++ b/packages/datadog-instrumentations/src/jest.js @@ -42,6 +42,7 @@ const jestItrConfigurationCh = channel('ci:jest:itr-configuration') let skippableSuites = [] let isCodeCoverageEnabled = false let isSuitesSkippingEnabled = false +let isSuitesSkipped = false const sessionAsyncResource = new AsyncResource('bound-anonymous-fn') @@ -227,7 +228,6 @@ function cliWrapper (cli, jestVersion) { log.error(err) } } - const isSuitesSkipped = !!skippableSuites.length const processArgv = process.argv.slice(2).join(' ') sessionAsyncResource.runInAsyncScope(() => { @@ -430,6 +430,8 @@ addHook({ const filteredTests = getJestSuitesToRun(skippableSuites, tests, rootDir) + isSuitesSkipped = filteredTests.length !== tests.length + skippableSuites = [] return { ...testPaths, tests: filteredTests } diff --git a/packages/datadog-instrumentations/src/mocha.js b/packages/datadog-instrumentations/src/mocha.js index afd4264f1cd..769e4db04a8 100644 --- a/packages/datadog-instrumentations/src/mocha.js +++ b/packages/datadog-instrumentations/src/mocha.js @@ -46,6 +46,7 @@ const originalCoverageMap = createCoverageMap() let suitesToSkip = [] let frameworkVersion +let isSuitesSkipped = false function getSuitesByTestFile (root) { const suitesByTestFile = {} @@ -125,8 +126,6 @@ function mochaHook (Runner) { } testFileToSuiteAr.clear() - const isSuitesSkipped = !!suitesToSkip.length - let testCodeCoverageLinesTotal if (global.__coverage__) { try { @@ -360,7 +359,10 @@ addHook({ suitesToSkip = skippableSuites } // We remove the suites that we skip through ITR - runner.suite.suites = getSuitesToRun(runner.suite.suites) + const newSuites = getSuitesToRun(runner.suite.suites) + isSuitesSkipped = newSuites.length !== runner.suite.suites.length + runner.suite.suites = newSuites + global.run() } diff --git a/packages/datadog-plugin-cypress/src/plugin.js b/packages/datadog-plugin-cypress/src/plugin.js index 2a6d209079b..a094592228b 100644 --- a/packages/datadog-plugin-cypress/src/plugin.js +++ b/packages/datadog-plugin-cypress/src/plugin.js @@ -37,7 +37,7 @@ const CYPRESS_STATUS_TO_TEST_STATUS = { function getTestSpanMetadata (tracer, testName, testSuite, cypressConfig) { const childOf = getTestParentSpan(tracer) - const commonTags = getTestCommonTags(testName, testSuite, cypressConfig.version) + const commonTags = getTestCommonTags(testName, testSuite, cypressConfig.version, TEST_FRAMEWORK_NAME) return { childOf, @@ -119,6 +119,7 @@ function getSkippableTests (isSuitesSkippingEnabled, tracer, testConfiguration) } module.exports = (on, config) => { + let isTestsSkipped = false const tracer = require('../../dd-trace') const testEnvironmentMetadata = getTestEnvironmentMetadata(TEST_FRAMEWORK_NAME) @@ -306,7 +307,7 @@ module.exports = (on, config) => { testSessionSpan, testModuleSpan, { - isSuitesSkipped: !!testsToSkip.length, + isSuitesSkipped: isTestsSkipped, isSuitesSkippingEnabled, isCodeCoverageEnabled } @@ -352,6 +353,7 @@ module.exports = (on, config) => { if (testsToSkip.find(test => { return testName === test.name && testSuite === test.suite })) { + isTestsSkipped = true return { shouldSkip: true } } diff --git a/packages/datadog-plugin-cypress/test/index.spec.js b/packages/datadog-plugin-cypress/test/index.spec.js index ba8c8825c76..293855ca522 100644 --- a/packages/datadog-plugin-cypress/test/index.spec.js +++ b/packages/datadog-plugin-cypress/test/index.spec.js @@ -78,7 +78,7 @@ describe('Plugin', function () { [TEST_STATUS]: 'pass', [TEST_SUITE]: 'cypress/integration/integration-test.js', [TEST_SOURCE_FILE]: 'cypress/integration/integration-test.js', - [TEST_TYPE]: 'test', + [TEST_TYPE]: 'browser', [ORIGIN_KEY]: CI_APP_ORIGIN, [TEST_IS_RUM_ACTIVE]: 'true', [TEST_CODE_OWNERS]: JSON.stringify(['@datadog']), @@ -103,7 +103,7 @@ describe('Plugin', function () { [TEST_STATUS]: 'fail', [TEST_SUITE]: 'cypress/integration/integration-test.js', [TEST_SOURCE_FILE]: 'cypress/integration/integration-test.js', - [TEST_TYPE]: 'test', + [TEST_TYPE]: 'browser', [ORIGIN_KEY]: CI_APP_ORIGIN, [ERROR_TYPE]: 'AssertionError', [TEST_IS_RUM_ACTIVE]: 'true', diff --git a/packages/datadog-plugin-express/test/index.spec.js b/packages/datadog-plugin-express/test/index.spec.js index ec5ca7618a7..14299a50280 100644 --- a/packages/datadog-plugin-express/test/index.spec.js +++ b/packages/datadog-plugin-express/test/index.spec.js @@ -741,6 +741,42 @@ describe('Plugin', () => { }) }) + it('should work with regex having flags', done => { + const app = express() + + try { + app.use(/\/foo\/(bar|baz|bez)/i, (req, res, next) => { + next() + }) + } catch (err) { + // eslint-disable-next-line no-console + console.log('This version of Express (>4.0 <4.6) has broken support for regex routing. Skipping this test.') + this.skip && this.skip() // mocha allows dynamic skipping, tap does not + return done() + } + + app.get('/foo/bar', (req, res) => { + res.status(200).send('') + }) + + getPort().then(port => { + agent + .use(traces => { + const spans = sort(traces[0]) + + expect(spans[0]).to.have.property('resource', 'GET /foo/bar') + }) + .then(done) + .catch(done) + + appListener = app.listen(port, 'localhost', () => { + axios + .get(`http://localhost:${port}/foo/bar`) + .catch(done) + }) + }) + }) + it('long regex child of string router should not steal path', done => { const app = express() const router = express.Router() diff --git a/packages/datadog-plugin-grpc/src/client.js b/packages/datadog-plugin-grpc/src/client.js index 359d97f31d3..8cc6dfdb91f 100644 --- a/packages/datadog-plugin-grpc/src/client.js +++ b/packages/datadog-plugin-grpc/src/client.js @@ -1,5 +1,6 @@ 'use strict' +const { storage } = require('../../datadog-core') const ClientPlugin = require('../../dd-trace/src/plugins/client') const { TEXT_MAP } = require('../../../ext/formats') const { addMetadataTags, getFilter, getMethodMetadata } = require('./util') @@ -7,9 +8,20 @@ const { addMetadataTags, getFilter, getMethodMetadata } = require('./util') class GrpcClientPlugin extends ClientPlugin { static get id () { return 'grpc' } static get operation () { return 'client:request' } + static get prefix () { return `apm:grpc:client:request` } static get peerServicePrecursors () { return ['rpc.service'] } - start ({ metadata, path, type }) { + constructor (...args) { + super(...args) + + this.addTraceBind('emit', ({ parentStore }) => { + return parentStore + }) + } + + bindStart (message) { + const store = storage.getStore() + const { metadata, path, type } = message const metadataFilter = this.config.metadataFilter const method = getMethodMetadata(path, type) const span = this.startSpan(this.operationName(), { @@ -28,7 +40,7 @@ class GrpcClientPlugin extends ClientPlugin { metrics: { 'grpc.status.code': 0 } - }) + }, false) // needed as precursor for peer.service if (method.service && method.package) { @@ -39,22 +51,27 @@ class GrpcClientPlugin extends ClientPlugin { addMetadataTags(span, metadata, metadataFilter, 'request') inject(this.tracer, span, metadata) } - } - error (error) { - const span = this.activeSpan + message.span = span + message.parentStore = store + message.currentStore = { ...store, span } - if (!span) return + return message.currentStore + } - this.addCode(span, error.code) - this.addError(error) + bindAsyncStart ({ parentStore }) { + return parentStore } - finish ({ code, metadata }) { - const span = this.activeSpan + error ({ span, error }) { + this.addCode(span, error.code) + this.addError(error, span) + } + finish ({ span, result }) { if (!span) return + const { code, metadata } = result || {} const metadataFilter = this.config.metadataFilter this.addCode(span, code) @@ -63,7 +80,8 @@ class GrpcClientPlugin extends ClientPlugin { addMetadataTags(span, metadata, metadataFilter, 'response') } - super.finish() + this.tagPeerService(span) + span.finish() } configure (config) { diff --git a/packages/datadog-plugin-grpc/src/server.js b/packages/datadog-plugin-grpc/src/server.js index 421660502c8..42e00f1dafd 100644 --- a/packages/datadog-plugin-grpc/src/server.js +++ b/packages/datadog-plugin-grpc/src/server.js @@ -1,5 +1,6 @@ 'use strict' +const { storage } = require('../../datadog-core') const ServerPlugin = require('../../dd-trace/src/plugins/server') const { TEXT_MAP } = require('../../../ext/formats') const { addMetadataTags, getFilter, getMethodMetadata } = require('./util') @@ -7,6 +8,7 @@ const { addMetadataTags, getFilter, getMethodMetadata } = require('./util') class GrpcServerPlugin extends ServerPlugin { static get id () { return 'grpc' } static get operation () { return 'server:request' } + static get prefix () { return `apm:grpc:server:request` } constructor (...args) { super(...args) @@ -18,9 +20,15 @@ class GrpcServerPlugin extends ServerPlugin { this.addCode(span, code) }) + + this.addTraceBind('emit', ({ currentStore }) => { + return currentStore + }) } - start ({ name, metadata, type }) { + bindStart (message) { + const store = storage.getStore() + const { name, metadata, type } = message const metadataFilter = this.config.metadataFilter const childOf = extract(this.tracer, metadata) const method = getMethodMetadata(name, type) @@ -44,9 +52,19 @@ class GrpcServerPlugin extends ServerPlugin { }) addMetadataTags(span, metadata, metadataFilter, 'request') + + message.span = span + message.parentStore = store + message.currentStore = { ...store, span } + + return message.currentStore } - error (error) { + bindAsyncStart ({ parentStore }) { + return parentStore + } + + error ({ error }) { const span = this.activeSpan if (!span) return @@ -55,9 +73,7 @@ class GrpcServerPlugin extends ServerPlugin { this.addError(error) } - finish ({ code, trailer } = {}) { - const span = this.activeSpan - + finish ({ span, code, trailer }) { if (!span) return const metadataFilter = this.config.metadataFilter @@ -68,7 +84,7 @@ class GrpcServerPlugin extends ServerPlugin { addMetadataTags(span, trailer, metadataFilter, 'response') } - super.finish() + span.finish() } configure (config) { diff --git a/packages/datadog-plugin-http2/src/client.js b/packages/datadog-plugin-http2/src/client.js index e33107abf67..5de0ba163c6 100644 --- a/packages/datadog-plugin-http2/src/client.js +++ b/packages/datadog-plugin-http2/src/client.js @@ -8,7 +8,6 @@ const log = require('../../dd-trace/src/log') const tags = require('../../../ext/tags') const kinds = require('../../../ext/kinds') const formats = require('../../../ext/formats') -const analyticsSampler = require('../../dd-trace/src/analytics_sampler') const { COMPONENT, CLIENT_PORT_KEY } = require('../../dd-trace/src/constants') const urlFilter = require('../../dd-trace/src/plugins/util/urlfilter') @@ -25,32 +24,11 @@ const HTTP2_HEADER_STATUS = ':status' const HTTP2_METHOD_GET = 'GET' class Http2ClientPlugin extends ClientPlugin { - static get id () { - return 'http2' - } - - constructor (...args) { - super(...args) - - this.addSub('apm:http2:client:response', (headers) => { - const span = storage.getStore().span - const status = headers && headers[HTTP2_HEADER_STATUS] - - span.setTag(HTTP_STATUS_CODE, status) - - if (!this.config.validateStatus(status)) { - this.addError() - } + static get id () { return 'http2' } + static get prefix () { return `apm:http2:client:request` } - addHeaderTags(span, headers, HTTP_RESPONSE_HEADERS, this.config) - }) - } - - addTraceSub (eventName, handler) { - this.addSub(`apm:${this.constructor.id}:client:${this.operation}:${eventName}`, handler) - } - - start ({ authority, options, headers = {} }) { + bindStart (message) { + const { authority, options, headers = {} } = message const sessionDetails = extractSessionDetails(authority, options) const path = headers[HTTP2_HEADER_PATH] || '/' const pathname = path.split(/[?#]/)[0] @@ -75,7 +53,7 @@ class Http2ClientPlugin extends ClientPlugin { metrics: { [CLIENT_PORT_KEY]: parseInt(sessionDetails.port) } - }) + }, false) // TODO: Figure out a better way to do this for any span. if (!allowed) { @@ -88,14 +66,53 @@ class Http2ClientPlugin extends ClientPlugin { this.tracer.inject(span, HTTP_HEADERS, headers) } - analyticsSampler.sample(span, this.config.measured) + message.parentStore = store + message.currentStore = { ...store, span } + + return message.currentStore + } + + bindAsyncStart ({ eventName, eventData, currentStore, parentStore }) { + switch (eventName) { + case 'response': + this._onResponse(currentStore, eventData) + return parentStore + case 'error': + this._onError(currentStore, eventData) + return parentStore + case 'close': + this._onClose(currentStore, eventData) + return parentStore + } - this.enter(span, store) + return storage.getStore() } configure (config) { return super.configure(normalizeConfig(config)) } + + _onResponse (store, headers) { + const status = headers && headers[HTTP2_HEADER_STATUS] + + store.span.setTag(HTTP_STATUS_CODE, status) + + if (!this.config.validateStatus(status)) { + storage.run(store, () => this.addError()) + } + + addHeaderTags(store.span, headers, HTTP_RESPONSE_HEADERS, this.config) + } + + _onError ({ span }, error) { + span.setTag('error', error) + span.finish() + } + + _onClose ({ span }) { + this.tagPeerService(span) + span.finish() + } } function extractSessionDetails (authority, options) { diff --git a/packages/datadog-plugin-router/src/index.js b/packages/datadog-plugin-router/src/index.js index 86864b6bcea..682a4301580 100644 --- a/packages/datadog-plugin-router/src/index.js +++ b/packages/datadog-plugin-router/src/index.js @@ -156,7 +156,7 @@ function isMoreSpecificThan (routeA, routeB) { } function routeIsRegex (route) { - return route.includes('(/') && route.includes('/)') + return route.includes('(/') } module.exports = RouterPlugin diff --git a/packages/dd-trace/src/appsec/iast/analyzers/command-injection-analyzer.js b/packages/dd-trace/src/appsec/iast/analyzers/command-injection-analyzer.js index 1984d5014dc..eccf8a3814b 100644 --- a/packages/dd-trace/src/appsec/iast/analyzers/command-injection-analyzer.js +++ b/packages/dd-trace/src/appsec/iast/analyzers/command-injection-analyzer.js @@ -5,6 +5,9 @@ const { COMMAND_INJECTION } = require('../vulnerabilities') class CommandInjectionAnalyzer extends InjectionAnalyzer { constructor () { super(COMMAND_INJECTION) + } + + onConfigure () { this.addSub('datadog:child_process:execution:start', ({ command }) => this.analyze(command)) } } diff --git a/packages/dd-trace/src/appsec/iast/analyzers/cookie-analyzer.js b/packages/dd-trace/src/appsec/iast/analyzers/cookie-analyzer.js index e8997372df1..413653a7af2 100644 --- a/packages/dd-trace/src/appsec/iast/analyzers/cookie-analyzer.js +++ b/packages/dd-trace/src/appsec/iast/analyzers/cookie-analyzer.js @@ -9,7 +9,13 @@ class CookieAnalyzer extends Analyzer { constructor (type, propertyToBeSafe) { super(type) this.propertyToBeSafe = propertyToBeSafe.toLowerCase() - this.addSub('datadog:iast:set-cookie', (cookieInfo) => this.analyze(cookieInfo)) + } + + onConfigure () { + this.addSub( + { channelName: 'datadog:iast:set-cookie', moduleName: 'http' }, + (cookieInfo) => this.analyze(cookieInfo) + ) } _isVulnerable ({ cookieProperties, cookieValue }) { diff --git a/packages/dd-trace/src/appsec/iast/analyzers/ldap-injection-analyzer.js b/packages/dd-trace/src/appsec/iast/analyzers/ldap-injection-analyzer.js index 07df22aa7df..41d349e6452 100644 --- a/packages/dd-trace/src/appsec/iast/analyzers/ldap-injection-analyzer.js +++ b/packages/dd-trace/src/appsec/iast/analyzers/ldap-injection-analyzer.js @@ -5,6 +5,9 @@ const { LDAP_INJECTION } = require('../vulnerabilities') class LdapInjectionAnalyzer extends InjectionAnalyzer { constructor () { super(LDAP_INJECTION) + } + + onConfigure () { this.addSub('datadog:ldapjs:client:search', ({ base, filter }) => this.analyzeAll(base, filter)) } } diff --git a/packages/dd-trace/src/appsec/iast/analyzers/path-traversal-analyzer.js b/packages/dd-trace/src/appsec/iast/analyzers/path-traversal-analyzer.js index a10b3461921..83bf2a87085 100644 --- a/packages/dd-trace/src/appsec/iast/analyzers/path-traversal-analyzer.js +++ b/packages/dd-trace/src/appsec/iast/analyzers/path-traversal-analyzer.js @@ -1,9 +1,10 @@ 'use strict' const path = require('path') + +const InjectionAnalyzer = require('./injection-analyzer') const { getIastContext } = require('../iast-context') const { storage } = require('../../../../../datadog-core') -const InjectionAnalyzer = require('./injection-analyzer') const { PATH_TRAVERSAL } = require('../vulnerabilities') const ignoredOperations = ['dir.close', 'close'] @@ -11,7 +12,23 @@ const ignoredOperations = ['dir.close', 'close'] class PathTraversalAnalyzer extends InjectionAnalyzer { constructor () { super(PATH_TRAVERSAL) - this.addSub('apm:fs:operation:start', obj => { + + this.exclusionList = [ + path.join('node_modules', 'send') + path.sep + ] + + this.internalExclusionList = [ + 'node:fs', + 'node:internal/fs', + 'node:internal\\fs', + 'fs.js', + 'internal/fs', + 'internal\\fs' + ] + } + + onConfigure () { + this.addSub('apm:fs:operation:start', (obj) => { if (ignoredOperations.includes(obj.operation)) return const pathArguments = [] @@ -44,19 +61,6 @@ class PathTraversalAnalyzer extends InjectionAnalyzer { } this.analyze(pathArguments) }) - - this.exclusionList = [ - path.join('node_modules', 'send') + path.sep - ] - - this.internalExclusionList = [ - 'node:fs', - 'node:internal/fs', - 'node:internal\\fs', - 'fs.js', - 'internal/fs', - 'internal\\fs' - ] } _isExcluded (location) { diff --git a/packages/dd-trace/src/appsec/iast/analyzers/sql-injection-analyzer.js b/packages/dd-trace/src/appsec/iast/analyzers/sql-injection-analyzer.js index f2ba289e305..3838513efbf 100644 --- a/packages/dd-trace/src/appsec/iast/analyzers/sql-injection-analyzer.js +++ b/packages/dd-trace/src/appsec/iast/analyzers/sql-injection-analyzer.js @@ -13,6 +13,9 @@ const EXCLUDED_PATHS = getNodeModulesPaths('mysql2', 'sequelize') class SqlInjectionAnalyzer extends InjectionAnalyzer { constructor () { super(SQL_INJECTION) + } + + onConfigure () { this.addSub('apm:mysql:query:start', ({ sql }) => this.analyze(sql, 'MYSQL')) this.addSub('apm:mysql2:query:start', ({ sql }) => this.analyze(sql, 'MYSQL')) this.addSub('apm:pg:query:start', ({ query }) => this.analyze(query.text, 'POSTGRES')) @@ -41,10 +44,9 @@ class SqlInjectionAnalyzer extends InjectionAnalyzer { analyze (value, dialect) { const store = storage.getStore() - if (!(store && store.sqlAnalyzed)) { const iastContext = getIastContext(store) - if (store && !iastContext) return + if (this._isInvalidContext(store, iastContext)) return this._reportIfVulnerable(value, iastContext, dialect) } } @@ -66,6 +68,7 @@ class SqlInjectionAnalyzer extends InjectionAnalyzer { addVulnerability(context, vulnerability) } } + _getExcludedPaths () { return EXCLUDED_PATHS } diff --git a/packages/dd-trace/src/appsec/iast/analyzers/ssrf-analyzer.js b/packages/dd-trace/src/appsec/iast/analyzers/ssrf-analyzer.js index 87263369941..0164956db54 100644 --- a/packages/dd-trace/src/appsec/iast/analyzers/ssrf-analyzer.js +++ b/packages/dd-trace/src/appsec/iast/analyzers/ssrf-analyzer.js @@ -6,7 +6,9 @@ const { SSRF } = require('../vulnerabilities') class SSRFAnalyzer extends InjectionAnalyzer { constructor () { super(SSRF) + } + onConfigure () { this.addSub('apm:http:client:request:start', ({ args }) => { if (typeof args.originalUrl === 'string') { this.analyze(args.originalUrl) diff --git a/packages/dd-trace/src/appsec/iast/analyzers/unvalidated-redirect-analyzer.js b/packages/dd-trace/src/appsec/iast/analyzers/unvalidated-redirect-analyzer.js index 25f919844b1..5324546802d 100644 --- a/packages/dd-trace/src/appsec/iast/analyzers/unvalidated-redirect-analyzer.js +++ b/packages/dd-trace/src/appsec/iast/analyzers/unvalidated-redirect-analyzer.js @@ -4,14 +4,16 @@ const InjectionAnalyzer = require('./injection-analyzer') const { UNVALIDATED_REDIRECT } = require('../vulnerabilities') const { getNodeModulesPaths } = require('../path-line') const { getRanges } = require('../taint-tracking/operations') -const { HTTP_REQUEST_HEADER_VALUE } = require('../taint-tracking/origin-types') +const { HTTP_REQUEST_HEADER_VALUE } = require('../taint-tracking/source-types') const EXCLUDED_PATHS = getNodeModulesPaths('express/lib/response.js') class UnvalidatedRedirectAnalyzer extends InjectionAnalyzer { constructor () { super(UNVALIDATED_REDIRECT) + } + onConfigure () { this.addSub('datadog:http:server:response:set-header:finish', ({ name, value }) => this.analyze(name, value)) } diff --git a/packages/dd-trace/src/appsec/iast/analyzers/vulnerability-analyzer.js b/packages/dd-trace/src/appsec/iast/analyzers/vulnerability-analyzer.js index 890cd19bf8d..b9dc62643a1 100644 --- a/packages/dd-trace/src/appsec/iast/analyzers/vulnerability-analyzer.js +++ b/packages/dd-trace/src/appsec/iast/analyzers/vulnerability-analyzer.js @@ -1,33 +1,18 @@ 'use strict' -const Plugin = require('../../../../src/plugins/plugin') const { storage } = require('../../../../../datadog-core') -const iastLog = require('../iast-log') const { getFirstNonDDPathAndLine } = require('../path-line') const { addVulnerability } = require('../vulnerability-reporter') const { getIastContext } = require('../iast-context') const overheadController = require('../overhead-controller') +const { SinkIastPlugin } = require('../iast-plugin') -class Analyzer extends Plugin { +class Analyzer extends SinkIastPlugin { constructor (type) { super() this._type = type } - _wrapHandler (handler) { - return (message, name) => { - try { - handler(message, name) - } catch (e) { - iastLog.errorAndPublish(e) - } - } - } - - addSub (channelName, handler) { - super.addSub(channelName, this._wrapHandler(handler)) - } - _isVulnerable (value, context) { return false } @@ -64,17 +49,23 @@ class Analyzer extends Plugin { _getExcludedPaths () {} + _isInvalidContext (store, iastContext) { + return store && !iastContext + } + analyze (value) { const store = storage.getStore() const iastContext = getIastContext(store) - if (store && !iastContext) return + if (this._isInvalidContext(store, iastContext)) return + this._reportIfVulnerable(value, iastContext) } analyzeAll (...values) { const store = storage.getStore() const iastContext = getIastContext(store) - if (store && !iastContext) return + if (this._isInvalidContext(store, iastContext)) return + for (let i = 0; i < values.length; i++) { const value = values[i] if (this._isVulnerable(value, iastContext)) { @@ -119,6 +110,14 @@ class Analyzer extends Plugin { } return hash } + + addSub (iastSubOrChannelName, handler) { + const iastSub = typeof iastSubOrChannelName === 'string' + ? { channelName: iastSubOrChannelName } + : iastSubOrChannelName + + super.addSub({ tag: this._type, ...iastSub }, handler) + } } module.exports = Analyzer diff --git a/packages/dd-trace/src/appsec/iast/analyzers/weak-cipher-analyzer.js b/packages/dd-trace/src/appsec/iast/analyzers/weak-cipher-analyzer.js index 948c5393ee7..7a5542cc9a5 100644 --- a/packages/dd-trace/src/appsec/iast/analyzers/weak-cipher-analyzer.js +++ b/packages/dd-trace/src/appsec/iast/analyzers/weak-cipher-analyzer.js @@ -14,6 +14,9 @@ const INSECURE_CIPHERS = new Set([ class WeakCipherAnalyzer extends Analyzer { constructor () { super(WEAK_CIPHER) + } + + onConfigure () { this.addSub('datadog:crypto:cipher:start', ({ algorithm }) => this.analyze(algorithm)) } diff --git a/packages/dd-trace/src/appsec/iast/analyzers/weak-hash-analyzer.js b/packages/dd-trace/src/appsec/iast/analyzers/weak-hash-analyzer.js index 02068979280..8682529201b 100644 --- a/packages/dd-trace/src/appsec/iast/analyzers/weak-hash-analyzer.js +++ b/packages/dd-trace/src/appsec/iast/analyzers/weak-hash-analyzer.js @@ -25,6 +25,9 @@ const EXCLUDED_PATHS_FROM_STACK = [ class WeakHashAnalyzer extends Analyzer { constructor () { super(WEAK_HASH) + } + + onConfigure () { this.addSub('datadog:crypto:hashing:start', ({ algorithm }) => this.analyze(algorithm)) } diff --git a/packages/dd-trace/src/appsec/iast/iast-log.js b/packages/dd-trace/src/appsec/iast/iast-log.js index 441cc6d7000..6d6e2171de4 100644 --- a/packages/dd-trace/src/appsec/iast/iast-log.js +++ b/packages/dd-trace/src/appsec/iast/iast-log.js @@ -1,7 +1,7 @@ 'use strict' const log = require('../../log') -const telemetryLogs = require('./telemetry/logs') +const telemetryLogs = require('./telemetry/log') const { calculateDDBasePath } = require('../../util') const ddBasePath = calculateDDBasePath(__dirname) diff --git a/packages/dd-trace/src/appsec/iast/iast-plugin.js b/packages/dd-trace/src/appsec/iast/iast-plugin.js new file mode 100644 index 00000000000..e70c0d82b5f --- /dev/null +++ b/packages/dd-trace/src/appsec/iast/iast-plugin.js @@ -0,0 +1,205 @@ +'use strict' + +const { channel } = require('../../../../diagnostics_channel') + +const iastLog = require('./iast-log') +const Plugin = require('../../plugins/plugin') +const iastTelemetry = require('./telemetry') +const { getInstrumentedMetric, getExecutedMetric, TagKey, EXECUTED_SOURCE } = require('./telemetry/iast-metric') +const { storage } = require('../../../../datadog-core') +const { getIastContext } = require('./iast-context') +const instrumentations = require('../../../../datadog-instrumentations/src/helpers/instrumentations') + +/** + * Used by vulnerability sources and sinks to subscribe diagnostic channel events + * and indicate what kind of metrics the subscription provides + * - moduleName is used identify when a module is loaded and + * to increment the INSTRUMENTED_[SINK|SOURCE] metric when it occurs + * - channelName is the channel used by the hook to publish execution events + * - tag indicates the name of the metric: taint-tracking/source-types for Sources and analyzers type for Sinks + * - tagKey can be only SOURCE_TYPE (Source) or VULNERABILITY_TYPE (Sink) + */ +class IastPluginSubscription { + constructor (moduleName, channelName, tag, tagKey = TagKey.VULNERABILITY_TYPE) { + this.moduleName = moduleName + this.channelName = channelName + this.tag = tag + this.tagKey = tagKey + this.executedMetric = getExecutedMetric(this.tagKey) + this.instrumentedMetric = getInstrumentedMetric(this.tagKey) + this.moduleInstrumented = false + } + + increaseInstrumented () { + if (this.moduleInstrumented) return + + this.moduleInstrumented = true + this.instrumentedMetric.inc(this.tag) + } + + increaseExecuted (iastContext) { + this.executedMetric.inc(this.tag, iastContext) + } + + matchesModuleInstrumented (name) { + // https module is a special case because it's events are published as http + name = name === 'https' ? 'http' : name + return this.moduleName === name + } +} + +class IastPlugin extends Plugin { + constructor () { + super() + this.configured = false + this.pluginSubs = [] + } + + _wrapHandler (handler) { + return (message, name) => { + try { + handler(message, name) + } catch (e) { + iastLog.errorAndPublish(e) + } + } + } + + _getTelemetryHandler (iastSub) { + return () => { + try { + const iastContext = getIastContext(storage.getStore()) + iastSub.increaseExecuted(iastContext) + } catch (e) { + iastLog.errorAndPublish(e) + } + } + } + + _execHandlerAndIncMetric ({ handler, metric, tag, iastContext = getIastContext(storage.getStore()) }) { + try { + const result = handler() + iastTelemetry.isEnabled() && metric.inc(tag, iastContext) + return result + } catch (e) { + iastLog.errorAndPublish(e) + } + } + + addSub (iastSub, handler) { + if (typeof iastSub === 'string') { + super.addSub(iastSub, this._wrapHandler(handler)) + } else { + iastSub = this._getAndRegisterSubscription(iastSub) + if (iastSub) { + super.addSub(iastSub.channelName, this._wrapHandler(handler)) + + if (iastTelemetry.isEnabled()) { + super.addSub(iastSub.channelName, this._getTelemetryHandler(iastSub)) + } + } + } + } + + onConfigure () {} + + configure (config) { + if (typeof config !== 'object') { + config = { enabled: config } + } + if (config.enabled && !this.configured) { + this.onConfigure() + this.configured = true + } + + if (iastTelemetry.isEnabled()) { + if (config.enabled) { + this.enableTelemetry() + } else { + this.disableTelemetry() + } + } + + super.configure(config) + } + + _getAndRegisterSubscription ({ moduleName, channelName, tag, tagKey }) { + if (!channelName && !moduleName) return + + if (!moduleName) { + const firstSep = channelName.indexOf(':') + if (firstSep === -1) { + moduleName = channelName + } else { + const lastSep = channelName.indexOf(':', firstSep + 1) + moduleName = channelName.substring(firstSep + 1, lastSep !== -1 ? lastSep : channelName.length) + } + } + + const iastSub = new IastPluginSubscription(moduleName, channelName, tag, tagKey) + this.pluginSubs.push(iastSub) + return iastSub + } + + enableTelemetry () { + if (this.onInstrumentationLoadedListener) return + + this.onInstrumentationLoadedListener = ({ name }) => this._onInstrumentationLoaded(name) + const loadChannel = channel('dd-trace:instrumentation:load') + loadChannel.subscribe(this.onInstrumentationLoadedListener) + + // check for already instrumented modules + for (const name in instrumentations) { + this._onInstrumentationLoaded(name) + } + } + + disableTelemetry () { + if (!this.onInstrumentationLoadedListener) return + + const loadChannel = channel('dd-trace:instrumentation:load') + if (loadChannel.hasSubscribers) { + loadChannel.unsubscribe(this.onInstrumentationLoadedListener) + } + this.onInstrumentationLoadedListener = null + } + + _onInstrumentationLoaded (name) { + this.pluginSubs + .filter(sub => sub.matchesModuleInstrumented(name)) + .forEach(sub => sub.increaseInstrumented()) + } +} + +class SourceIastPlugin extends IastPlugin { + addSub (iastPluginSub, handler) { + return super.addSub({ tagKey: TagKey.SOURCE_TYPE, ...iastPluginSub }, handler) + } + + addInstrumentedSource (moduleName, tag) { + this._getAndRegisterSubscription({ + moduleName, + tag, + tagKey: TagKey.SOURCE_TYPE + }) + } + + execSource (sourceHandlerInfo) { + this._execHandlerAndIncMetric({ + metric: EXECUTED_SOURCE, + ...sourceHandlerInfo + }) + } +} + +class SinkIastPlugin extends IastPlugin { + addSub (iastPluginSub, handler) { + return super.addSub({ tagKey: TagKey.VULNERABILITY_TYPE, ...iastPluginSub }, handler) + } +} + +module.exports = { + SourceIastPlugin, + SinkIastPlugin, + IastPlugin +} diff --git a/packages/dd-trace/src/appsec/iast/index.js b/packages/dd-trace/src/appsec/iast/index.js index 205f16a349d..16697979ed9 100644 --- a/packages/dd-trace/src/appsec/iast/index.js +++ b/packages/dd-trace/src/appsec/iast/index.js @@ -13,8 +13,7 @@ const { taintTrackingPlugin } = require('./taint-tracking') const { IAST_ENABLED_TAG_KEY } = require('./tags') - -const telemetryLogs = require('./telemetry/logs') +const iastTelemetry = require('./telemetry') // TODO Change to `apm:http:server:request:[start|close]` when the subscription // order of the callbacks can be enforce @@ -22,24 +21,24 @@ const requestStart = dc.channel('dd-trace:incomingHttpRequestStart') const requestClose = dc.channel('dd-trace:incomingHttpRequestEnd') function enable (config, _tracer) { + iastTelemetry.configure(config, config.iast && config.iast.telemetryVerbosity) enableAllAnalyzers() - enableTaintTracking(config.iast) + enableTaintTracking(config.iast, iastTelemetry.verbosity) requestStart.subscribe(onIncomingHttpRequestStart) requestClose.subscribe(onIncomingHttpRequestEnd) overheadController.configure(config.iast) overheadController.startGlobalContext() vulnerabilityReporter.start(config, _tracer) - telemetryLogs.start() } function disable () { + iastTelemetry.stop() disableAllAnalyzers() disableTaintTracking() overheadController.finishGlobalContext() if (requestStart.hasSubscribers) requestStart.unsubscribe(onIncomingHttpRequestStart) if (requestClose.hasSubscribers) requestClose.unsubscribe(onIncomingHttpRequestEnd) vulnerabilityReporter.stop() - telemetryLogs.stop() } function onIncomingHttpRequestStart (data) { @@ -54,6 +53,7 @@ function onIncomingHttpRequestStart (data) { const iastContext = iastContextFunctions.saveIastContext(store, topContext, { rootSpan, req: data.req }) createTransaction(rootSpan.context().toSpanId(), iastContext) overheadController.initializeRequestContext(iastContext) + iastTelemetry.onRequestStart(iastContext) taintTrackingPlugin.taintHeaders(data.req.headers, iastContext) } if (rootSpan.addTags) { @@ -76,6 +76,7 @@ function onIncomingHttpRequestEnd (data) { const rootSpan = iastContext.rootSpan vulnerabilityReporter.sendVulnerabilities(vulnerabilities, rootSpan) removeTransaction(iastContext) + iastTelemetry.onRequestEnd(iastContext, iastContext.rootSpan) } // TODO web.getContext(data.req) is required when the request is aborted if (iastContextFunctions.cleanIastContext(store, topContext, iastContext)) { diff --git a/packages/dd-trace/src/appsec/iast/tags.js b/packages/dd-trace/src/appsec/iast/tags.js index d61d5727dc1..4f14e8958d7 100644 --- a/packages/dd-trace/src/appsec/iast/tags.js +++ b/packages/dd-trace/src/appsec/iast/tags.js @@ -2,5 +2,6 @@ module.exports = { IAST_ENABLED_TAG_KEY: '_dd.iast.enabled', - IAST_JSON_TAG_KEY: '_dd.iast.json' + IAST_JSON_TAG_KEY: '_dd.iast.json', + IAST_TRACE_METRIC_PREFIX: '_dd.iast.telemetry' } diff --git a/packages/dd-trace/src/appsec/iast/taint-tracking/csi-methods.js b/packages/dd-trace/src/appsec/iast/taint-tracking/csi-methods.js index e064f663dc7..39dd4378590 100644 --- a/packages/dd-trace/src/appsec/iast/taint-tracking/csi-methods.js +++ b/packages/dd-trace/src/appsec/iast/taint-tracking/csi-methods.js @@ -1,15 +1,15 @@ 'use strict' const csiMethods = [ + { src: 'concat' }, { src: 'plusOperator', operator: true }, + { src: 'replace' }, + { src: 'slice' }, + { src: 'substr' }, + { src: 'substring' }, { src: 'trim' }, - { src: 'trimStart', dst: 'trim' }, { src: 'trimEnd' }, - { src: 'concat' }, - { src: 'substring' }, - { src: 'substr' }, - { src: 'slice' }, - { src: 'replace' } + { src: 'trimStart', dst: 'trim' } ] module.exports = { diff --git a/packages/dd-trace/src/appsec/iast/taint-tracking/index.js b/packages/dd-trace/src/appsec/iast/taint-tracking/index.js index 137b5c4fe60..37747be4bb3 100644 --- a/packages/dd-trace/src/appsec/iast/taint-tracking/index.js +++ b/packages/dd-trace/src/appsec/iast/taint-tracking/index.js @@ -10,9 +10,9 @@ const { createTransaction, const taintTrackingPlugin = require('./plugin') module.exports = { - enableTaintTracking (config) { - enableRewriter() - enableTaintOperations() + enableTaintTracking (config, telemetryVerbosity) { + enableRewriter(telemetryVerbosity) + enableTaintOperations(telemetryVerbosity) taintTrackingPlugin.enable() setMaxTransactions(config.maxConcurrentRequests) }, diff --git a/packages/dd-trace/src/appsec/iast/taint-tracking/operations.js b/packages/dd-trace/src/appsec/iast/taint-tracking/operations.js index 7724c4edbda..ccc3d7ed7d6 100644 --- a/packages/dd-trace/src/appsec/iast/taint-tracking/operations.js +++ b/packages/dd-trace/src/appsec/iast/taint-tracking/operations.js @@ -3,7 +3,10 @@ const TaintedUtils = require('@datadog/native-iast-taint-tracking') const { IAST_TRANSACTION_ID } = require('../iast-context') const iastLog = require('../iast-log') -const { TaintTracking, TaintTrackingDummy } = require('./taint-tracking-impl') +const iastTelemetry = require('../telemetry') +const { REQUEST_TAINTED } = require('../telemetry/iast-metric') +const { isInfoAllowed } = require('../telemetry/verbosity') +const { getTaintTrackingImpl, getTaintTrackingNoop } = require('./taint-tracking-impl') function createTransaction (id, iastContext) { if (id && iastContext) { @@ -11,9 +14,21 @@ function createTransaction (id, iastContext) { } } +let onRemoveTransaction = (transactionId, iastContext) => {} + +function onRemoveTransactionInformationTelemetry (transactionId, iastContext) { + const metrics = TaintedUtils.getMetrics(transactionId, iastTelemetry.verbosity) + if (metrics && metrics.requestCount) { + REQUEST_TAINTED.add(metrics.requestCount, null, iastContext) + } +} + function removeTransaction (iastContext) { if (iastContext && iastContext[IAST_TRANSACTION_ID]) { const transactionId = iastContext[IAST_TRANSACTION_ID] + + onRemoveTransaction(transactionId, iastContext) + TaintedUtils.removeTransaction(transactionId) delete iastContext[IAST_TRANSACTION_ID] } @@ -96,12 +111,16 @@ function getRanges (iastContext, string) { return result } -function enableTaintOperations () { - global._ddiast = TaintTracking +function enableTaintOperations (telemetryVerbosity) { + if (isInfoAllowed(telemetryVerbosity)) { + onRemoveTransaction = onRemoveTransactionInformationTelemetry + } + + global._ddiast = getTaintTrackingImpl(telemetryVerbosity) } function disableTaintOperations () { - global._ddiast = TaintTrackingDummy + global._ddiast = getTaintTrackingNoop() } function setMaxTransactions (transactions) { diff --git a/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js b/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js index a16f2a83d6c..0ff184867f6 100644 --- a/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +++ b/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js @@ -1,6 +1,6 @@ 'use strict' -const Plugin = require('../../../plugins/plugin') +const { SourceIastPlugin } = require('../iast-plugin') const { getIastContext } = require('../iast-context') const { storage } = require('../../../../../datadog-core') const { taintObject } = require('./operations') @@ -12,15 +12,17 @@ const { HTTP_REQUEST_HEADER_NAME, HTTP_REQUEST_PARAMETER, HTTP_REQUEST_PATH_PARAM +} = require('./source-types') -} = require('./origin-types') - -class TaintTrackingPlugin extends Plugin { +class TaintTrackingPlugin extends SourceIastPlugin { constructor () { super() this._type = 'taint-tracking' + } + + onConfigure () { this.addSub( - 'datadog:body-parser:read:finish', + { channelName: 'datadog:body-parser:read:finish', tag: HTTP_REQUEST_BODY }, ({ req }) => { const iastContext = getIastContext(storage.getStore()) if (iastContext && iastContext['body'] !== req.body) { @@ -29,31 +31,41 @@ class TaintTrackingPlugin extends Plugin { } } ) + this.addSub( - 'datadog:qs:parse:finish', + { channelName: 'datadog:qs:parse:finish', tag: HTTP_REQUEST_PARAMETER }, ({ qs }) => this._taintTrackingHandler(HTTP_REQUEST_PARAMETER, qs) ) - this.addSub('apm:express:middleware:next', ({ req }) => { - if (req && req.body && typeof req.body === 'object') { - const iastContext = getIastContext(storage.getStore()) - if (iastContext && iastContext['body'] !== req.body) { - this._taintTrackingHandler(HTTP_REQUEST_BODY, req, 'body', iastContext) - iastContext['body'] = req.body + + this.addSub( + { channelName: 'apm:express:middleware:next', tag: HTTP_REQUEST_BODY }, + ({ req }) => { + if (req && req.body && typeof req.body === 'object') { + const iastContext = getIastContext(storage.getStore()) + if (iastContext && iastContext['body'] !== req.body) { + this._taintTrackingHandler(HTTP_REQUEST_BODY, req, 'body', iastContext) + iastContext['body'] = req.body + } } } - }) + ) + this.addSub( - 'datadog:cookie:parse:finish', + { channelName: 'datadog:cookie:parse:finish', tag: [HTTP_REQUEST_COOKIE_VALUE, HTTP_REQUEST_COOKIE_NAME] }, ({ cookies }) => this._cookiesTaintTrackingHandler(cookies) ) + this.addSub( - 'datadog:express:process_params:start', + { channelName: 'datadog:express:process_params:start', tag: HTTP_REQUEST_PATH_PARAM }, ({ req }) => { if (req && req.params && typeof req.params === 'object') { this._taintTrackingHandler(HTTP_REQUEST_PATH_PARAM, req, 'params') } } ) + + // this is a special case to increment INSTRUMENTED_SOURCE metric for header + this.addInstrumentedSource('http', [HTTP_REQUEST_HEADER_VALUE, HTTP_REQUEST_HEADER_NAME]) } _taintTrackingHandler (type, target, property, iastContext = getIastContext(storage.getStore())) { @@ -70,7 +82,11 @@ class TaintTrackingPlugin extends Plugin { } taintHeaders (headers, iastContext) { - taintObject(iastContext, headers, HTTP_REQUEST_HEADER_VALUE, true, HTTP_REQUEST_HEADER_NAME) + this.execSource({ + handler: () => taintObject(iastContext, headers, HTTP_REQUEST_HEADER_VALUE, true, HTTP_REQUEST_HEADER_NAME), + tag: [HTTP_REQUEST_HEADER_VALUE, HTTP_REQUEST_HEADER_NAME], + iastContext + }) } enable () { diff --git a/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter-telemetry.js b/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter-telemetry.js new file mode 100644 index 00000000000..6643fc85826 --- /dev/null +++ b/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter-telemetry.js @@ -0,0 +1,33 @@ +'use strict' + +const iastTelemetry = require('../telemetry') +const { Verbosity } = require('../telemetry/verbosity') +const { INSTRUMENTED_PROPAGATION } = require('../telemetry/iast-metric') + +const telemetryRewriter = { + off (content, filename, rewriter) { + return rewriter.rewrite(content, filename) + }, + + information (content, filename, rewriter) { + const response = this.off(content, filename, rewriter) + + const metrics = response.metrics + if (metrics && metrics.instrumentedPropagation) { + INSTRUMENTED_PROPAGATION.add(metrics.instrumentedPropagation) + } + + return response + } +} + +function getRewriteFunction (rewriter) { + switch (iastTelemetry.verbosity) { + case Verbosity.OFF: + return (content, filename) => telemetryRewriter.off(content, filename, rewriter) + default: + return (content, filename) => telemetryRewriter.information(content, filename, rewriter) + } +} + +module.exports = { getRewriteFunction } diff --git a/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js b/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js index 21b2d4f12fb..ae95ec68139 100644 --- a/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +++ b/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js @@ -5,20 +5,17 @@ const shimmer = require('../../../../../datadog-shimmer') const iastLog = require('../iast-log') const { isPrivateModule, isNotLibraryFile } = require('./filter') const { csiMethods } = require('./csi-methods') +const { getName } = require('../telemetry/verbosity') +const { getRewriteFunction } = require('./rewriter-telemetry') let rewriter let getPrepareStackTrace -function getRewriter () { +function getRewriter (telemetryVerbosity) { if (!rewriter) { - try { - const iastRewriter = require('@datadog/native-iast-rewriter') - const Rewriter = iastRewriter.Rewriter - getPrepareStackTrace = iastRewriter.getPrepareStackTrace - rewriter = new Rewriter({ csiMethods }) - } catch (e) { - iastLog.error('Unable to initialize TaintTracking Rewriter') - .errorAndPublish(e) - } + const iastRewriter = require('@datadog/native-iast-rewriter') + const Rewriter = iastRewriter.Rewriter + getPrepareStackTrace = iastRewriter.getPrepareStackTrace + rewriter = new Rewriter({ csiMethods, telemetryVerbosity: getName(telemetryVerbosity) }) } return rewriter } @@ -27,6 +24,7 @@ let originalPrepareStackTrace = Error.prepareStackTrace function getPrepareStackTraceAccessor () { let actual = getPrepareStackTrace(originalPrepareStackTrace) return { + configurable: true, get () { return actual }, @@ -38,10 +36,11 @@ function getPrepareStackTraceAccessor () { } function getCompileMethodFn (compileMethod) { + const rewriteFn = getRewriteFunction(rewriter) return function (content, filename) { try { if (isPrivateModule(filename) && isNotLibraryFile(filename)) { - const rewritten = rewriter.rewrite(content, filename) + const rewritten = rewriteFn(content, filename) if (rewritten && rewritten.content) { return compileMethod.apply(this, [rewritten.content, filename]) } @@ -54,11 +53,19 @@ function getCompileMethodFn (compileMethod) { } } -function enableRewriter () { - const rewriter = getRewriter() - if (rewriter) { - Object.defineProperty(global.Error, 'prepareStackTrace', getPrepareStackTraceAccessor()) - shimmer.wrap(Module.prototype, '_compile', compileMethod => getCompileMethodFn(compileMethod)) +function enableRewriter (telemetryVerbosity) { + try { + const rewriter = getRewriter(telemetryVerbosity) + if (rewriter) { + const pstDescriptor = Object.getOwnPropertyDescriptor(global.Error, 'prepareStackTrace') + if (!pstDescriptor || pstDescriptor.configurable) { + Object.defineProperty(global.Error, 'prepareStackTrace', getPrepareStackTraceAccessor()) + } + shimmer.wrap(Module.prototype, '_compile', compileMethod => getCompileMethodFn(compileMethod)) + } + } catch (e) { + iastLog.error('Error enabling TaintTracking Rewriter') + .errorAndPublish(e) } } diff --git a/packages/dd-trace/src/appsec/iast/taint-tracking/origin-types.js b/packages/dd-trace/src/appsec/iast/taint-tracking/source-types.js similarity index 100% rename from packages/dd-trace/src/appsec/iast/taint-tracking/origin-types.js rename to packages/dd-trace/src/appsec/iast/taint-tracking/source-types.js diff --git a/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js b/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js index 1136b6b1895..0ea3f41af78 100644 --- a/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js +++ b/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js @@ -4,30 +4,45 @@ const TaintedUtils = require('@datadog/native-iast-taint-tracking') const { storage } = require('../../../../../datadog-core') const iastContextFunctions = require('../iast-context') const iastLog = require('../iast-log') +const { EXECUTED_PROPAGATION } = require('../telemetry/iast-metric') +const { isDebugAllowed } = require('../telemetry/verbosity') function noop (res) { return res } -const TaintTrackingDummy = { +// NOTE: methods of this object must be synchronized with csi-methods.js file definitions! +// Otherwise you may end up rewriting a method and not providing its rewritten implementation +const TaintTrackingNoop = { plusOperator: noop, - trim: noop, - trimEnd: noop, concat: noop, - substring: noop, - substr: noop, + replace: noop, slice: noop, - replace: noop + substr: noop, + substring: noop, + trim: noop, + trimEnd: noop } -function getTransactionId () { - const store = storage.getStore() - const iastContext = iastContextFunctions.getIastContext(store) +function getTransactionId (iastContext) { return iastContext && iastContext[iastContextFunctions.IAST_TRANSACTION_ID] } -function getFilteredCsiFn (cb, filter) { +function getContextDefault () { + const store = storage.getStore() + return iastContextFunctions.getIastContext(store) +} + +function getContextDebug () { + const iastContext = getContextDefault() + EXECUTED_PROPAGATION.inc(null, iastContext) + return iastContext +} + +function getFilteredCsiFn (cb, filter, getContext) { return function csiCall (res, fn, target, ...rest) { try { if (filter(res, fn, target)) { return res } - const transactionId = getTransactionId() + + const context = getContext() + const transactionId = getTransactionId(context) if (transactionId) { return cb(transactionId, res, target, ...rest) } @@ -47,7 +62,7 @@ function isValidCsiMethod (fn, protos) { return protos.some(proto => fn === proto) } -function getCsiFn (cb, ...protos) { +function getCsiFn (cb, getContext, ...protos) { let filter if (!protos || protos.length === 0) { filter = (res, fn, target) => notString(res, target) @@ -57,49 +72,73 @@ function getCsiFn (cb, ...protos) { } else { filter = (res, fn, target) => notString(res, target) || !isValidCsiMethod(fn, protos) } - return getFilteredCsiFn(cb, filter) + return getFilteredCsiFn(cb, filter, getContext) } -function csiMethodsDefaults (names, excluded) { +function csiMethodsDefaults (names, excluded, getContext) { const impl = {} names.forEach(name => { if (excluded.indexOf(name) !== -1) return impl[name] = getCsiFn( (transactionId, res, target, ...rest) => TaintedUtils[name](transactionId, res, target, ...rest), + getContext, String.prototype[name] ) }) return impl } -const csiMethodsOverrides = { - plusOperator: function (res, op1, op2) { - try { - if (notString(res) || (notString(op1) && notString(op2))) { return res } - const transactionId = getTransactionId() - if (transactionId) { - return TaintedUtils.concat(transactionId, res, op1, op2) +function csiMethodsOverrides (getContext) { + return { + plusOperator: function (res, op1, op2) { + try { + if (notString(res) || (notString(op1) && notString(op2))) { return res } + const iastContext = getContext() + const transactionId = getTransactionId(iastContext) + if (transactionId) { + return TaintedUtils.concat(transactionId, res, op1, op2) + } + } catch (e) { + iastLog.error(`Error invoking CSI plusOperator`) + .errorAndPublish(e) } - } catch (e) { - iastLog.error(`Error invoking CSI plusOperator`) - .errorAndPublish(e) - } - return res - }, + return res + }, + + trim: getCsiFn( + (transactionId, res, target) => TaintedUtils.trim(transactionId, res, target), + getContext, + String.prototype.trim, + String.prototype.trimStart + ) + } +} + +function createImplWith (getContext) { + const methodNames = Object.keys(TaintTrackingNoop) + const overrides = csiMethodsOverrides(getContext) + + // impls could be cached but at the moment there is only one invocation to getTaintTrackingImpl + return { + ...csiMethodsDefaults(methodNames, Object.keys(overrides), getContext), + ...overrides + } +} + +function getTaintTrackingImpl (telemetryVerbosity, dummy = false) { + if (dummy) return TaintTrackingNoop - trim: getCsiFn( - (transactionId, res, target) => TaintedUtils.trim(transactionId, res, target), - String.prototype.trim, - String.prototype.trimStart - ) + // with Verbosity.DEBUG every invocation of a TaintedUtils method increases the EXECUTED_PROPAGATION metric + return isDebugAllowed(telemetryVerbosity) + ? createImplWith(getContextDebug) + : createImplWith(getContextDefault) } -const TaintTracking = { - ...csiMethodsDefaults(Object.keys(TaintTrackingDummy), Object.keys(csiMethodsOverrides)), - ...csiMethodsOverrides +function getTaintTrackingNoop () { + return getTaintTrackingImpl(null, true) } module.exports = { - TaintTracking, - TaintTrackingDummy + getTaintTrackingImpl, + getTaintTrackingNoop } diff --git a/packages/dd-trace/src/appsec/iast/telemetry/iast-metric.js b/packages/dd-trace/src/appsec/iast/telemetry/iast-metric.js new file mode 100644 index 00000000000..675a7a7237b --- /dev/null +++ b/packages/dd-trace/src/appsec/iast/telemetry/iast-metric.js @@ -0,0 +1,101 @@ +'use strict' + +const { getNamespaceFromContext, globalNamespace } = require('./namespaces') + +const Scope = { + GLOBAL: 'GLOBAL', + REQUEST: 'REQUEST' +} + +const PropagationType = { + STRING: 'STRING', + JSON: 'JSON', + URL: 'URL' +} + +const TagKey = { + VULNERABILITY_TYPE: 'vulnerability_type', + SOURCE_TYPE: 'source_type', + PROPAGATION_TYPE: 'propagation_type' +} + +class IastMetric { + constructor (name, scope, tagKey) { + this.name = name + this.scope = scope + this.tagKey = tagKey + } + + getNamespace (context) { + return getNamespaceFromContext(context) || globalNamespace + } + + getTag (tagValue) { + return tagValue ? { [this.tagKey]: tagValue } : undefined + } + + addValue (value, tagValue, context) { + this.getNamespace(context) + .count(this.name, this.getTag(tagValue)) + .inc(value) + } + + add (value, tagValue, context) { + if (Array.isArray(tagValue)) { + tagValue.forEach(tag => this.addValue(value, tag, context)) + } else { + this.addValue(value, tagValue, context) + } + } + + inc (tagValue, context) { + this.add(1, tagValue, context) + } +} + +function getExecutedMetric (tagKey) { + return tagKey === TagKey.VULNERABILITY_TYPE ? EXECUTED_SINK : EXECUTED_SOURCE +} + +function getInstrumentedMetric (tagKey) { + return tagKey === TagKey.VULNERABILITY_TYPE ? INSTRUMENTED_SINK : INSTRUMENTED_SOURCE +} + +const INSTRUMENTED_PROPAGATION = new IastMetric('instrumented.propagation', Scope.GLOBAL) +const INSTRUMENTED_SOURCE = new IastMetric('instrumented.source', Scope.GLOBAL, TagKey.SOURCE_TYPE) +const INSTRUMENTED_SINK = new IastMetric('instrumented.sink', Scope.GLOBAL, TagKey.VULNERABILITY_TYPE) + +const EXECUTED_SOURCE = new IastMetric('executed.source', Scope.REQUEST, TagKey.SOURCE_TYPE) +const EXECUTED_SINK = new IastMetric('executed.sink', Scope.REQUEST, TagKey.VULNERABILITY_TYPE) + +const REQUEST_TAINTED = new IastMetric('request.tainted', Scope.REQUEST) + +// DEBUG using metrics +const EXECUTED_PROPAGATION = new IastMetric('executed.propagation', Scope.REQUEST) +const EXECUTED_TAINTED = new IastMetric('executed.tainted', Scope.REQUEST) + +// DEBUG using distribution endpoint +const INSTRUMENTATION_TIME = new IastMetric('instrumentation.time', Scope.GLOBAL) + +module.exports = { + INSTRUMENTED_PROPAGATION, + INSTRUMENTED_SOURCE, + INSTRUMENTED_SINK, + + EXECUTED_PROPAGATION, + EXECUTED_SOURCE, + EXECUTED_SINK, + EXECUTED_TAINTED, + + REQUEST_TAINTED, + + INSTRUMENTATION_TIME, + + PropagationType, + TagKey, + + IastMetric, + + getExecutedMetric, + getInstrumentedMetric +} diff --git a/packages/dd-trace/src/appsec/iast/telemetry/index.js b/packages/dd-trace/src/appsec/iast/telemetry/index.js new file mode 100644 index 00000000000..6a49e16e9aa --- /dev/null +++ b/packages/dd-trace/src/appsec/iast/telemetry/index.js @@ -0,0 +1,45 @@ +'use strict' + +const telemetryMetrics = require('../../../telemetry/metrics') +const telemetryLogs = require('./log') +const { Verbosity, getVerbosity } = require('./verbosity') +const { initRequestNamespace, finalizeRequestNamespace, globalNamespace } = require('./namespaces') + +class Telemetry { + configure (config, verbosity) { + // in order to telemetry be enabled, tracer telemetry and metrics collection have to be enabled + this.enabled = config && config.telemetry && config.telemetry.enabled && config.telemetry.metrics + this.verbosity = this.enabled ? getVerbosity(verbosity) : Verbosity.OFF + + if (this.enabled) { + telemetryMetrics.manager.set('iast', globalNamespace) + } + + telemetryLogs.start() + } + + stop () { + this.enabled = false + telemetryMetrics.manager.delete('iast') + + telemetryLogs.stop() + } + + isEnabled () { + return this.enabled + } + + onRequestStart (context) { + if (this.isEnabled() && this.verbosity !== Verbosity.OFF) { + initRequestNamespace(context) + } + } + + onRequestEnd (context, rootSpan) { + if (this.isEnabled() && this.verbosity !== Verbosity.OFF) { + finalizeRequestNamespace(context, rootSpan) + } + } +} + +module.exports = new Telemetry() diff --git a/packages/dd-trace/src/appsec/iast/telemetry/logs.js b/packages/dd-trace/src/appsec/iast/telemetry/log/index.js similarity index 83% rename from packages/dd-trace/src/appsec/iast/telemetry/logs.js rename to packages/dd-trace/src/appsec/iast/telemetry/log/index.js index c14e9fcf3b1..55cc0e75c5f 100644 --- a/packages/dd-trace/src/appsec/iast/telemetry/logs.js +++ b/packages/dd-trace/src/appsec/iast/telemetry/log/index.js @@ -1,9 +1,9 @@ 'use strict' -const dc = require('../../../../../diagnostics_channel') -const logCollector = require('./log_collector') -const { sendData } = require('../../../telemetry/send-data') -const log = require('../../../log') +const dc = require('../../../../../../diagnostics_channel') +const logCollector = require('./log-collector') +const { sendData } = require('../../../../telemetry/send-data') +const log = require('../../../../log') const telemetryStartChannel = dc.channel('datadog:telemetry:start') const telemetryStopChannel = dc.channel('datadog:telemetry:stop') @@ -37,7 +37,7 @@ function isLogCollectionEnabled (config) { function onTelemetryStart (msg) { if (!msg || !isLogCollectionEnabled(msg.config)) { - log.info('IAST telemetry logs start received but log collection is not enabled or configuration is incorrect') + log.info('IAST telemetry logs start event received but log collection is not enabled or configuration is incorrect') return false } diff --git a/packages/dd-trace/src/appsec/iast/telemetry/log_collector.js b/packages/dd-trace/src/appsec/iast/telemetry/log/log-collector.js similarity index 98% rename from packages/dd-trace/src/appsec/iast/telemetry/log_collector.js rename to packages/dd-trace/src/appsec/iast/telemetry/log/log-collector.js index cf055c5ebc1..8e66b98ccae 100644 --- a/packages/dd-trace/src/appsec/iast/telemetry/log_collector.js +++ b/packages/dd-trace/src/appsec/iast/telemetry/log/log-collector.js @@ -1,6 +1,6 @@ 'use strict' -const log = require('../../../log') +const log = require('../../../../log') const logs = new Map() diff --git a/packages/dd-trace/src/appsec/iast/telemetry/namespaces.js b/packages/dd-trace/src/appsec/iast/telemetry/namespaces.js new file mode 100644 index 00000000000..d00e52aef33 --- /dev/null +++ b/packages/dd-trace/src/appsec/iast/telemetry/namespaces.js @@ -0,0 +1,76 @@ +'use strict' + +const log = require('../../../log') +const { Namespace } = require('../../../telemetry/metrics') +const { addMetricsToSpan, filterTags } = require('./span-tags') +const { IAST_TRACE_METRIC_PREFIX } = require('../tags') + +const DD_IAST_METRICS_NAMESPACE = Symbol('_dd.iast.request.metrics.namespace') + +function initRequestNamespace (context) { + if (!context) return + + const namespace = new Namespace('iast') + context[DD_IAST_METRICS_NAMESPACE] = namespace + return namespace +} + +function getNamespaceFromContext (context) { + return context && context[DD_IAST_METRICS_NAMESPACE] +} + +function finalizeRequestNamespace (context, rootSpan) { + try { + const namespace = getNamespaceFromContext(context) + if (!namespace) return + + const metrics = [...namespace.metrics.values()] + namespace.metrics.clear() + + addMetricsToSpan(rootSpan, metrics, IAST_TRACE_METRIC_PREFIX) + + merge(metrics) + } catch (e) { + log.error(e) + } finally { + if (context) { + delete context[DD_IAST_METRICS_NAMESPACE] + } + } +} + +function merge (metrics) { + metrics.forEach(metric => metric.points.forEach(point => { + globalNamespace + .count(metric.metric, getTagsObject(metric.tags)) + .inc(point[1]) + })) +} + +function getTagsObject (tags) { + if (tags && tags.length > 0) { + return filterTags(tags) + } +} + +class IastNamespace extends Namespace { + constructor () { + super('iast') + } + + reset () { + this.metrics.clear() + this.distributions.clear() + } +} + +const globalNamespace = new IastNamespace() + +module.exports = { + initRequestNamespace, + getNamespaceFromContext, + finalizeRequestNamespace, + globalNamespace, + + DD_IAST_METRICS_NAMESPACE +} diff --git a/packages/dd-trace/src/appsec/iast/telemetry/span-tags.js b/packages/dd-trace/src/appsec/iast/telemetry/span-tags.js new file mode 100644 index 00000000000..9d434bdb9ae --- /dev/null +++ b/packages/dd-trace/src/appsec/iast/telemetry/span-tags.js @@ -0,0 +1,53 @@ +'use strict' + +function addMetricsToSpan (rootSpan, metrics, tagPrefix) { + if (!rootSpan || !rootSpan.addTags || !metrics) return + + const flattenMap = new Map() + metrics + .filter(data => data && data.metric) + .forEach(data => { + const name = taggedMetricName(data) + let total = flattenMap.get(name) + const value = flatten(data) + if (!total) { + total = value + } else { + total += value + } + flattenMap.set(name, total) + }) + + for (const [key, value] of flattenMap) { + const tagName = `${tagPrefix}.${key}` + rootSpan.addTags({ + [tagName]: value + }) + } +} + +function flatten (metricData) { + return metricData.points && metricData.points.map(point => point[1]).reduce((total, value) => total + value, 0) +} + +function taggedMetricName (data) { + const metric = data.metric + const tags = data.tags && filterTags(data.tags) + return !tags || !tags.length + ? metric + : `${metric}.${processTagValue(tags)}` +} + +function filterTags (tags) { + return tags.filter(tag => !tag.startsWith('lib_language') && !tag.startsWith('version')) +} + +function processTagValue (tags) { + return tags.map(tag => tag.includes(':') ? tag.split(':')[1] : tag) + .join('_').replace(/\./g, '_') +} + +module.exports = { + addMetricsToSpan, + filterTags +} diff --git a/packages/dd-trace/src/appsec/iast/telemetry/verbosity.js b/packages/dd-trace/src/appsec/iast/telemetry/verbosity.js new file mode 100644 index 00000000000..100cd078828 --- /dev/null +++ b/packages/dd-trace/src/appsec/iast/telemetry/verbosity.js @@ -0,0 +1,42 @@ +'use strict' + +const Verbosity = { + OFF: 0, + MANDATORY: 1, + INFORMATION: 2, + DEBUG: 3 +} + +function isDebugAllowed (value) { + return value >= Verbosity.DEBUG +} + +function isInfoAllowed (value) { + return value >= Verbosity.INFORMATION +} + +function getVerbosity (verbosity) { + if (verbosity) { + verbosity = verbosity.toUpperCase() + return Verbosity[verbosity] !== undefined ? Verbosity[verbosity] : Verbosity.INFORMATION + } else { + return Verbosity.INFORMATION + } +} + +function getName (verbosityValue) { + for (const name in Verbosity) { + if (Verbosity[name] === verbosityValue) { + return name + } + } + return 'OFF' +} + +module.exports = { + Verbosity, + isDebugAllowed, + isInfoAllowed, + getVerbosity, + getName +} diff --git a/packages/dd-trace/src/config.js b/packages/dd-trace/src/config.js index 3a896be6a9c..a604dc1cbe4 100644 --- a/packages/dd-trace/src/config.js +++ b/packages/dd-trace/src/config.js @@ -247,6 +247,10 @@ class Config { process.env.DD_TELEMETRY_DEBUG, false ) + const DD_TELEMETRY_METRICS_ENABLED = coalesce( + process.env.DD_TELEMETRY_METRICS_ENABLED, + false + ) const DD_TRACE_AGENT_PROTOCOL_VERSION = coalesce( options.protocolVersion, process.env.DD_TRACE_AGENT_PROTOCOL_VERSION, @@ -319,6 +323,12 @@ class Config { const DD_TRACE_SPAN_ATTRIBUTE_SCHEMA = validateNamingVersion( process.env.DD_TRACE_SPAN_ATTRIBUTE_SCHEMA ) + const DD_TRACE_PEER_SERVICE_MAPPING = coalesce( + options.peerServiceMapping, + process.env.DD_TRACE_PEER_SERVICE_MAPPING ? fromEntries( + process.env.DD_TRACE_PEER_SERVICE_MAPPING.split(',').map(x => x.trim().split(':')) + ) : {} + ) const DD_TRACE_PEER_SERVICE_DEFAULTS_ENABLED = process.env.DD_TRACE_PEER_SERVICE_DEFAULTS_ENABLED const DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED = coalesce( @@ -461,6 +471,12 @@ ken|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?) true ) + const DD_IAST_TELEMETRY_VERBOSITY = coalesce( + iastOptions && iastOptions.telemetryVerbosity, + process.env.DD_IAST_TELEMETRY_VERBOSITY, + 'INFORMATION' + ) + const DD_CIVISIBILITY_GIT_UPLOAD_ENABLED = coalesce( process.env.DD_CIVISIBILITY_GIT_UPLOAD_ENABLED, true @@ -554,6 +570,7 @@ ken|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?) : true ) this.traceRemoveIntegrationServiceNamesEnabled = DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED + this.peerServiceMapping = DD_TRACE_PEER_SERVICE_MAPPING this.lookup = options.lookup this.startupLogs = isTrue(DD_TRACE_STARTUP_LOGS) // Disabled for CI Visibility's agentless @@ -561,7 +578,8 @@ ken|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?) enabled: DD_TRACE_EXPORTER !== 'datadog' && isTrue(DD_TRACE_TELEMETRY_ENABLED), heartbeatInterval: DD_TELEMETRY_HEARTBEAT_INTERVAL, logCollection: isTrue(DD_TELEMETRY_LOG_COLLECTION_ENABLED), - debug: isTrue(DD_TELEMETRY_DEBUG) + debug: isTrue(DD_TELEMETRY_DEBUG), + metrics: isTrue(DD_TELEMETRY_METRICS_ENABLED) } this.protocolVersion = DD_TRACE_AGENT_PROTOCOL_VERSION this.tagsHeaderMaxLength = parseInt(DD_TRACE_X_DATADOG_TAGS_MAX_LENGTH) @@ -590,7 +608,8 @@ ken|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?) maxConcurrentRequests: DD_IAST_MAX_CONCURRENT_REQUESTS, maxContextOperations: DD_IAST_MAX_CONTEXT_OPERATIONS, deduplicationEnabled: DD_IAST_DEDUPLICATION_ENABLED, - redactionEnabled: DD_IAST_REDACTION_ENABLED + redactionEnabled: DD_IAST_REDACTION_ENABLED, + telemetryVerbosity: DD_IAST_TELEMETRY_VERBOSITY } this.isCiVisibility = isTrue(DD_IS_CIVISIBILITY) diff --git a/packages/dd-trace/src/constants.js b/packages/dd-trace/src/constants.js index 33b64310ca0..89dcbdf4c7e 100644 --- a/packages/dd-trace/src/constants.js +++ b/packages/dd-trace/src/constants.js @@ -28,6 +28,7 @@ module.exports = { CLIENT_PORT_KEY: 'network.destination.port', PEER_SERVICE_KEY: 'peer.service', PEER_SERVICE_SOURCE_KEY: '_dd.peer.service.source', + PEER_SERVICE_REMAP_KEY: '_dd.peer.service.remapped_from', SCI_REPOSITORY_URL: '_dd.git.repository_url', SCI_COMMIT_SHA: '_dd.git.commit.sha' } diff --git a/packages/dd-trace/src/opentracing/tracer.js b/packages/dd-trace/src/opentracing/tracer.js index 1cb3ad959ed..91901e0a3b3 100644 --- a/packages/dd-trace/src/opentracing/tracer.js +++ b/packages/dd-trace/src/opentracing/tracer.js @@ -27,6 +27,7 @@ class DatadogTracer { this._env = config.env this._tags = config.tags this._computePeerService = config.spanComputePeerService + this._peerServiceMapping = config.peerServiceMapping this._logInjection = config.logInjection this._debug = config.debug this._prioritySampler = new PrioritySampler(config.env, config.sampler) diff --git a/packages/dd-trace/src/plugins/ci_plugin.js b/packages/dd-trace/src/plugins/ci_plugin.js index db7474618d5..4809972dd2d 100644 --- a/packages/dd-trace/src/plugins/ci_plugin.js +++ b/packages/dd-trace/src/plugins/ci_plugin.js @@ -111,7 +111,12 @@ module.exports = class CiPlugin extends Plugin { const childOf = getTestParentSpan(this.tracer) let testTags = { - ...getTestCommonTags(testName, testSuite, this.frameworkVersion), + ...getTestCommonTags( + testName, + testSuite, + this.frameworkVersion, + this.constructor.id + ), [COMPONENT]: this.constructor.id, ...extraTags } diff --git a/packages/dd-trace/src/plugins/outbound.js b/packages/dd-trace/src/plugins/outbound.js index 43a23808df3..dcd15d89fc6 100644 --- a/packages/dd-trace/src/plugins/outbound.js +++ b/packages/dd-trace/src/plugins/outbound.js @@ -3,7 +3,8 @@ const { CLIENT_PORT_KEY, PEER_SERVICE_KEY, - PEER_SERVICE_SOURCE_KEY + PEER_SERVICE_SOURCE_KEY, + PEER_SERVICE_REMAP_KEY } = require('../constants') const TracingPlugin = require('./tracing') @@ -34,9 +35,11 @@ class OutboundPlugin extends TracingPlugin { * - If `peer.service` was defined _before_ we compute it (for example in custom instrumentation), * `_dd.peer.service.source`'s value is `peer.service` */ - - if (tags['peer.service'] !== undefined) { - return { [PEER_SERVICE_SOURCE_KEY]: 'peer.service' } + if (tags[PEER_SERVICE_KEY] !== undefined) { + return { + [PEER_SERVICE_KEY]: tags[PEER_SERVICE_KEY], + [PEER_SERVICE_SOURCE_KEY]: PEER_SERVICE_KEY + } } const sourceTags = [ @@ -52,23 +55,37 @@ class OutboundPlugin extends TracingPlugin { } } } - return {} + return undefined } - startSpan (name, options) { - const span = super.startSpan(name, options) - return span + getPeerServiceRemap (peerData) { + /** + * If DD_TRACE_PEER_SERVICE_MAPPING is matched, we need to override the existing + * peer service and add the value we overrode. + */ + const peerService = peerData[PEER_SERVICE_KEY] + if (peerService && this.tracer._peerServiceMapping[peerService]) { + return { + ...peerData, + [PEER_SERVICE_KEY]: this.tracer._peerServiceMapping[peerService], + [PEER_SERVICE_REMAP_KEY]: peerService + } + } + return peerData } finish () { - const span = this.activeSpan + this.tagPeerService(this.activeSpan) + super.finish(...arguments) + } + + tagPeerService (span) { if (this.tracer._computePeerService) { const peerData = this.getPeerService(span.context()._tags) - if (peerData) { - span.addTags(peerData) + if (peerData !== undefined) { + span.addTags(this.getPeerServiceRemap(peerData)) } } - super.finish(...arguments) } connect (url) { diff --git a/packages/dd-trace/src/plugins/plugin.js b/packages/dd-trace/src/plugins/plugin.js index 2b8dc9c9c5d..f56b2d0c5b6 100644 --- a/packages/dd-trace/src/plugins/plugin.js +++ b/packages/dd-trace/src/plugins/plugin.js @@ -25,9 +25,31 @@ class Subscription { } } +class StoreBinding { + constructor (event, transform) { + this._channel = dc.channel(event) + this._transform = data => { + const store = storage.getStore() + + return !store || !store.noop + ? transform(data) + : store + } + } + + enable () { + this._channel.bindStore(storage, this._transform) + } + + disable () { + this._channel.unbindStore(storage, this._transform) + } +} + module.exports = class Plugin { constructor (tracer, tracerConfig) { this._subscriptions = [] + this._bindings = [] this._enabled = false this._tracer = tracer this.config = {} // plugin-specific configuration, unset until .configure() is called @@ -53,6 +75,10 @@ module.exports = class Plugin { this._subscriptions.push(new Subscription(channelName, handler)) } + addBind (channelName, transform) { + this._bindings.push(new StoreBinding(channelName, transform)) + } + addError (error) { const store = storage.getStore() @@ -71,9 +97,11 @@ module.exports = class Plugin { if (config.enabled && !this._enabled) { this._enabled = true this._subscriptions.forEach(sub => sub.enable()) + this._bindings.forEach(sub => sub.enable()) } else if (!config.enabled && this._enabled) { this._enabled = false this._subscriptions.forEach(sub => sub.disable()) + this._bindings.forEach(sub => sub.disable()) } } } diff --git a/packages/dd-trace/src/plugins/tracing.js b/packages/dd-trace/src/plugins/tracing.js index 8260982ce9d..e59c6a63a53 100644 --- a/packages/dd-trace/src/plugins/tracing.js +++ b/packages/dd-trace/src/plugins/tracing.js @@ -13,17 +13,7 @@ class TracingPlugin extends Plugin { this.component = this.constructor.component || this.constructor.id this.operation = this.constructor.operation - this.addTraceSub('start', message => { - this.start(message) - }) - - this.addTraceSub('error', err => { - this.error(err) - }) - - this.addTraceSub('finish', message => { - this.finish(message) - }) + this.addTraceSubs() } get activeSpan () { @@ -65,19 +55,43 @@ class TracingPlugin extends Plugin { this.addError(error) } + addTraceSubs () { + const events = ['start', 'end', 'asyncStart', 'asyncEnd', 'error', 'finish'] + + for (const event of events) { + const bindName = `bind${event.charAt(0).toUpperCase()}${event.slice(1)}` + + if (this[event]) { + this.addTraceSub(event, message => { + this[event](message) + }) + } + + if (this[bindName]) { + this.addTraceBind(event, message => this[bindName](message)) + } + } + } + addTraceSub (eventName, handler) { - this.addSub(`apm:${this.component}:${this.operation}:${eventName}`, handler) + const prefix = this.constructor.prefix || `apm:${this.component}:${this.operation}` + this.addSub(`${prefix}:${eventName}`, handler) } - addError (error) { - const span = this.activeSpan + addTraceBind (eventName, transform) { + const prefix = this.constructor.prefix || `apm:${this.component}:${this.operation}` + this.addBind(`${prefix}:${eventName}`, transform) + } + addError (error, span = this.activeSpan) { if (!span._spanContext._tags['error']) { + // Errors may be wrapped in a context. + error = (error && error.error) || error span.setTag('error', error || 1) } } - startSpan (name, { childOf, kind, meta, metrics, service, resource, type } = {}) { + startSpan (name, { childOf, kind, meta, metrics, service, resource, type } = {}, enter = true) { const store = storage.getStore() if (store && childOf === undefined) { @@ -100,7 +114,10 @@ class TracingPlugin extends Plugin { analyticsSampler.sample(span, this.config.measured) - storage.enterWith({ ...store, span }) + // TODO: Remove this after migration to TracingChannel is done. + if (enter) { + storage.enterWith({ ...store, span }) + } return span } diff --git a/packages/dd-trace/src/plugins/util/ci.js b/packages/dd-trace/src/plugins/util/ci.js index 31d0ca7b3c5..3e226f9d567 100644 --- a/packages/dd-trace/src/plugins/util/ci.js +++ b/packages/dd-trace/src/plugins/util/ci.js @@ -77,7 +77,7 @@ function filterSensitiveInfoFromRepository (repositoryUrl) { return `${protocol}//${hostname}${pathname}` } catch (e) { - return repositoryUrl + return '' } } diff --git a/packages/dd-trace/src/plugins/util/test.js b/packages/dd-trace/src/plugins/util/test.js index 0cfdaf22cce..6e7abb39358 100644 --- a/packages/dd-trace/src/plugins/util/test.js +++ b/packages/dd-trace/src/plugins/util/test.js @@ -1,11 +1,13 @@ const path = require('path') const fs = require('fs') +const { URL } = require('url') +const log = require('../../log') const istanbul = require('istanbul-lib-coverage') const ignore = require('ignore') const { getGitMetadata } = require('./git') -const { getUserProviderGitMetadata } = require('./user-provided-git') +const { getUserProviderGitMetadata, validateGitRepositoryUrl, validateGitCommitSha } = require('./user-provided-git') const { getCIMetadata } = require('./ci') const { getRuntimeAndOSMetadata } = require('./env') const { @@ -16,7 +18,8 @@ const { GIT_COMMIT_AUTHOR_EMAIL, GIT_COMMIT_AUTHOR_NAME, GIT_COMMIT_MESSAGE, - CI_WORKSPACE_PATH + CI_WORKSPACE_PATH, + CI_PIPELINE_URL } = require('./tags') const id = require('../../id') @@ -104,7 +107,8 @@ module.exports = { mergeCoverage, fromCoverageMapToCoverage, getTestLineStart, - getCallSites + getCallSites, + removeInvalidMetadata } // Returns pkg manager and its version, separated by '-', e.g. npm-8.15.0 or yarn-1.22.19 @@ -116,6 +120,39 @@ function getPkgManager () { } } +function validateUrl (url) { + try { + const urlObject = new URL(url) + return (urlObject.protocol === 'https:' || urlObject.protocol === 'http:') + } catch (e) { + return false + } +} + +function removeInvalidMetadata (metadata) { + return Object.keys(metadata).reduce((filteredTags, tag) => { + if (tag === GIT_REPOSITORY_URL) { + if (!validateGitRepositoryUrl(metadata[GIT_REPOSITORY_URL])) { + log.error('DD_GIT_REPOSITORY_URL must be a valid URL') + return filteredTags + } + } + if (tag === GIT_COMMIT_SHA) { + if (!validateGitCommitSha(metadata[GIT_COMMIT_SHA])) { + log.error('DD_GIT_COMMIT_SHA must be a full-length git SHA') + return filteredTags + } + } + if (tag === CI_PIPELINE_URL) { + if (!validateUrl(metadata[CI_PIPELINE_URL])) { + return filteredTags + } + } + filteredTags[tag] = metadata[tag] + return filteredTags + }, {}) +} + function getTestEnvironmentMetadata (testFramework, config) { // TODO: eventually these will come from the tracer (generally available) const ciMetadata = getCIMetadata() @@ -155,7 +192,7 @@ function getTestEnvironmentMetadata (testFramework, config) { if (config && config.service) { metadata['service.name'] = config.service } - return metadata + return removeInvalidMetadata(metadata) } function getTestParametersString (parametersByTestName, testName) { @@ -173,6 +210,13 @@ function getTestParametersString (parametersByTestName, testName) { } } +function getTestTypeFromFramework (testFramework) { + if (testFramework === 'playwright' || testFramework === 'cypress') { + return 'browser' + } + return 'test' +} + function finishAllTraceSpans (span) { span.context()._trace.started.forEach(traceSpan => { if (traceSpan !== span) { @@ -188,10 +232,10 @@ function getTestParentSpan (tracer) { }) } -function getTestCommonTags (name, suite, version) { +function getTestCommonTags (name, suite, version, testFramework) { return { [SPAN_TYPE]: 'test', - [TEST_TYPE]: 'test', + [TEST_TYPE]: getTestTypeFromFramework(testFramework), [SAMPLING_RULE_DECISION]: 1, [SAMPLING_PRIORITY]: AUTO_KEEP, [TEST_NAME]: name, @@ -269,12 +313,12 @@ function getCodeOwnersForFilename (filename, entries) { return null } -function getTestLevelCommonTags (command, testFrameworkVersion) { +function getTestLevelCommonTags (command, testFrameworkVersion, testFramework) { return { [TEST_FRAMEWORK_VERSION]: testFrameworkVersion, [LIBRARY_VERSION]: ddTraceVersion, [TEST_COMMAND]: command, - [TEST_TYPE]: 'test' + [TEST_TYPE]: getTestTypeFromFramework(testFramework) } } @@ -284,7 +328,7 @@ function getTestSessionCommonTags (command, testFrameworkVersion, testFramework) [RESOURCE_NAME]: `test_session.${command}`, [TEST_MODULE]: testFramework, [TEST_TOOLCHAIN]: getPkgManager(), - ...getTestLevelCommonTags(command, testFrameworkVersion) + ...getTestLevelCommonTags(command, testFrameworkVersion, testFramework) } } @@ -293,7 +337,7 @@ function getTestModuleCommonTags (command, testFrameworkVersion, testFramework) [SPAN_TYPE]: 'test_module_end', [RESOURCE_NAME]: `test_module.${command}`, [TEST_MODULE]: testFramework, - ...getTestLevelCommonTags(command, testFrameworkVersion) + ...getTestLevelCommonTags(command, testFrameworkVersion, testFramework) } } @@ -303,7 +347,7 @@ function getTestSuiteCommonTags (command, testFrameworkVersion, testSuite, testF [RESOURCE_NAME]: `test_suite.${testSuite}`, [TEST_MODULE]: testFramework, [TEST_SUITE]: testSuite, - ...getTestLevelCommonTags(command, testFrameworkVersion) + ...getTestLevelCommonTags(command, testFrameworkVersion, testFramework) } } diff --git a/packages/dd-trace/src/plugins/util/user-provided-git.js b/packages/dd-trace/src/plugins/util/user-provided-git.js index 45257f882d8..7aab955e3a5 100644 --- a/packages/dd-trace/src/plugins/util/user-provided-git.js +++ b/packages/dd-trace/src/plugins/util/user-provided-git.js @@ -13,7 +13,6 @@ const { } = require('./tags') const { normalizeRef } = require('./ci') -const log = require('../../log') const { URL } = require('url') function removeEmptyValues (tags) { @@ -53,25 +52,6 @@ function validateGitCommitSha (gitCommitSha) { return isValidSha1 || isValidSha256 } -function removeInvalidGitMetadata (metadata) { - return Object.keys(metadata).reduce((filteredTags, tag) => { - if (tag === GIT_REPOSITORY_URL) { - if (!validateGitRepositoryUrl(metadata[GIT_REPOSITORY_URL])) { - log.error('DD_GIT_REPOSITORY_URL must be a valid URL') - return filteredTags - } - } - if (tag === GIT_COMMIT_SHA) { - if (!validateGitCommitSha(metadata[GIT_COMMIT_SHA])) { - log.error('DD_GIT_COMMIT_SHA must be a full-length git SHA') - return filteredTags - } - } - filteredTags[tag] = metadata[tag] - return filteredTags - }, {}) -} - function getUserProviderGitMetadata () { const { DD_GIT_COMMIT_SHA, @@ -95,7 +75,7 @@ function getUserProviderGitMetadata () { tag = normalizeRef(DD_GIT_BRANCH) } - const metadata = removeEmptyValues({ + return removeEmptyValues({ [GIT_COMMIT_SHA]: DD_GIT_COMMIT_SHA, [GIT_BRANCH]: branch, [GIT_REPOSITORY_URL]: filterSensitiveInfoFromRepository(DD_GIT_REPOSITORY_URL), @@ -108,7 +88,6 @@ function getUserProviderGitMetadata () { [GIT_COMMIT_AUTHOR_EMAIL]: DD_GIT_COMMIT_AUTHOR_EMAIL, [GIT_COMMIT_AUTHOR_DATE]: DD_GIT_COMMIT_AUTHOR_DATE }) - return removeInvalidGitMetadata(metadata) } module.exports = { getUserProviderGitMetadata, validateGitRepositoryUrl, validateGitCommitSha } diff --git a/packages/dd-trace/src/profiling/config.js b/packages/dd-trace/src/profiling/config.js index fac6a759c0d..0f94dcbcb99 100644 --- a/packages/dd-trace/src/profiling/config.js +++ b/packages/dd-trace/src/profiling/config.js @@ -7,7 +7,6 @@ const { URL, format, pathToFileURL } = require('url') const { AgentExporter } = require('./exporters/agent') const { FileExporter } = require('./exporters/file') const { ConsoleLogger } = require('./loggers/console') -const CpuProfiler = require('./profilers/cpu') const WallProfiler = require('./profilers/wall') const SpaceProfiler = require('./profilers/space') const { oomExportStrategies, snapshotKinds } = require('./constants') @@ -202,8 +201,6 @@ function getProfiler (name, options) { return new WallProfiler(options) case 'space': return new SpaceProfiler(options) - case 'cpu-experimental': - return new CpuProfiler(options) default: options.logger.error(`Unknown profiler "${name}"`) } diff --git a/packages/dd-trace/src/profiling/index.js b/packages/dd-trace/src/profiling/index.js index b72549bef5f..1b65945c8b8 100644 --- a/packages/dd-trace/src/profiling/index.js +++ b/packages/dd-trace/src/profiling/index.js @@ -1,7 +1,6 @@ 'use strict' const { Profiler, ServerlessProfiler } = require('./profiler') -const CpuProfiler = require('./profilers/cpu') const WallProfiler = require('./profilers/wall') const SpaceProfiler = require('./profilers/space') const { AgentExporter } = require('./exporters/agent') @@ -14,7 +13,6 @@ module.exports = { profiler, AgentExporter, FileExporter, - CpuProfiler, WallProfiler, SpaceProfiler, ConsoleLogger diff --git a/packages/dd-trace/src/profiling/profilers/cpu.js b/packages/dd-trace/src/profiling/profilers/cpu.js deleted file mode 100644 index 3be1ecce548..00000000000 --- a/packages/dd-trace/src/profiling/profilers/cpu.js +++ /dev/null @@ -1,126 +0,0 @@ -'use strict' - -const { storage } = require('../../../../datadog-core') - -const dc = require('../../../../diagnostics_channel') - -const beforeCh = dc.channel('dd-trace:storage:before') -const afterCh = dc.channel('dd-trace:storage:after') - -function getActiveSpan () { - const store = storage.getStore() - if (!store) return - return store.span -} - -function getStartedSpans (activeSpan) { - const context = activeSpan.context() - if (!context) return - return context._trace.started -} - -function getSpanContextTags (span) { - return span.context()._tags -} - -function isWebServerSpan (tags) { - return tags['span.type'] === 'web' -} - -function endpointNameFromTags (tags) { - return tags['resource.name'] || [ - tags['http.method'], - tags['http.route'] - ].filter(v => v).join(' ') -} - -class NativeCpuProfiler { - constructor (options = {}) { - this.type = 'cpu' - this._frequency = options.frequency || 99 - this._mapper = undefined - this._pprof = undefined - this._started = false - this._cpuProfiler = undefined - this._endpointCollection = options.endpointCollection - - // Bind to this so the same value can be used to unsubscribe later - this._enter = this._enter.bind(this) - this._exit = this._exit.bind(this) - } - - _enter () { - if (!this._cpuProfiler) return - - const active = getActiveSpan() - if (!active) return - - const activeCtx = active.context() - if (!activeCtx) return - - const spans = getStartedSpans(active) - if (!spans || !spans.length) return - - const firstCtx = spans[0].context() - if (!firstCtx) return - - const labels = { - 'local root span id': firstCtx.toSpanId(), - 'span id': activeCtx.toSpanId() - } - - if (this._endpointCollection) { - const webServerTags = spans - .map(getSpanContextTags) - .filter(isWebServerSpan)[0] - - if (webServerTags) { - labels['trace endpoint'] = endpointNameFromTags(webServerTags) - } - } - - this._cpuProfiler.labels = labels - } - - _exit () { - if (!this._cpuProfiler) return - this._cpuProfiler.labels = {} - } - - start ({ mapper } = {}) { - if (this._started) return - this._started = true - - this._mapper = mapper - if (!this._pprof) { - this._pprof = require('@datadog/pprof') - this._cpuProfiler = new this._pprof.CpuProfiler() - } - - this._cpuProfiler.start(this._frequency) - - this._enter() - beforeCh.subscribe(this._enter) - afterCh.subscribe(this._exit) - } - - profile () { - if (!this._started) return - return this._cpuProfiler.profile() - } - - encode (profile) { - return this._pprof.encode(profile) - } - - stop () { - if (!this._started) return - this._started = false - - this._cpuProfiler.stop() - beforeCh.unsubscribe(this._enter) - afterCh.unsubscribe(this._exit) - } -} - -module.exports = NativeCpuProfiler diff --git a/packages/dd-trace/src/profiling/profilers/wall.js b/packages/dd-trace/src/profiling/profilers/wall.js index 1f4457060ae..820c035040f 100644 --- a/packages/dd-trace/src/profiling/profilers/wall.js +++ b/packages/dd-trace/src/profiling/profilers/wall.js @@ -3,12 +3,19 @@ class NativeWallProfiler { constructor (options = {}) { this.type = 'wall' - this._samplingInterval = options.samplingInterval || 1e6 / 99 // 99hz + this._samplingIntervalMicros = options.samplingInterval || 1e6 / 99 // 99hz + this._flushIntervalMillis = options.flushInterval || 60 * 1e3 // 60 seconds + this._codeHotspotsEnabled = !!options.codeHotspotsEnabled this._mapper = undefined this._pprof = undefined + + this._logger = options.logger + this._started = false } start ({ mapper } = {}) { + if (this._started) return + this._mapper = mapper this._pprof = require('@datadog/pprof') @@ -20,12 +27,20 @@ class NativeWallProfiler { process._stopProfilerIdleNotifier = () => {} } - this._record() + this._pprof.time.start({ + intervalMicros: this._samplingIntervalMicros, + durationMillis: this._flushIntervalMillis, + sourceMapper: this._mapper, + customLabels: this._codeHotspotsEnabled, + lineNumbers: false + }) + + this._started = true } profile () { - if (!this._stop) return - return this._stop(true) + if (!this._started) return + return this._pprof.time.stop(true) } encode (profile) { @@ -33,14 +48,11 @@ class NativeWallProfiler { } stop () { - if (!this._stop) return - this._stop() - this._stop = undefined - } + if (!this._started) return - _record () { - this._stop = this._pprof.time.start(this._samplingInterval, null, - this._mapper, false) + const profile = this._pprof.time.stop() + this._started = false + return profile } } diff --git a/packages/dd-trace/test/appsec/iast/analyzers/ldap-injection-analyzer.spec.js b/packages/dd-trace/test/appsec/iast/analyzers/ldap-injection-analyzer.spec.js index 48223e1f103..59413db0a4f 100644 --- a/packages/dd-trace/test/appsec/iast/analyzers/ldap-injection-analyzer.spec.js +++ b/packages/dd-trace/test/appsec/iast/analyzers/ldap-injection-analyzer.spec.js @@ -19,6 +19,8 @@ describe('ldap-injection-analyzer', () => { './injection-analyzer': InjectionAnalyzer }) + ldapInjectionAnalyzer.configure(true) + it('should subscribe to ldapjs client search channel', () => { expect(ldapInjectionAnalyzer._subscriptions).to.have.lengthOf(1) expect(ldapInjectionAnalyzer._subscriptions[0]._channel.name).to.equals('datadog:ldapjs:client:search') @@ -71,4 +73,37 @@ describe('ldap-injection-analyzer', () => { expect(addVulnerability).to.have.been.calledOnce expect(addVulnerability).to.have.been.calledWithMatch({}, { type: 'LDAP_INJECTION' }) }) + + it('should call analyzeAll when datadog:ldapjs:client:search event is published', () => { + const store = {} + const iastContext = {} + const getStore = sinon.stub().returns(store) + const getIastContext = sinon.stub().returns(iastContext) + + const iastPlugin = proxyquire('../../../../src/appsec/iast/iast-plugin', { + '../../../../datadog-core': { storage: { getStore } }, + './iast-context': { getIastContext } + }) + + const ProxyAnalyzer = proxyquire('../../../../src/appsec/iast/analyzers/vulnerability-analyzer', { + '../iast-plugin': iastPlugin, + '../overhead-controller': { hasQuota: () => true } + }) + const InjectionAnalyzer = proxyquire('../../../../src/appsec/iast/analyzers/injection-analyzer', { + '../taint-tracking/operations': TaintTrackingMock, + './vulnerability-analyzer': ProxyAnalyzer + }) + + const ldapInjectionAnalyzer = proxyquire('../../../../src/appsec/iast/analyzers/ldap-injection-analyzer', { + './injection-analyzer': InjectionAnalyzer + }) + const analyzeAll = sinon.stub(ldapInjectionAnalyzer, 'analyzeAll') + ldapInjectionAnalyzer.configure(true) + + const onLdapClientSearch = ldapInjectionAnalyzer._subscriptions[0]._handler + + onLdapClientSearch({ base: 'base', filter: 'filter', name: 'datadog:ldapjs:client:search' }) + + expect(analyzeAll.firstCall).to.be.calledWith('base', 'filter') + }) }) diff --git a/packages/dd-trace/test/appsec/iast/analyzers/sql-injection-analyzer.spec.js b/packages/dd-trace/test/appsec/iast/analyzers/sql-injection-analyzer.spec.js index bd621a8ac35..f743f0d9288 100644 --- a/packages/dd-trace/test/appsec/iast/analyzers/sql-injection-analyzer.spec.js +++ b/packages/dd-trace/test/appsec/iast/analyzers/sql-injection-analyzer.spec.js @@ -26,6 +26,8 @@ describe('sql-injection-analyzer', () => { sinon.restore() }) + sqlInjectionAnalyzer.configure(true) + it('should subscribe to mysql, mysql2 and pg start query channel', () => { expect(sqlInjectionAnalyzer._subscriptions).to.have.lengthOf(5) expect(sqlInjectionAnalyzer._subscriptions[0]._channel.name).to.equals('apm:mysql:query:start') @@ -98,4 +100,62 @@ describe('sql-injection-analyzer', () => { sqlInjectionAnalyzer.configure(false) expect(iastLog.errorAndPublish).not.to.be.called }) + + describe('analyze', () => { + let sqlInjectionAnalyzer, analyze + + const store = {} + const iastContext = {} + + beforeEach(() => { + const getStore = sinon.stub().returns(store) + const getIastContext = sinon.stub().returns(iastContext) + + const iastPlugin = proxyquire('../../../../src/appsec/iast/iast-plugin', { + '../../../../datadog-core': { storage: { getStore } }, + './iast-context': { getIastContext } + }) + + const ProxyAnalyzer = proxyquire('../../../../src/appsec/iast/analyzers/vulnerability-analyzer', { + '../iast-plugin': iastPlugin, + '../overhead-controller': { hasQuota: () => true } + }) + const InjectionAnalyzer = proxyquire('../../../../src/appsec/iast/analyzers/injection-analyzer', { + '../taint-tracking/operations': TaintTrackingMock, + './vulnerability-analyzer': ProxyAnalyzer + }) + + sqlInjectionAnalyzer = proxyquire('../../../../src/appsec/iast/analyzers/sql-injection-analyzer', { + './injection-analyzer': InjectionAnalyzer + }) + analyze = sinon.stub(sqlInjectionAnalyzer, 'analyze') + sqlInjectionAnalyzer.configure(true) + }) + + afterEach(sinon.restore) + + it('should call analyze on apm:mysql:query:start', () => { + const onMysqlQueryStart = sqlInjectionAnalyzer._subscriptions[0]._handler + + onMysqlQueryStart({ sql: 'SELECT 1', name: 'apm:mysql:query:start' }) + + expect(analyze).to.be.calledOnceWith('SELECT 1') + }) + + it('should call analyze on apm:mysql2:query:start', () => { + const onMysql2QueryStart = sqlInjectionAnalyzer._subscriptions[0]._handler + + onMysql2QueryStart({ sql: 'SELECT 1', name: 'apm:mysql2:query:start' }) + + expect(analyze).to.be.calledOnceWith('SELECT 1') + }) + + it('should call analyze on apm:pg:query:start', () => { + const onPgQueryStart = sqlInjectionAnalyzer._subscriptions[0]._handler + + onPgQueryStart({ sql: 'SELECT 1', name: 'apm:pg:query:start' }) + + expect(analyze).to.be.calledOnceWith('SELECT 1') + }) + }) }) diff --git a/packages/dd-trace/test/appsec/iast/analyzers/unvalidated-redirect-analyzer.spec.js b/packages/dd-trace/test/appsec/iast/analyzers/unvalidated-redirect-analyzer.spec.js index d8b1d9f15db..25d91bf4cc2 100644 --- a/packages/dd-trace/test/appsec/iast/analyzers/unvalidated-redirect-analyzer.spec.js +++ b/packages/dd-trace/test/appsec/iast/analyzers/unvalidated-redirect-analyzer.spec.js @@ -4,7 +4,7 @@ const { expect } = require('chai') const proxyquire = require('proxyquire') const overheadController = require('../../../../src/appsec/iast/overhead-controller') const { HTTP_REQUEST_HEADER_VALUE, HTTP_REQUEST_PARAMETER } = - require('../../../../src/appsec/iast/taint-tracking/origin-types') + require('../../../../src/appsec/iast/taint-tracking/source-types') describe('unvalidated-redirect-analyzer', () => { const NOT_TAINTED_LOCATION = 'url.com' @@ -67,6 +67,8 @@ describe('unvalidated-redirect-analyzer', () => { '../taint-tracking/operations': TaintTrackingMock }) + unvalidatedRedirectAnalyzer.configure(true) + it('should subscribe to set-header:finish channel', () => { expect(unvalidatedRedirectAnalyzer._subscriptions).to.have.lengthOf(1) expect(unvalidatedRedirectAnalyzer._subscriptions[0]._channel.name).to diff --git a/packages/dd-trace/test/appsec/iast/analyzers/vulnerability-analyzer.spec.js b/packages/dd-trace/test/appsec/iast/analyzers/vulnerability-analyzer.spec.js index dc5bc7187b6..9bddf81e861 100644 --- a/packages/dd-trace/test/appsec/iast/analyzers/vulnerability-analyzer.spec.js +++ b/packages/dd-trace/test/appsec/iast/analyzers/vulnerability-analyzer.spec.js @@ -131,16 +131,23 @@ describe('vulnerability-analyzer', () => { }) const wrapped = vulnerabilityAnalyzer._wrapHandler(handler) + const iastContext = { + name: 'test' + } + iastContextHandler.getIastContext.returns(iastContext) + expect(typeof wrapped).to.be.equal('function') const message = {} const name = 'test' expect(() => wrapped(message, name)).to.not.throw() - expect(handler).to.be.calledOnceWithExactly(message, name) + const args = handler.firstCall.args + expect(args[0]).to.be.equal(message) + expect(args[1]).to.be.equal(name) }) it('should catch thrown Errors inside subscription handlers', () => { const vulnerabilityAnalyzer = new VulnerabilityAnalyzer(ANALYZER_TYPE) - vulnerabilityAnalyzer.addSub('dd-trace:test:error:sub', () => { + vulnerabilityAnalyzer.addSub({ channelName: 'dd-trace:test:error:sub' }, () => { throw new Error('handler Error') }) @@ -151,6 +158,53 @@ describe('vulnerability-analyzer', () => { expect(() => { dc.channel('dd-trace:test:error:sub').publish({}) }).to.not.throw() }) + describe('addSub', () => { + let iastPluginAddSub + beforeEach(() => { + iastPluginAddSub = sinon.spy() + + class SinkIastPlugin { + addSub (iastSub, handler) { + iastPluginAddSub(iastSub, handler) + } + } + + VulnerabilityAnalyzer = proxyquire('../../../../src/appsec/iast/analyzers/vulnerability-analyzer', { + '../vulnerability-reporter': vulnerabilityReporter, + '../path-line': pathLine, + '../overhead-controller': overheadController, + '../iast-context': iastContextHandler, + '../iast-plugin': { + SinkIastPlugin + } + }) + }) + + it('should accept a string argument and convert it to iastSub object', () => { + const vulnerabilityAnalyzer = new VulnerabilityAnalyzer(ANALYZER_TYPE) + const handler = () => {} + vulnerabilityAnalyzer.addSub('dd-trace:test:channelName', handler) + + expect(iastPluginAddSub).to.have.been.calledOnce + expect(iastPluginAddSub.firstCall.args).to.be.deep.equal([{ + channelName: 'dd-trace:test:channelName', + tag: ANALYZER_TYPE + }, handler]) + }) + + it('should accept a iastSub object', () => { + const vulnerabilityAnalyzer = new VulnerabilityAnalyzer(ANALYZER_TYPE) + const handler = () => {} + vulnerabilityAnalyzer.addSub({ channelName: 'dd-trace:test:channelName' }, handler) + + expect(iastPluginAddSub).to.have.been.calledOnce + expect(iastPluginAddSub.firstCall.args).to.be.deep.equal([{ + channelName: 'dd-trace:test:channelName', + tag: ANALYZER_TYPE + }, handler]) + }) + }) + describe('createVulnerability', () => { let vulnerabilityAnalyzer @@ -211,4 +265,39 @@ describe('vulnerability-analyzer', () => { expect(vulnerability.location.spanId).to.be.equal(0) }) }) + + describe('analyzeAll', () => { + const value1 = 'test' + const value2 = 'test2' + + it('should not throw with undefined values', () => { + const vulnerabilityAnalyzer = new VulnerabilityAnalyzer(ANALYZER_TYPE) + + expect(() => vulnerabilityAnalyzer.analyzeAll(undefined, value1, undefined)).to.not.throw + }) + + it('should analyze batch of values', () => { + const vulnerabilityAnalyzer = new VulnerabilityAnalyzer(ANALYZER_TYPE) + const context = { + rootSpan: { + context: sinon.mock().returns({ + toSpanId: sinon.mock().returns(SPAN_ID) + }) + } + } + iastContextHandler.getIastContext.returns(context) + sinon.stub(vulnerabilityAnalyzer, '_isVulnerable').returns((value) => value === 'test') + sinon.stub(vulnerabilityAnalyzer, '_checkOCE').returns(true) + sinon.stub(vulnerabilityAnalyzer, '_createVulnerability') + + vulnerabilityAnalyzer.analyzeAll(value1, value2) + + expect(vulnerabilityAnalyzer._createVulnerability).to.have.been.calledOnceWith( + ANALYZER_TYPE, + { value: 'test' }, + SPAN_ID, + VULNERABILITY_LOCATION + ) + }) + }) }) diff --git a/packages/dd-trace/test/appsec/iast/analyzers/weak-cipher-analyzers.spec.js b/packages/dd-trace/test/appsec/iast/analyzers/weak-cipher-analyzers.spec.js index bb3ab7262dd..b803b7705c9 100644 --- a/packages/dd-trace/test/appsec/iast/analyzers/weak-cipher-analyzers.spec.js +++ b/packages/dd-trace/test/appsec/iast/analyzers/weak-cipher-analyzers.spec.js @@ -8,6 +8,8 @@ describe('weak-cipher-analyzer', () => { const VULNERABLE_CIPHER = 'des-ede-cbc' const NON_VULNERABLE_CIPHER = 'sha512' + weakCipherAnalyzer.configure(true) + it('should subscribe to crypto hashing channel', () => { expect(weakCipherAnalyzer._subscriptions).to.have.lengthOf(1) expect(weakCipherAnalyzer._subscriptions[0]._channel.name).to.equals('datadog:crypto:cipher:start') diff --git a/packages/dd-trace/test/appsec/iast/analyzers/weak-hash-analyzer.spec.js b/packages/dd-trace/test/appsec/iast/analyzers/weak-hash-analyzer.spec.js index 032b51b429c..18cf741ce85 100644 --- a/packages/dd-trace/test/appsec/iast/analyzers/weak-hash-analyzer.spec.js +++ b/packages/dd-trace/test/appsec/iast/analyzers/weak-hash-analyzer.spec.js @@ -9,6 +9,8 @@ describe('weak-hash-analyzer', () => { const VULNERABLE_ALGORITHM = 'sha1' const NON_VULNERABLE_ALGORITHM = 'sha512' + weakHashAnalyzer.configure(true) + it('should subscribe to crypto hashing channel', () => { expect(weakHashAnalyzer._subscriptions).to.have.lengthOf(1) expect(weakHashAnalyzer._subscriptions[0]._channel.name).to.equals('datadog:crypto:hashing:start') diff --git a/packages/dd-trace/test/appsec/iast/iast-log.spec.js b/packages/dd-trace/test/appsec/iast/iast-log.spec.js index 0e079625c34..b3925c8f1e7 100644 --- a/packages/dd-trace/test/appsec/iast/iast-log.spec.js +++ b/packages/dd-trace/test/appsec/iast/iast-log.spec.js @@ -47,8 +47,8 @@ describe('IAST log', () => { warn: sinon.stub(), error: sinon.stub() } - telemetryLogs = proxyquire('../../../src/appsec/iast/telemetry/logs', { - '../../../../../diagnostics_channel': { + telemetryLogs = proxyquire('../../../src/appsec/iast/telemetry/log', { + '../../../../../../diagnostics_channel': { channel: (name) => name === 'datadog:telemetry:start' ? telemetryStartChannel : telemetryStopChannel } }) @@ -57,7 +57,7 @@ describe('IAST log', () => { telemetryLogs.start() iastLog = proxyquire('../../../src/appsec/iast/iast-log', { - './telemetry/logs': telemetryLogs, + './telemetry/log': telemetryLogs, '../../log': log }) }) diff --git a/packages/dd-trace/test/appsec/iast/iast-plugin.spec.js b/packages/dd-trace/test/appsec/iast/iast-plugin.spec.js new file mode 100644 index 00000000000..26256d537ba --- /dev/null +++ b/packages/dd-trace/test/appsec/iast/iast-plugin.spec.js @@ -0,0 +1,378 @@ +'use strict' + +const { expect } = require('chai') +const { channel } = require('../../../../diagnostics_channel') +const proxyquire = require('proxyquire') +const { getExecutedMetric, getInstrumentedMetric, TagKey } = require('../../../src/appsec/iast/telemetry/iast-metric') + +const VULNERABILITY_TYPE = TagKey.VULNERABILITY_TYPE +const SOURCE_TYPE = TagKey.SOURCE_TYPE + +describe('IAST Plugin', () => { + const loadChannel = channel('dd-trace:instrumentation:load') + + let logError, addSubMock, getIastContext, configureMock, datadogCore + + const handler = () => { + throw new Error('handler error') + } + const channelName = 'datadog:test:start' + + let iastPlugin + + beforeEach(() => { + addSubMock = sinon.stub() + logError = sinon.stub() + getIastContext = sinon.stub() + configureMock = sinon.stub() + }) + + afterEach(() => { + sinon.restore() + }) + + describe('with appsec telemetry disabled', () => { + beforeEach(() => { + class PluginClass { + addSub (channelName, handler) { + addSubMock(channelName, handler) + } + configure (config) { + configureMock(config) + } + } + + datadogCore = { + storage: { + getStore: sinon.stub() + } + } + + const iastPluginMod = proxyquire('../../../src/appsec/iast/iast-plugin', { + '../../plugins/plugin': PluginClass, + './iast-log': { + errorAndPublish: logError + }, + './iast-context': { + getIastContext: getIastContext + }, + './telemetry': { + isEnabled: () => false + }, + './telemetry/metrics': {}, + '../../../../datadog-core': datadogCore + }) + iastPlugin = new iastPluginMod.IastPlugin() + }) + + afterEach(() => { + iastPlugin.disableTelemetry() + }) + + describe('addSub', () => { + it('should call Plugin.addSub with channelName and wrapped handler', () => { + iastPlugin.addSub('test', handler) + + expect(addSubMock).to.be.calledOnce + const args = addSubMock.getCall(0).args + expect(args[0]).equal('test') + + const wrapped = args[1] + expect(wrapped).to.be.a('function') + expect(wrapped).to.not.be.equal(handler) + expect(wrapped()).to.not.throw + expect(logError).to.be.calledOnce + }) + + it('should call Plugin.addSub with channelName and wrapped handler after registering iastPluginSub', () => { + const iastPluginSub = { channelName: 'test' } + iastPlugin.addSub(iastPluginSub, handler) + + expect(addSubMock).to.be.calledOnce + const args = addSubMock.getCall(0).args + expect(args[0]).equal('test') + + const wrapped = args[1] + expect(wrapped).to.be.a('function') + expect(wrapped).to.not.be.equal(handler) + expect(wrapped()).to.not.throw + expect(logError).to.be.calledOnce + }) + + it('should infer moduleName from channelName after registering iastPluginSub', () => { + const iastPluginSub = { channelName: 'test' } + iastPlugin.addSub(iastPluginSub, handler) + + expect(iastPlugin.pluginSubs).to.have.lengthOf(1) + expect(iastPlugin.pluginSubs[0].moduleName).eq('test') + }) + + it('should infer moduleName from channelName after registering iastPluginSub with real channelName', () => { + const iastPluginSub = { channelName: 'datadog:test:start' } + iastPlugin.addSub(iastPluginSub, handler) + + expect(iastPlugin.pluginSubs).to.have.lengthOf(1) + expect(iastPlugin.pluginSubs[0].moduleName).eq('test') + }) + + it('should not call _getTelemetryHandler', () => { + const wrapHandler = sinon.stub() + iastPlugin._wrapHandler = wrapHandler + const getTelemetryHandler = sinon.stub() + iastPlugin._getTelemetryHandler = getTelemetryHandler + iastPlugin.addSub({ channelName, tagKey: VULNERABILITY_TYPE }, handler) + + expect(wrapHandler).to.be.calledOnceWith(handler) + expect(getTelemetryHandler).to.be.not.called + + wrapHandler.reset() + getTelemetryHandler.reset() + + iastPlugin.addSub({ channelName, tagKey: SOURCE_TYPE, tag: 'test-tag' }, handler) + expect(wrapHandler).to.be.calledOnceWith(handler) + expect(getTelemetryHandler).to.be.not.called + }) + }) + + describe('configure', () => { + it('should mark Plugin configured and call only once onConfigure', () => { + iastPlugin.onConfigure = sinon.stub() + iastPlugin.configure(true) + iastPlugin.configure(false) + iastPlugin.configure(true) + + expect(iastPlugin.configured).to.be.true + expect(iastPlugin.onConfigure).to.be.calledOnce + }) + }) + + describe('_execHandlerAndIncMetric', () => { + it('should exec handler', () => { + const handler = sinon.spy() + + iastPlugin._execHandlerAndIncMetric({ + handler + }) + + expect(handler).to.be.calledOnce + }) + + it('should exec handler and catch exception if any', () => { + const handler = () => { throw new Error('error') } + + expect(iastPlugin._execHandlerAndIncMetric({ + handler + })).to.not.throw + expect(logError).to.be.calledOnce + }) + + it('should exec handler and not increase metric', () => { + const handler = sinon.spy() + const metric = { + increase: sinon.spy() + } + + iastPlugin._execHandlerAndIncMetric({ + handler, + metric + }) + + expect(handler).to.be.calledOnce + expect(metric.increase).to.not.be.called + }) + }) + }) + + describe('with appsec telemetry enabled', () => { + let iastTelemetry + + beforeEach(() => { + class PluginClass { + addSub (channelName, handler) { + addSubMock(channelName, handler) + } + configure (config) { + configureMock(config) + } + } + iastTelemetry = { + isEnabled: () => true + } + const IastPlugin = proxyquire('../../../src/appsec/iast/iast-plugin', { + '../../plugins/plugin': PluginClass, + './iast-log': { + errorAndPublish: logError + }, + './telemetry': iastTelemetry, + '../../../../datadog-instrumentations/src/helpers/instrumentations': {} + }).IastPlugin + + iastPlugin = new IastPlugin() + }) + + afterEach(() => { + iastPlugin.disableTelemetry() + sinon.restore() + }) + + describe('configure', () => { + it('should subscribe dd-trace:instrumentation:load channel', () => { + const onInstrumentationLoadedMock = sinon.stub(iastPlugin, '_onInstrumentationLoaded') + iastPlugin.configure(true) + iastPlugin.configure(false) + iastPlugin.configure(true) + + loadChannel.publish({ name: 'test' }) + + expect(onInstrumentationLoadedMock).to.be.calledWith('test') + }) + }) + + describe('addSub', () => { + it('should call _getTelemetryHandler with correct metrics', () => { + const wrapHandler = sinon.stub() + iastPlugin._wrapHandler = wrapHandler + const getTelemetryHandler = sinon.stub() + iastPlugin._getTelemetryHandler = getTelemetryHandler + iastPlugin.addSub({ channelName, tagKey: VULNERABILITY_TYPE }, handler) + + expect(wrapHandler).to.be.calledOnceWith(handler) + expect(getTelemetryHandler).to.be.calledOnceWith(iastPlugin.pluginSubs[0]) + + wrapHandler.reset() + getTelemetryHandler.reset() + + iastPlugin.addSub({ channelName, tagKey: SOURCE_TYPE, tag: 'test-tag' }, handler) + expect(wrapHandler).to.be.calledOnceWith(handler) + expect(getTelemetryHandler).to.be.calledOnceWith(iastPlugin.pluginSubs[1]) + }) + + it('should register an pluginSubscription and increment a sink metric when a sink module is loaded', () => { + iastPlugin.addSub({ + moduleName: 'sink', + channelName: 'datadog:sink:start', + tag: 'injection', + tagKey: VULNERABILITY_TYPE + }, handler) + iastPlugin.configure(true) + + const metric = getInstrumentedMetric(VULNERABILITY_TYPE) + const metricAdd = sinon.stub(metric, 'add') + + loadChannel.publish({ name: 'sink' }) + + expect(metricAdd).to.be.calledOnceWith(1, 'injection') + }) + + it('should register an pluginSubscription and increment a source metric when a source module is loaded', () => { + iastPlugin.addSub({ + moduleName: 'source', + channelName: 'datadog:source:start', + tag: 'http.source', + tagKey: SOURCE_TYPE + }, handler) + iastPlugin.configure(true) + + const metric = getInstrumentedMetric(SOURCE_TYPE) + const metricAdd = sinon.stub(metric, 'add') + + loadChannel.publish({ name: 'source' }) + + expect(metricAdd).to.be.calledOnceWith(1, 'http.source') + }) + + it('should increment a sink metric when event is received', () => { + iastPlugin.addSub({ + moduleName: 'sink', + channelName: 'datadog:sink:start', + tag: 'injection', + tagKey: VULNERABILITY_TYPE + }, handler) + iastPlugin.configure(true) + + const metric = getExecutedMetric(VULNERABILITY_TYPE) + const metricAdd = sinon.stub(metric, 'add') + + const telemetryHandler = addSubMock.secondCall.args[1] + telemetryHandler() + + expect(metricAdd).to.be.calledOnceWith(1, 'injection') + }) + + it('should increment a source metric when event is received', () => { + iastPlugin.addSub({ + moduleName: 'source', + channelName: 'datadog:source:start', + tag: 'http.source', + tagKey: SOURCE_TYPE + }, handler) + iastPlugin.configure(true) + + const metric = getExecutedMetric(SOURCE_TYPE) + const metricAdd = sinon.stub(metric, 'add') + + const telemetryHandler = addSubMock.secondCall.args[1] + telemetryHandler() + + expect(metricAdd).to.be.calledOnceWith(1, 'http.source') + }) + + it('should increment a source metric when event is received for every tag', () => { + iastPlugin.addSub({ + moduleName: 'source', + channelName: 'datadog:source:start', + tag: [ 'http.source', 'http.source2', 'http.source3' ], + tagKey: SOURCE_TYPE + }, handler) + iastPlugin.configure(true) + + const metric = getExecutedMetric(SOURCE_TYPE) + const metricAdd = sinon.stub(metric, 'add') + + const telemetryHandler = addSubMock.secondCall.args[1] + telemetryHandler() + + expect(metricAdd).to.be.calledOnceWith(1, [ 'http.source', 'http.source2', 'http.source3' ]) + }) + }) + + describe('_execHandlerAndIncMetric', () => { + it('should exec handler', () => { + const handler = sinon.spy() + + iastPlugin._execHandlerAndIncMetric({ + handler + }) + + expect(handler).to.be.calledOnce + }) + + it('should exec handler and catch exception if any', () => { + const handler = () => { throw new Error('error') } + + expect(iastPlugin._execHandlerAndIncMetric({ + handler + })).to.not.throw + expect(logError).to.be.calledOnce + }) + + it('should exec handler and increase metric', () => { + const handler = sinon.spy() + const metric = { + inc: sinon.spy() + } + const tag = 'tag1' + const iastContext = {} + iastPlugin._execHandlerAndIncMetric({ + handler, + metric, + tag, + iastContext + }) + + expect(handler).to.be.calledOnce + expect(metric.inc).to.be.calledOnceWithExactly(tag, iastContext) + }) + }) + }) +}) diff --git a/packages/dd-trace/test/appsec/iast/taint-tracking/plugin.spec.js b/packages/dd-trace/test/appsec/iast/taint-tracking/plugin.spec.js index a2a2a087449..0c4e307eba9 100644 --- a/packages/dd-trace/test/appsec/iast/taint-tracking/plugin.spec.js +++ b/packages/dd-trace/test/appsec/iast/taint-tracking/plugin.spec.js @@ -8,7 +8,7 @@ const { HTTP_REQUEST_COOKIE_VALUE, HTTP_REQUEST_COOKIE_NAME, HTTP_REQUEST_PATH_PARAM -} = require('../../../../src/appsec/iast/taint-tracking/origin-types') +} = require('../../../../src/appsec/iast/taint-tracking/source-types') const middlewareNextChannel = dc.channel('apm:express:middleware:next') const queryParseFinishChannel = dc.channel('datadog:qs:parse:finish') diff --git a/packages/dd-trace/test/appsec/iast/taint-tracking/rewriter-telemetry.spec.js b/packages/dd-trace/test/appsec/iast/taint-tracking/rewriter-telemetry.spec.js new file mode 100644 index 00000000000..05cdbd9c8b3 --- /dev/null +++ b/packages/dd-trace/test/appsec/iast/taint-tracking/rewriter-telemetry.spec.js @@ -0,0 +1,72 @@ +'use strict' + +const proxyquire = require('proxyquire') + +const { INSTRUMENTED_PROPAGATION } = require('../../../../src/appsec/iast/telemetry/iast-metric') +const { Verbosity } = require('../../../../src/appsec/iast/telemetry/verbosity') + +describe('rewriter telemetry', () => { + let iastTelemetry, rewriter, getRewriteFunction + let instrumentedPropagationAdd + + beforeEach(() => { + iastTelemetry = { + add: sinon.spy() + } + const rewriterTelemetry = proxyquire('../../../../src/appsec/iast/taint-tracking/rewriter-telemetry', { + '../telemetry': iastTelemetry + }) + getRewriteFunction = rewriterTelemetry.getRewriteFunction + rewriter = { + rewrite: (content) => { + return { + content: content + 'rewritten', + metrics: { + instrumentedPropagation: 2 + } + } + } + } + instrumentedPropagationAdd = sinon.stub(INSTRUMENTED_PROPAGATION, 'add') + }) + + afterEach(() => { + sinon.restore() + }) + + it('should not increase any metrics with OFF verbosity', () => { + iastTelemetry.verbosity = Verbosity.OFF + + const rewriteFn = getRewriteFunction(rewriter) + rewriteFn('const a = b + c', 'test.js') + + expect(instrumentedPropagationAdd).to.not.be.called + }) + + it('should increase information metrics with MANDATORY verbosity', () => { + iastTelemetry.verbosity = Verbosity.MANDATORY + + const rewriteFn = getRewriteFunction(rewriter) + const result = rewriteFn('const a = b + c', 'test.js') + + expect(instrumentedPropagationAdd).to.be.calledOnceWith(result.metrics.instrumentedPropagation) + }) + + it('should increase information metrics with INFORMATION verbosity', () => { + iastTelemetry.verbosity = Verbosity.INFORMATION + + const rewriteFn = getRewriteFunction(rewriter) + const result = rewriteFn('const a = b + c', 'test.js') + + expect(instrumentedPropagationAdd).to.be.calledOnceWith(result.metrics.instrumentedPropagation) + }) + + it('should increase debug metrics with DEBUG verbosity', () => { + iastTelemetry.verbosity = Verbosity.DEBUG + + const rewriteFn = getRewriteFunction(rewriter) + const result = rewriteFn('const a = b + c', 'test.js') + + expect(instrumentedPropagationAdd).to.be.calledOnceWith(result.metrics.instrumentedPropagation) + }) +}) diff --git a/packages/dd-trace/test/appsec/iast/taint-tracking/rewriter.spec.js b/packages/dd-trace/test/appsec/iast/taint-tracking/rewriter.spec.js index b77cbac75af..9eb2e94b23e 100644 --- a/packages/dd-trace/test/appsec/iast/taint-tracking/rewriter.spec.js +++ b/packages/dd-trace/test/appsec/iast/taint-tracking/rewriter.spec.js @@ -13,19 +13,38 @@ describe('IAST Rewriter', () => { }) describe('Enabling rewriter', () => { - let rewriter + let rewriter, iastTelemetry + const shimmer = { wrap: sinon.spy(), unwrap: sinon.spy() } + class Rewriter { + rewrite (content, filename) { + return { + content: content + 'rewritten', + metrics: { + instrumentedPropagation: 2 + } + } + } + } + beforeEach(() => { + iastTelemetry = { + add: sinon.spy() + } rewriter = proxyquire('../../../../src/appsec/iast/taint-tracking/rewriter', { - '../../../../../datadog-shimmer': shimmer + '@datadog/native-iast-rewriter': { Rewriter, getPrepareStackTrace: function () {} }, + '../../../../../datadog-shimmer': shimmer, + '../../telemetry': iastTelemetry }) }) - afterEach(sinon.restore) + afterEach(() => { + sinon.restore() + }) it('Should wrap module compile method on taint tracking enable', () => { rewriter.enableRewriter() diff --git a/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.cookie.plugin.spec.js b/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.cookie.plugin.spec.js index c0c7bea232d..782613e44e4 100644 --- a/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.cookie.plugin.spec.js +++ b/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.cookie.plugin.spec.js @@ -9,7 +9,7 @@ const { isTainted, getRanges } = require('../../../../../src/appsec/iast/taint-t const { HTTP_REQUEST_COOKIE_NAME, HTTP_REQUEST_COOKIE_VALUE -} = require('../../../../../src/appsec/iast/taint-tracking/origin-types') +} = require('../../../../../src/appsec/iast/taint-tracking/source-types') const { testInRequest } = require('../../utils') describe('Cookies sourcing with cookies', () => { diff --git a/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.express.plugin.spec.js b/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.express.plugin.spec.js index d3a5714f631..9823f71efc3 100644 --- a/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.express.plugin.spec.js +++ b/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.express.plugin.spec.js @@ -9,7 +9,7 @@ const { storage } = require('../../../../../../datadog-core') const iast = require('../../../../../src/appsec/iast') const iastContextFunctions = require('../../../../../src/appsec/iast/iast-context') const { isTainted, getRanges } = require('../../../../../src/appsec/iast/taint-tracking/operations') -const { HTTP_REQUEST_PATH_PARAM } = require('../../../../../src/appsec/iast/taint-tracking/origin-types') +const { HTTP_REQUEST_PATH_PARAM } = require('../../../../../src/appsec/iast/taint-tracking/source-types') describe('Path params sourcing with express', () => { let express diff --git a/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.headers.spec.js b/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.headers.spec.js index 12959cfd10a..4a846b875b4 100644 --- a/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.headers.spec.js +++ b/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.headers.spec.js @@ -9,7 +9,7 @@ const { isTainted, getRanges } = require('../../../../../src/appsec/iast/taint-t const { HTTP_REQUEST_HEADER_NAME, HTTP_REQUEST_HEADER_VALUE -} = require('../../../../../src/appsec/iast/taint-tracking/origin-types') +} = require('../../../../../src/appsec/iast/taint-tracking/source-types') const { testInRequest } = require('../../utils') describe('Headers sourcing', () => { diff --git a/packages/dd-trace/test/appsec/iast/taint-tracking/taint-tracking-operations.spec.js b/packages/dd-trace/test/appsec/iast/taint-tracking/taint-tracking-operations.spec.js index 2044114983c..0a8d77fb2a1 100644 --- a/packages/dd-trace/test/appsec/iast/taint-tracking/taint-tracking-operations.spec.js +++ b/packages/dd-trace/test/appsec/iast/taint-tracking/taint-tracking-operations.spec.js @@ -3,6 +3,22 @@ const { expect } = require('chai') const proxyquire = require('proxyquire') const iastContextFunctions = require('../../../../src/appsec/iast/iast-context') +const { csiMethods } = require('../../../../src/appsec/iast/taint-tracking/csi-methods') +const iastTelemetry = require('../../../../src/appsec/iast/telemetry') +const { EXECUTED_PROPAGATION, REQUEST_TAINTED } = require('../../../../src/appsec/iast/telemetry/iast-metric') +const { Verbosity } = require('../../../../src/appsec/iast/telemetry/verbosity') + +function getExpectedMethods () { + const set = new Set() + for (const definition of csiMethods) { + if (definition.dst) { + set.add(definition.dst) + } else { + set.add(definition.src) + } + } + return [...set] +} describe('IAST TaintTracking Operations', () => { let taintTrackingOperations @@ -16,7 +32,12 @@ describe('IAST TaintTracking Operations', () => { isTainted: id => id, getRanges: id => id, concat: id => id, - trim: id => id + trim: id => id, + getMetrics: id => { + return { + requestCount: 5 + } + } } const store = {} @@ -36,7 +57,8 @@ describe('IAST TaintTracking Operations', () => { taintTrackingOperations = proxyquire('../../../../src/appsec/iast/taint-tracking/operations', { '@datadog/native-iast-taint-tracking': taintedUtilsMock, '../../../../../datadog-core': datadogCore, - './taint-tracking-impl': taintTrackingImpl + './taint-tracking-impl': taintTrackingImpl, + '../telemetry': iastTelemetry }) }) @@ -274,6 +296,25 @@ describe('IAST TaintTracking Operations', () => { taintTrackingOperations.removeTransaction(iastContext) expect(taintedUtils.removeTransaction).not.to.be.called }) + + it('Should increment REQUEST_TAINTED metric if INFORMATION or greater verbosity is enabled', () => { + const iastContext = { + [taintTrackingOperations.IAST_TRANSACTION_ID]: 'id' + } + iastTelemetry.configure({ + telemetry: { enabled: true, metrics: true }, + iast: { + telemetryVerbosity: 'INFORMATION' + } + }) + + const requestTaintedAdd = sinon.stub(REQUEST_TAINTED, 'add') + + taintTrackingOperations.enableTaintOperations(iastTelemetry.verbosity) + taintTrackingOperations.removeTransaction(iastContext) + + expect(requestTaintedAdd).to.be.calledOnceWith(5, null, iastContext) + }) }) describe('SetMaxTransactions', () => { @@ -291,11 +332,13 @@ describe('IAST TaintTracking Operations', () => { }) describe('enableTaintTracking', () => { + let context beforeEach(() => { + context = { [taintTrackingOperations.IAST_TRANSACTION_ID]: 'id' } iastContextFunctions.saveIastContext( store, {}, - { [taintTrackingOperations.IAST_TRANSACTION_ID]: 'id' } + context ) }) @@ -322,6 +365,22 @@ describe('IAST TaintTracking Operations', () => { global._ddiast.plusOperator('helloworld', 'hello', 'world') expect(taintedUtils.concat).not.to.be.called }) + + it('Should set debug global._ddiast object', () => { + taintTrackingOperations.enableTaintOperations(Verbosity.DEBUG) + + // dummy taintedUtils is declared in global scope + expect(global._ddiast).not.to.be.undefined + expect(global._ddiast.plusOperator).not.to.be.undefined + + const executedPropagationIncrease = sinon.stub(EXECUTED_PROPAGATION, 'inc') + + // taintedUtils methods are not called + global._ddiast.plusOperator('helloworld', 'hello', 'world') + expect(taintedUtils.concat).to.be.called + + expect(executedPropagationIncrease).to.be.calledOnceWith(null, context) + }) }) describe('newTaintedString', () => { @@ -518,12 +577,27 @@ describe('IAST TaintTracking Operations', () => { }) }) - describe('TaintTrackingDummy', () => { + describe('TaintTrackingNoop', () => { it('should have the same properties as TaintTracking', () => { - const tt = taintTrackingImpl.TaintTracking - const dummy = taintTrackingImpl.TaintTrackingDummy + const tt = taintTrackingImpl.getTaintTrackingImpl() + const noop = taintTrackingImpl.getTaintTrackingNoop() + + expect(noop).to.have.all.keys(Object.keys(tt)) + }) + + it('should have the same properties as TaintTrackingDebug', () => { + const ttDebug = taintTrackingImpl.getTaintTrackingImpl(Verbosity.DEBUG) + const noop = taintTrackingImpl.getTaintTrackingNoop() + + expect(noop).to.have.all.keys(Object.keys(ttDebug)) + }) + + it('should have the same properties as csiMethods', () => { + const tt = taintTrackingImpl.getTaintTrackingImpl() + + const csiExpectedMethods = getExpectedMethods() - expect(dummy).to.have.all.keys(Object.keys(tt)) + expect(tt).to.have.all.keys(csiExpectedMethods) }) }) }) diff --git a/packages/dd-trace/test/appsec/iast/telemetry/iast-metric.spec.js b/packages/dd-trace/test/appsec/iast/telemetry/iast-metric.spec.js new file mode 100644 index 00000000000..f862158ddf3 --- /dev/null +++ b/packages/dd-trace/test/appsec/iast/telemetry/iast-metric.spec.js @@ -0,0 +1,98 @@ +'use strict' + +const proxyquire = require('proxyquire') +const { + getExecutedMetric, + getInstrumentedMetric, + TagKey, + EXECUTED_SINK, + EXECUTED_SOURCE, + INSTRUMENTED_SINK, + INSTRUMENTED_SOURCE +} = require('../../../../src/appsec/iast/telemetry/iast-metric') + +describe('Metrics', () => { + let IastMetric, reqNamespace, inc, context + beforeEach(() => { + context = {} + inc = sinon.stub() + const metricMock = { inc } + + reqNamespace = { + count: sinon.stub().returns(metricMock) + } + + const metric = proxyquire('../../../../src/appsec/iast/telemetry/iast-metric', { + './namespaces': { + getNamespaceFromContext: () => reqNamespace + } + }) + IastMetric = metric.IastMetric + }) + + afterEach(sinon.restore) + + it('should increase by one the metric value', () => { + const metric = new IastMetric('test.metric', 'REQUEST') + + metric.inc(undefined, context) + + expect(reqNamespace.count).to.be.calledOnceWith(metric.name, undefined) + expect(inc).to.be.calledOnceWith(1) + }) + + it('should add by 42 the metric value', () => { + const metric = new IastMetric('test.metric', 'REQUEST', 'tagKey') + + metric.add(42, undefined, context) + + expect(reqNamespace.count).to.be.calledOnceWith(metric.name, undefined) + expect(inc).to.be.calledOnceWith(42) + }) + + it('should increase by one the metric tag value', () => { + const metric = new IastMetric('test.metric', 'REQUEST', 'tagKey') + + metric.inc('tag1', context) + + expect(reqNamespace.count).to.be.calledOnceWith(metric.name, { tagKey: 'tag1' }) + expect(inc).to.be.calledOnceWith(1) + }) + + it('should add by 42 the metric tag value', () => { + const metric = new IastMetric('test.metric', 'REQUEST', 'tagKey') + + metric.add(42, 'tag1', context) + + expect(reqNamespace.count).to.be.calledOnceWith(metric.name, { tagKey: 'tag1' }) + expect(inc).to.be.calledOnceWith(42) + }) + + it('should add by 42 the each metric tag value', () => { + const metric = new IastMetric('test.metric', 'REQUEST', 'tagKey') + + metric.add(42, ['tag1', 'tag2'], context) + + expect(reqNamespace.count).to.be.calledTwice + expect(reqNamespace.count.firstCall.args).to.be.deep.equals([metric.name, { tagKey: 'tag1' }]) + expect(reqNamespace.count.secondCall.args).to.be.deep.equals([metric.name, { tagKey: 'tag2' }]) + }) + + it('getExecutedMetric should return a metric depending on tag', () => { + let metric = getExecutedMetric(TagKey.VULNERABILITY_TYPE) + + expect(metric).to.be.equal(EXECUTED_SINK) + + metric = getExecutedMetric(TagKey.SOURCE_TYPE) + expect(metric).to.be.equal(EXECUTED_SOURCE) + }) + + it('getInstrumentedMetric should return a metric depending on tag', () => { + let metric = getInstrumentedMetric(TagKey.VULNERABILITY_TYPE) + + expect(metric).to.be.equal(INSTRUMENTED_SINK) + + metric = getInstrumentedMetric(TagKey.SOURCE_TYPE) + expect(metric).to.be.equal(INSTRUMENTED_SOURCE) + }) +}) diff --git a/packages/dd-trace/test/appsec/iast/telemetry/index.spec.js b/packages/dd-trace/test/appsec/iast/telemetry/index.spec.js new file mode 100644 index 00000000000..2f54701f1be --- /dev/null +++ b/packages/dd-trace/test/appsec/iast/telemetry/index.spec.js @@ -0,0 +1,222 @@ +'use strict' + +const { expect } = require('chai') +const proxyquire = require('proxyquire') + +const { Verbosity } = require('../../../../src/appsec/iast/telemetry/verbosity') +const Config = require('../../../../src/config') +const iast = require('../../../../src/appsec/iast') +const agent = require('../../../plugins/agent') +const axios = require('axios') +const { testInRequest } = require('../utils') + +describe('Telemetry', () => { + describe('unit test', () => { + let defaultConfig + let telemetryMetrics + let iastTelemetry + let telemetryLogs + let initRequestNamespace + let finalizeRequestNamespace + + beforeEach(() => { + defaultConfig = { + telemetry: { + enabled: true, + metrics: true + } + } + + telemetryLogs = { + registerProvider: () => telemetryLogs, + start: sinon.spy(), + stop: sinon.spy() + } + + telemetryMetrics = { + manager: { + set: sinon.spy(), + delete: sinon.spy() + } + } + + initRequestNamespace = sinon.spy() + finalizeRequestNamespace = sinon.spy() + + iastTelemetry = proxyquire('../../../../src/appsec/iast/telemetry', { + './log': telemetryLogs, + '../../../telemetry/metrics': telemetryMetrics, + './namespaces': { + initRequestNamespace, + finalizeRequestNamespace + } + }) + }) + + afterEach(() => { + sinon.restore() + }) + + describe('configure', () => { + it('should set default verbosity', () => { + iastTelemetry.configure(defaultConfig) + + expect(iastTelemetry.enabled).to.be.true + expect(iastTelemetry.verbosity).to.be.equal(Verbosity.INFORMATION) + expect(telemetryLogs.start).to.be.calledOnce + }) + + it('should set OFF verbosity if not enabled', () => { + defaultConfig.telemetry.enabled = false + iastTelemetry.configure(defaultConfig) + + expect(iastTelemetry.enabled).to.be.false + expect(iastTelemetry.verbosity).to.be.equal(Verbosity.OFF) + expect(telemetryLogs.start).to.be.called + }) + + it('should init metrics even if verbosity is OFF', () => { + const iastTelemetry = proxyquire('../../../../src/appsec/iast/telemetry', { + './log': telemetryLogs, + '../../../telemetry/metrics': telemetryMetrics, + './verbosity': { + getVerbosity: () => Verbosity.OFF + } + }) + + const telemetryConfig = { enabled: true, metrics: true } + iastTelemetry.configure({ + telemetry: telemetryConfig + }) + + expect(iastTelemetry.enabled).to.be.true + expect(iastTelemetry.verbosity).to.be.equal(Verbosity.OFF) + expect(telemetryMetrics.manager.set).to.be.calledOnce + expect(telemetryLogs.start).to.be.calledOnce + }) + + it('should not init metrics if metrics not enabled', () => { + const telemetryConfig = { enabled: true, metrics: false } + iastTelemetry.configure({ + telemetry: telemetryConfig + }) + + expect(iastTelemetry.enabled).to.be.false + expect(iastTelemetry.verbosity).to.be.equal(Verbosity.OFF) + expect(telemetryMetrics.manager.set).to.not.be.called + expect(telemetryLogs.start).to.be.calledOnce + }) + }) + + describe('stop', () => { + it('should set enabled = false and unregister provider', () => { + iastTelemetry.configure(defaultConfig) + + iastTelemetry.stop() + expect(iastTelemetry.enabled).to.be.false + expect(telemetryMetrics.manager.delete).to.be.calledOnce + expect(telemetryLogs.stop).to.be.calledOnce + }) + }) + + describe('onRequestStart', () => { + it('should call init if enabled and verbosity is not Off', () => { + iastTelemetry.configure(defaultConfig) + + const iastContext = {} + iastTelemetry.onRequestStart(iastContext) + + expect(initRequestNamespace).to.be.calledOnceWith(iastContext) + }) + + it('should not call init if enabled and verbosity is Off', () => { + const iastTelemetry = proxyquire('../../../../src/appsec/iast/telemetry', { + '../../../telemetry/metrics': telemetryMetrics, + './log': telemetryLogs, + './verbosity': { + getVerbosity: () => Verbosity.OFF + } + }) + iastTelemetry.configure({ + telemetry: { enabled: true } + }) + + const iastContext = {} + iastTelemetry.onRequestStart(iastContext) + + expect(initRequestNamespace).to.not.be.calledOnce + }) + }) + + describe('onRequestEnd', () => { + it('should call finalizeRequestNamespace if enabled and verbosity is not Off', () => { + iastTelemetry.configure(defaultConfig) + + const iastContext = {} + iastTelemetry.onRequestEnd(iastContext) + + expect(finalizeRequestNamespace).to.be.calledOnceWith(iastContext) + }) + + it('should not call finalizeRequestNamespace if enabled and verbosity is Off', () => { + const iastTelemetry = proxyquire('../../../../src/appsec/iast/telemetry', { + '../../../telemetry/metrics': telemetryMetrics, + './log': telemetryLogs, + './verbosity': { + getVerbosity: () => Verbosity.OFF + } + }) + iastTelemetry.configure({ + telemetry: { enabled: true } + }) + + const iastContext = {} + iastTelemetry.onRequestEnd(iastContext) + + expect(finalizeRequestNamespace).to.not.be.calledOnce + }) + }) + }) + + describe('full feature', () => { + let originalProcessEnv + + beforeEach(() => { + originalProcessEnv = process.env + process.env = { + DD_TELEMETRY_METRICS_ENABLED: 'true', + DD_IAST_ENABLED: 'true', + DD_IAST_REQUEST_SAMPLING: '100' + } + const config = new Config() + iast.enable(config) + }) + + afterEach(() => { + iast.disable() + process.env = originalProcessEnv + }) + + after(() => { + process.env = originalProcessEnv + }) + function app () {} + + function tests (config) { + it('should have header source execution metric', (done) => { + agent + .use(traces => { + expect(traces[0][0].metrics['_dd.iast.telemetry.executed.source.http_request_header']).to.be.equal(1) + }) + .then(done) + .catch(done) + axios.get(`http://localhost:${config.port}/`, { + headers: { + 'x-test-header': 'test-value' + } + }).catch(done) + }) + } + testInRequest(app, tests) + }) +}) diff --git a/packages/dd-trace/test/appsec/iast/telemetry/logs.spec.js b/packages/dd-trace/test/appsec/iast/telemetry/log/index.spec.js similarity index 77% rename from packages/dd-trace/test/appsec/iast/telemetry/logs.spec.js rename to packages/dd-trace/test/appsec/iast/telemetry/log/index.spec.js index 8c5e6d82cc2..6d3dc17b01c 100644 --- a/packages/dd-trace/test/appsec/iast/telemetry/logs.spec.js +++ b/packages/dd-trace/test/appsec/iast/telemetry/log/index.spec.js @@ -48,8 +48,8 @@ describe('telemetry logs', () => { describe('start', () => { it('should be enabled by default and subscribe', () => { - const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - '../../../../../diagnostics_channel': dc + const logs = proxyquire('../../../../../src/appsec/iast/telemetry/log', { + '../../../../../../diagnostics_channel': dc }) logs.start() defaultConfig.telemetry.logCollection = true @@ -60,8 +60,8 @@ describe('telemetry logs', () => { }) it('should be disabled and not subscribe if DD_TELEMETRY_LOG_COLLECTION_ENABLED = false', () => { - const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - '../../../../../diagnostics_channel': dc + const logs = proxyquire('../../../../../src/appsec/iast/telemetry/log', { + '../../../../../../diagnostics_channel': dc }) logs.start() @@ -75,10 +75,10 @@ describe('telemetry logs', () => { const sendData = sinon.stub() let logCollectorCalled = 0 - const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - '../../../../../diagnostics_channel': dc, - '../../../telemetry/send-data': { sendData }, - './log_collector': { + const logs = proxyquire('../../../../../src/appsec/iast/telemetry/log', { + '../../../../../../diagnostics_channel': dc, + '../../../../telemetry/send-data': { sendData }, + './log-collector': { drain: () => { logCollectorCalled++ return { message: 'Error 1', level: 'ERROR' } @@ -104,8 +104,8 @@ describe('telemetry logs', () => { describe('stop', () => { it('should unsubscribe configured listeners', () => { - const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - '../../../../../diagnostics_channel': dc + const logs = proxyquire('../../../../../src/appsec/iast/telemetry/log', { + '../../../../../../diagnostics_channel': dc }) logs.start() onTelemetryStart()(onTelemetryStartMsg) @@ -117,8 +117,8 @@ describe('telemetry logs', () => { }) it('should unsubscribe configured listeners when datadog:telemetry:stop is received', () => { - const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - '../../../../../diagnostics_channel': dc + const logs = proxyquire('../../../../../src/appsec/iast/telemetry/log', { + '../../../../../../diagnostics_channel': dc }) logs.start() onTelemetryStart()(onTelemetryStartMsg) @@ -133,9 +133,9 @@ describe('telemetry logs', () => { describe('sendData', () => { it('should be not called with DEBUG level', () => { const logCollectorAdd = sinon.stub() - const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - '../../../../../diagnostics_channel': dc, - './log_collector': { + const logs = proxyquire('../../../../../src/appsec/iast/telemetry/log', { + '../../../../../../diagnostics_channel': dc, + './log-collector': { add: logCollectorAdd } }) @@ -149,9 +149,9 @@ describe('telemetry logs', () => { it('should be called with WARN level', () => { const logCollectorAdd = sinon.stub() - const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - '../../../../../diagnostics_channel': dc, - './log_collector': { + const logs = proxyquire('../../../../../src/appsec/iast/telemetry/log', { + '../../../../../../diagnostics_channel': dc, + './log-collector': { add: logCollectorAdd } }) @@ -165,9 +165,9 @@ describe('telemetry logs', () => { it('should be called with ERROR level', () => { const logCollectorAdd = sinon.stub() - const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - '../../../../../diagnostics_channel': dc, - './log_collector': { + const logs = proxyquire('../../../../../src/appsec/iast/telemetry/log', { + '../../../../../../diagnostics_channel': dc, + './log-collector': { add: logCollectorAdd } }) @@ -181,9 +181,9 @@ describe('telemetry logs', () => { it('should be called with ERROR level and stack_trace', () => { const logCollectorAdd = sinon.stub() - const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - '../../../../../diagnostics_channel': dc, - './log_collector': { + const logs = proxyquire('../../../../../src/appsec/iast/telemetry/log', { + '../../../../../../diagnostics_channel': dc, + './log-collector': { add: logCollectorAdd } }) diff --git a/packages/dd-trace/test/appsec/iast/telemetry/log_collector.spec.js b/packages/dd-trace/test/appsec/iast/telemetry/log/log-collector.spec.js similarity index 86% rename from packages/dd-trace/test/appsec/iast/telemetry/log_collector.spec.js rename to packages/dd-trace/test/appsec/iast/telemetry/log/log-collector.spec.js index 59c5ec3fe68..dde5f6afb65 100644 --- a/packages/dd-trace/test/appsec/iast/telemetry/log_collector.spec.js +++ b/packages/dd-trace/test/appsec/iast/telemetry/log/log-collector.spec.js @@ -1,10 +1,10 @@ const { expect } = require('chai') -const { calculateDDBasePath } = require('../../../../src/util') +const { calculateDDBasePath } = require('../../../../../src/util') const ddBasePath = calculateDDBasePath(__dirname) describe('telemetry log collector', () => { - const logCollector = require('../../../../src/appsec/iast/telemetry/log_collector') + const logCollector = require('../../../../../src/appsec/iast/telemetry/log/log-collector') afterEach(() => { logCollector.reset(3) @@ -24,14 +24,16 @@ describe('telemetry log collector', () => { }) it('should store logs with same message but different stack', () => { - const ddFrame = `at T (${ddBasePath}packages/dd-trace/test/appsec/iast/telemetry/log_collector.spec.js:29:21)` + const ddFrame = + `at T (${ddBasePath}packages/dd-trace/test/appsec/iast/telemetry/log/log-collector.spec.js:29:21)` expect(logCollector.add({ message: 'Error 1', level: 'ERROR', stack_trace: `stack 1\n${ddFrame}` })).to.be.true expect(logCollector.add({ message: 'Error 1', level: 'ERROR', stack_trace: `stack 2\n${ddFrame}` })).to.be.true expect(logCollector.add({ message: 'Error 1', level: 'ERROR', stack_trace: `stack 3\n${ddFrame}` })).to.be.true }) it('should store logs with same message, same stack but different level', () => { - const ddFrame = `at T (${ddBasePath}packages/dd-trace/test/appsec/iast/telemetry/log_collector.spec.js:29:21)` + const ddFrame = + `at T (${ddBasePath}packages/dd-trace/test/appsec/iast/telemetry/log/log-collector.spec.js:29:21)` expect(logCollector.add({ message: 'Error 1', level: 'ERROR', stack_trace: `stack 1\n${ddFrame}` })).to.be.true expect(logCollector.add({ message: 'Error 1', level: 'WARN', stack_trace: `stack 1\n${ddFrame}` })).to.be.true expect(logCollector.add({ message: 'Error 1', level: 'DEBUG', stack_trace: `stack 1\n${ddFrame}` })).to.be.true diff --git a/packages/dd-trace/test/appsec/iast/telemetry/namespaces.spec.js b/packages/dd-trace/test/appsec/iast/telemetry/namespaces.spec.js new file mode 100644 index 00000000000..4b2e6a5ca78 --- /dev/null +++ b/packages/dd-trace/test/appsec/iast/telemetry/namespaces.spec.js @@ -0,0 +1,88 @@ +'use strict' + +const { + initRequestNamespace, + finalizeRequestNamespace, + DD_IAST_METRICS_NAMESPACE, + globalNamespace +} = require('../../../../src/appsec/iast/telemetry/namespaces') + +const REQUEST_TAINTED = 'request.tainted' +const EXECUTED_SINK = 'executed.sink' +const TAG_PREFIX = '_dd.iast.telemetry' + +function now () { + return Date.now() / 1e3 +} + +describe('IAST metric namespaces', () => { + let context, namespace, rootSpan + + beforeEach(() => { + rootSpan = { + addTags: sinon.spy() + } + context = {} + namespace = initRequestNamespace(context) + }) + + afterEach(() => { + sinon.restore() + }) + + it('should set a rootSpan tag with the flattened value of the metric', () => { + namespace.metrics.set(REQUEST_TAINTED, { + metric: REQUEST_TAINTED, + points: [[now(), 5], [now(), 5]] + }) + + finalizeRequestNamespace(context, rootSpan) + + expect(rootSpan.addTags).to.be.called + + const tag = rootSpan.addTags.getCalls()[0].args[0] + expect(tag).to.has.property(`${TAG_PREFIX}.${REQUEST_TAINTED}`) + expect(tag[`${TAG_PREFIX}.${REQUEST_TAINTED}`]).to.be.eq(10) + + expect(context[DD_IAST_METRICS_NAMESPACE]).to.be.undefined + }) + + it('should set as many rootSpan tags as different request scoped metrics', () => { + namespace.count(REQUEST_TAINTED).inc(10) + namespace.count(EXECUTED_SINK).inc(1) + namespace.count(REQUEST_TAINTED).inc(5) + + finalizeRequestNamespace(context, rootSpan) + + expect(rootSpan.addTags).to.be.called + + const calls = rootSpan.addTags.getCalls() + const reqTaintedTag = calls[0].args[0] + expect(reqTaintedTag).to.has.property(`${TAG_PREFIX}.${REQUEST_TAINTED}`) + expect(reqTaintedTag[`${TAG_PREFIX}.${REQUEST_TAINTED}`]).to.be.eq(15) + + const execSinkTag = calls[1].args[0] + expect(execSinkTag).to.has.property(`${TAG_PREFIX}.${EXECUTED_SINK}`) + expect(execSinkTag[`${TAG_PREFIX}.${EXECUTED_SINK}`]).to.be.eq(1) + }) + + it('should merge all kind of metrics in global Namespace as gauges', () => { + namespace.count(REQUEST_TAINTED, { tag1: 'test' }).inc(10) + namespace.count(EXECUTED_SINK).inc(1) + + const metric = { + inc: sinon.spy() + } + sinon.stub(globalNamespace, 'count').returns(metric) + + finalizeRequestNamespace(context, rootSpan) + + expect(globalNamespace.count).to.be.calledTwice + expect(globalNamespace.count.firstCall.args).to.be.deep.equal([REQUEST_TAINTED, ['tag1:test']]) + expect(metric.inc).to.be.calledTwice + expect(metric.inc.firstCall.args[0]).to.equal(10) + + expect(globalNamespace.count.secondCall.args).to.be.deep.equal([EXECUTED_SINK, []]) + expect(metric.inc.secondCall.args[0]).to.equal(1) + }) +}) diff --git a/packages/dd-trace/test/appsec/iast/telemetry/span-tags.spec.js b/packages/dd-trace/test/appsec/iast/telemetry/span-tags.spec.js new file mode 100644 index 00000000000..796e06985e2 --- /dev/null +++ b/packages/dd-trace/test/appsec/iast/telemetry/span-tags.spec.js @@ -0,0 +1,78 @@ +'use strict' + +const { expect } = require('chai') +const { EXECUTED_SINK, EXECUTED_SOURCE, REQUEST_TAINTED } = require('../../../../src/appsec/iast/telemetry/iast-metric') +const { addMetricsToSpan } = require('../../../../src/appsec/iast/telemetry/span-tags') +const { + getNamespaceFromContext, + initRequestNamespace, + globalNamespace +} = require('../../../../src/appsec/iast/telemetry/namespaces') + +describe('Telemetry Span tags', () => { + const tagPrefix = '_dd.test' + let rootSpan, context + + beforeEach(() => { + rootSpan = { + addTags: sinon.spy() + } + context = {} + initRequestNamespace(context) + + globalNamespace.metrics.clear() + }) + + afterEach(sinon.restore) + + it('should add span tags with tag name like \'tagPrefix.metricName.tagKey\' for tagged metrics', () => { + EXECUTED_SOURCE.add(42, 'source.type.1', context) + EXECUTED_SINK.add(3, 'sink_type_1', context) + + const { metrics } = getNamespaceFromContext(context).toJSON() + + addMetricsToSpan(rootSpan, metrics.series, tagPrefix) + + expect(rootSpan.addTags).to.be.calledTwice + expect(rootSpan.addTags.firstCall.args[0]).to.deep.eq({ '_dd.test.executed.source.source_type_1': 42 }) + expect(rootSpan.addTags.secondCall.args[0]).to.deep.eq({ '_dd.test.executed.sink.sink_type_1': 3 }) + }) + + it('should add span tags with tag name like \'tagPrefix.metricName.tagKey\' for tagged metrics flattened', () => { + // a request metric with no context it behaves like a global metric + EXECUTED_SOURCE.add(42, 'source.type.1') + EXECUTED_SOURCE.add(32, 'source.type.1') + + const { metrics } = globalNamespace.toJSON() + + addMetricsToSpan(rootSpan, metrics.series, tagPrefix) + + expect(rootSpan.addTags).to.be.calledOnceWithExactly({ '_dd.test.executed.source.source_type_1': 74 }) + }) + + it('should add span tags with tag name like \'tagPrefix.metricName.tagKey\' for different tagged metrics', () => { + // a request metric with no context it behaves like a global metric + EXECUTED_SOURCE.add(42, 'source.type.1') + EXECUTED_SOURCE.add(32, 'source.type.1') + + EXECUTED_SOURCE.add(2, 'source.type.2') + + const { metrics } = globalNamespace.toJSON() + + addMetricsToSpan(rootSpan, metrics.series, tagPrefix) + + expect(rootSpan.addTags).to.be.calledTwice + expect(rootSpan.addTags.firstCall.args[0]).to.deep.eq({ '_dd.test.executed.source.source_type_1': 74 }) + expect(rootSpan.addTags.secondCall.args[0]).to.deep.eq({ '_dd.test.executed.source.source_type_2': 2 }) + }) + + it('should add span tags with tag name like \'tagPrefix.metricName\' for not tagged metrics', () => { + REQUEST_TAINTED.add(42, null, context) + + const { metrics } = getNamespaceFromContext(context).toJSON() + + addMetricsToSpan(rootSpan, metrics.series, tagPrefix) + + expect(rootSpan.addTags).to.be.calledOnceWithExactly({ '_dd.test.request.tainted': 42 }) + }) +}) diff --git a/packages/dd-trace/test/appsec/iast/telemetry/verbosity.spec.js b/packages/dd-trace/test/appsec/iast/telemetry/verbosity.spec.js new file mode 100644 index 00000000000..37d2e0b939d --- /dev/null +++ b/packages/dd-trace/test/appsec/iast/telemetry/verbosity.spec.js @@ -0,0 +1,49 @@ +'use strict' + +const { expect } = require('chai') +const { getVerbosity, getName, Verbosity, isDebugAllowed, isInfoAllowed } = + require('../../../../src/appsec/iast/telemetry/verbosity') + +describe('Telemetry Verbosity', () => { + describe('getVerbosity', () => { + beforeEach(() => { + const path = require.resolve('../../../../src/appsec/iast/telemetry/verbosity') + delete require.cache[path] + }) + + it('should get verbosity regardless of capitalization', () => { + expect(getVerbosity('dEBug')).to.be.eq(Verbosity.DEBUG) + }) + + it('should get verbosity default verbosity if invalid env var', () => { + expect(getVerbosity('Invalid')).to.be.eq(Verbosity.INFORMATION) + }) + + it('should get verbosity default verbosity if empty env var', () => { + expect(getVerbosity()).to.be.eq(Verbosity.INFORMATION) + }) + }) + + describe('getName and others', () => { + it('should obtain name from verbosity', () => { + expect(getName(Verbosity.DEBUG)).to.be.equal('DEBUG') + expect(getName(Verbosity.INFORMATION)).to.be.equal('INFORMATION') + expect(getName(Verbosity.MANDATORY)).to.be.equal('MANDATORY') + expect(getName(Verbosity.OFF)).to.be.equal('OFF') + }) + + it('should handle debug verbosity level', () => { + expect(isDebugAllowed(Verbosity.OFF)).to.be.false + expect(isDebugAllowed(Verbosity.MANDATORY)).to.be.false + expect(isDebugAllowed(Verbosity.INFORMATION)).to.be.false + expect(isDebugAllowed(Verbosity.DEBUG)).to.be.true + }) + + it('should handle info verbosity level', () => { + expect(isInfoAllowed(Verbosity.OFF)).to.be.false + expect(isInfoAllowed(Verbosity.MANDATORY)).to.be.false + expect(isInfoAllowed(Verbosity.INFORMATION)).to.be.true + expect(isInfoAllowed(Verbosity.DEBUG)).to.be.true + }) + }) +}) diff --git a/packages/dd-trace/test/config.spec.js b/packages/dd-trace/test/config.spec.js index cffcfe60cea..f80aee05e7c 100644 --- a/packages/dd-trace/test/config.spec.js +++ b/packages/dd-trace/test/config.spec.js @@ -115,6 +115,7 @@ describe('Config', () => { expect(config).to.have.nested.property('remoteConfig.pollInterval', 5) expect(config).to.have.nested.property('iast.enabled', false) expect(config).to.have.nested.property('iast.redactionEnabled', true) + expect(config).to.have.nested.property('iast.telemetryVerbosity', 'INFORMATION') }) it('should support logging', () => { @@ -164,6 +165,7 @@ describe('Config', () => { process.env.DD_TRACE_AGENT_PROTOCOL_VERSION = '0.5' process.env.DD_SERVICE = 'service' process.env.DD_SERVICE_MAPPING = 'a:aa, b:bb' + process.env.DD_TRACE_PEER_SERVICE_MAPPING = 'c:cc, d:dd' process.env.DD_VERSION = '1.0.0' process.env.DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP = '.*' process.env.DD_TRACE_CLIENT_IP_ENABLED = 'true' @@ -211,6 +213,7 @@ describe('Config', () => { process.env.DD_IAST_MAX_CONTEXT_OPERATIONS = '4' process.env.DD_IAST_DEDUPLICATION_ENABLED = false process.env.DD_IAST_REDACTION_ENABLED = false + process.env.DD_IAST_TELEMETRY_VERBOSITY = 'DEBUG' process.env.DD_TRACE_128_BIT_TRACEID_GENERATION_ENABLED = 'true' process.env.DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED = 'true' @@ -256,6 +259,10 @@ describe('Config', () => { a: 'aa', b: 'bb' }) + expect(config).to.have.deep.property('peerServiceMapping', { + c: 'cc', + d: 'dd' + }) expect(config).to.have.nested.deep.property('tracePropagationStyle.inject', ['b3', 'tracecontext']) expect(config).to.have.nested.deep.property('tracePropagationStyle.extract', ['b3', 'tracecontext']) expect(config).to.have.nested.property('experimental.runtimeId', true) @@ -280,6 +287,7 @@ describe('Config', () => { expect(config).to.have.nested.property('iast.maxContextOperations', 4) expect(config).to.have.nested.property('iast.deduplicationEnabled', false) expect(config).to.have.nested.property('iast.redactionEnabled', false) + expect(config).to.have.nested.property('iast.telemetryVerbosity', 'DEBUG') }) it('should read case-insensitive booleans from environment variables', () => { @@ -392,7 +400,8 @@ describe('Config', () => { maxConcurrentRequests: 4, maxContextOperations: 5, deduplicationEnabled: false, - redactionEnabled: false + redactionEnabled: false, + telemetryVerbosity: 'DEBUG' } }, appsec: false, @@ -445,6 +454,7 @@ describe('Config', () => { expect(config).to.have.nested.property('iast.maxContextOperations', 5) expect(config).to.have.nested.property('iast.deduplicationEnabled', false) expect(config).to.have.nested.property('iast.redactionEnabled', false) + expect(config).to.have.nested.property('iast.telemetryVerbosity', 'DEBUG') expect(config).to.have.deep.nested.property('sampler', { sampleRate: 0.5, rateLimit: 1000, @@ -555,6 +565,7 @@ describe('Config', () => { process.env.DD_TRACE_PARTIAL_FLUSH_MIN_SPANS = 2000 process.env.DD_SERVICE = 'service' process.env.DD_SERVICE_MAPPING = 'a:aa' + process.env.DD_TRACE_PEER_SERVICE_MAPPING = 'c:cc' process.env.DD_VERSION = '0.0.0' process.env.DD_RUNTIME_METRICS_ENABLED = 'true' process.env.DD_TRACE_REPORT_HOSTNAME = 'true' @@ -609,6 +620,9 @@ describe('Config', () => { serviceMapping: { b: 'bb' }, + peerServiceMapping: { + d: 'dd' + }, tracePropagationStyle: { inject: [], extract: [] @@ -663,6 +677,7 @@ describe('Config', () => { expect(config.tags).to.include({ foo: 'foo', baz: 'qux' }) expect(config.tags).to.include({ service: 'test', version: '1.0.0', env: 'development' }) expect(config).to.have.deep.property('serviceMapping', { b: 'bb' }) + expect(config).to.have.deep.property('peerServiceMapping', { d: 'dd' }) expect(config).to.have.nested.deep.property('tracePropagationStyle.inject', []) expect(config).to.have.nested.deep.property('tracePropagationStyle.extract', []) expect(config).to.have.nested.property('experimental.runtimeId', false) @@ -849,6 +864,7 @@ describe('Config', () => { expect(config.telemetry.heartbeatInterval).to.eq(60000) expect(config.telemetry.logCollection).to.be.false expect(config.telemetry.debug).to.be.false + expect(config.telemetry.metrics).to.be.false }) it('should set DD_TELEMETRY_HEARTBEAT_INTERVAL', () => { @@ -873,6 +889,17 @@ describe('Config', () => { process.env.DD_TRACE_TELEMETRY_ENABLED = origTraceTelemetryValue }) + it('should set DD_TELEMETRY_METRICS_ENABLED', () => { + const origTelemetryMetricsEnabledValue = process.env.DD_TELEMETRY_METRICS_ENABLED + process.env.DD_TELEMETRY_METRICS_ENABLED = 'true' + + const config = new Config() + + expect(config.telemetry.metrics).to.be.true + + process.env.DD_TELEMETRY_METRICS_ENABLED = origTelemetryMetricsEnabledValue + }) + it('should set DD_TELEMETRY_LOG_COLLECTION_ENABLED = false', () => { const origLogCollectionValue = process.env.DD_TELEMETRY_LOG_COLLECTION_ENABLED process.env.DD_TELEMETRY_LOG_COLLECTION_ENABLED = 'false' diff --git a/packages/dd-trace/test/plugins/outbound.spec.js b/packages/dd-trace/test/plugins/outbound.spec.js index 2967ce2aa32..fd159e49a48 100644 --- a/packages/dd-trace/test/plugins/outbound.spec.js +++ b/packages/dd-trace/test/plugins/outbound.spec.js @@ -2,9 +2,54 @@ require('../setup/tap') +const { expect } = require('chai') const OutboundPlugin = require('../../src/plugins/outbound') describe('OuboundPlugin', () => { + describe('peer service decision', () => { + let instance = null + let computePeerServiceStub = null + let getPeerServiceStub = null + let getRemapStub = null + + beforeEach(() => { + instance = new OutboundPlugin() + computePeerServiceStub = sinon.stub(instance, 'tracer') + getPeerServiceStub = sinon.stub(instance, 'getPeerService') + getRemapStub = sinon.stub(instance, 'getPeerServiceRemap') + }) + + afterEach(() => { + computePeerServiceStub.restore() + getPeerServiceStub.restore() + getRemapStub.restore() + }) + + it('should attempt to remap when we found peer service', () => { + computePeerServiceStub.value({ _computePeerService: true }) + getPeerServiceStub.returns({ foo: 'bar' }) + instance.tagPeerService({ context: () => { return { _tags: {} } }, addTags: () => {} }) + + expect(getPeerServiceStub).to.be.called + expect(getRemapStub).to.be.called + }) + + it('should not attempt to remap if we found no peer service', () => { + computePeerServiceStub.value({ _computePeerService: true }) + getPeerServiceStub.returns(undefined) + instance.tagPeerService({ context: () => { return { _tags: {} } }, addTags: () => {} }) + + expect(getPeerServiceStub).to.be.called + expect(getRemapStub).to.not.be.called + }) + + it('should do nothing when disabled', () => { + computePeerServiceStub.value({ _computePeerService: false }) + instance.tagPeerService({ context: () => { return { _tags: {} } }, addTags: () => {} }) + expect(getPeerServiceStub).to.not.be.called + expect(getRemapStub).to.not.be.called + }) + }) describe('peer.service computation', () => { let instance = null @@ -16,7 +61,7 @@ describe('OuboundPlugin', () => { const res = instance.getPeerService({ fooIsNotAPrecursor: 'bar' }) - expect(res).to.deep.equal({}) + expect(res).to.equal(undefined) }) it('should grab from remote host in datadog format', () => { @@ -56,4 +101,58 @@ describe('OuboundPlugin', () => { }) }) }) + describe('remapping computation', () => { + let instance = null + let mappingStub = null + const peerData = { + 'peer.service': 'foosvc', + '_dd.peer.service.source': 'out.host' + } + + beforeEach(() => { + instance = new OutboundPlugin() + }) + + afterEach(() => { + mappingStub.restore() + }) + + it('should return peer data unchanged if there is no peer service', () => { + const mappingData = instance.getPeerServiceRemap({ 'foo': 'bar' }) + mappingStub = sinon.stub(instance, 'tracer') + expect(mappingData).to.deep.equal({ 'foo': 'bar' }) + }) + + it('should return peer data unchanged if no mapping is available', () => { + mappingStub = sinon.stub(instance, 'tracer').value({ _peerServiceMapping: {} }) + const mappingData = instance.getPeerServiceRemap(peerData) + expect(mappingData).to.deep.equal(peerData) + }) + + it('should return peer data unchanged if no mapping item matches', () => { + mappingStub = sinon.stub(instance, 'tracer').value({ + _peerServiceMapping: { + barsvc: 'bar', + bazsvc: 'baz' + } + }) + const mappingData = instance.getPeerServiceRemap(peerData) + expect(mappingData).to.deep.equal(peerData) + }) + + it('should remap if a mapping item matches', () => { + mappingStub = sinon.stub(instance, 'tracer').value({ + _peerServiceMapping: { + foosvc: 'foo', + bazsvc: 'baz' + } + }) + const mappingData = instance.getPeerServiceRemap(peerData) + expect(mappingData).to.deep.equal({ + 'peer.service': 'foo', + '_dd.peer.service.source': 'out.host', + '_dd.peer.service.remapped_from': 'foosvc' + }) + }) + }) }) diff --git a/packages/dd-trace/test/plugins/util/ci-env/appveyor.json b/packages/dd-trace/test/plugins/util/ci-env/appveyor.json index 356b75f318c..def208d7110 100644 --- a/packages/dd-trace/test/plugins/util/ci-env/appveyor.json +++ b/packages/dd-trace/test/plugins/util/ci-env/appveyor.json @@ -6,7 +6,7 @@ "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_REPO_BRANCH": "master", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -26,7 +26,7 @@ "git.commit.author.email": "appveyor-commit-author-email@datadoghq.com", "git.commit.author.name": "appveyor-commit-author-name", "git.commit.message": "appveyor-commit-message\nappveyor-commit-message-extended", - "git.commit.sha": "appveyor-repo-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/appveyor-repo-name.git" } ], @@ -37,7 +37,7 @@ "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_REPO_BRANCH": "master", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -57,7 +57,7 @@ "git.commit.author.email": "appveyor-commit-author-email@datadoghq.com", "git.commit.author.name": "appveyor-commit-author-name", "git.commit.message": "appveyor-commit-message\nappveyor-commit-message-extended", - "git.commit.sha": "appveyor-repo-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/appveyor-repo-name.git" } ], @@ -68,7 +68,7 @@ "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_REPO_BRANCH": "master", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -88,7 +88,7 @@ "git.commit.author.email": "appveyor-commit-author-email@datadoghq.com", "git.commit.author.name": "appveyor-commit-author-name", "git.commit.message": "appveyor-commit-message\nappveyor-commit-message-extended", - "git.commit.sha": "appveyor-repo-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/appveyor-repo-name.git" } ], @@ -99,7 +99,7 @@ "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_REPO_BRANCH": "master", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -119,7 +119,7 @@ "git.commit.author.email": "appveyor-commit-author-email@datadoghq.com", "git.commit.author.name": "appveyor-commit-author-name", "git.commit.message": "appveyor-commit-message\nappveyor-commit-message-extended", - "git.commit.sha": "appveyor-repo-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/appveyor-repo-name.git" } ], @@ -130,7 +130,7 @@ "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_REPO_BRANCH": "master", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -152,7 +152,7 @@ "git.commit.author.email": "appveyor-commit-author-email@datadoghq.com", "git.commit.author.name": "appveyor-commit-author-name", "git.commit.message": "appveyor-commit-message\nappveyor-commit-message-extended", - "git.commit.sha": "appveyor-repo-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/appveyor-repo-name.git" } ], @@ -163,7 +163,7 @@ "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_REPO_BRANCH": "master", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -183,7 +183,7 @@ "git.commit.author.email": "appveyor-commit-author-email@datadoghq.com", "git.commit.author.name": "appveyor-commit-author-name", "git.commit.message": "appveyor-commit-message\nappveyor-commit-message-extended", - "git.commit.sha": "appveyor-repo-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/appveyor-repo-name.git" } ], @@ -194,7 +194,7 @@ "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_REPO_BRANCH": "master", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -216,7 +216,7 @@ "git.commit.author.email": "appveyor-commit-author-email@datadoghq.com", "git.commit.author.name": "appveyor-commit-author-name", "git.commit.message": "appveyor-commit-message\nappveyor-commit-message-extended", - "git.commit.sha": "appveyor-repo-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/appveyor-repo-name.git" } ], @@ -227,7 +227,7 @@ "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_REPO_BRANCH": "master", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -254,7 +254,7 @@ "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_REPO_BRANCH": "origin/master", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -274,7 +274,7 @@ "git.commit.author.email": "appveyor-commit-author-email@datadoghq.com", "git.commit.author.name": "appveyor-commit-author-name", "git.commit.message": "appveyor-commit-message\nappveyor-commit-message-extended", - "git.commit.sha": "appveyor-repo-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/appveyor-repo-name.git" } ], @@ -285,7 +285,7 @@ "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_REPO_BRANCH": "refs/heads/master", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -305,7 +305,7 @@ "git.commit.author.email": "appveyor-commit-author-email@datadoghq.com", "git.commit.author.name": "appveyor-commit-author-name", "git.commit.message": "appveyor-commit-message\nappveyor-commit-message-extended", - "git.commit.sha": "appveyor-repo-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/appveyor-repo-name.git" } ], @@ -316,7 +316,7 @@ "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_REPO_BRANCH": "refs/heads/feature/one", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -336,7 +336,7 @@ "git.commit.author.email": "appveyor-commit-author-email@datadoghq.com", "git.commit.author.name": "appveyor-commit-author-name", "git.commit.message": "appveyor-commit-message\nappveyor-commit-message-extended", - "git.commit.sha": "appveyor-repo-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/appveyor-repo-name.git" } ], @@ -348,7 +348,7 @@ "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH": "origin/pr", "APPVEYOR_REPO_BRANCH": "origin/master", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -368,7 +368,7 @@ "git.commit.author.email": "appveyor-commit-author-email@datadoghq.com", "git.commit.author.name": "appveyor-commit-author-name", "git.commit.message": "appveyor-commit-message\nappveyor-commit-message-extended", - "git.commit.sha": "appveyor-repo-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/appveyor-repo-name.git" } ], @@ -380,7 +380,7 @@ "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH": "refs/heads/pr", "APPVEYOR_REPO_BRANCH": "refs/heads/master", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -400,7 +400,7 @@ "git.commit.author.email": "appveyor-commit-author-email@datadoghq.com", "git.commit.author.name": "appveyor-commit-author-name", "git.commit.message": "appveyor-commit-message\nappveyor-commit-message-extended", - "git.commit.sha": "appveyor-repo-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/appveyor-repo-name.git" } ], @@ -411,7 +411,7 @@ "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_REPO_BRANCH": "origin/master", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -432,7 +432,7 @@ "git.commit.author.email": "appveyor-commit-author-email@datadoghq.com", "git.commit.author.name": "appveyor-commit-author-name", "git.commit.message": "appveyor-commit-message\nappveyor-commit-message-extended", - "git.commit.sha": "appveyor-repo-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/appveyor-repo-name.git", "git.tag": "0.1.0" } @@ -444,7 +444,7 @@ "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", "APPVEYOR_REPO_BRANCH": "refs/heads/master", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -465,7 +465,7 @@ "git.commit.author.email": "appveyor-commit-author-email@datadoghq.com", "git.commit.author.name": "appveyor-commit-author-name", "git.commit.message": "appveyor-commit-message\nappveyor-commit-message-extended", - "git.commit.sha": "appveyor-repo-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/appveyor-repo-name.git", "git.tag": "0.1.0" } @@ -475,7 +475,7 @@ "APPVEYOR": "true", "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", @@ -516,7 +516,7 @@ "APPVEYOR": "true", "APPVEYOR_BUILD_ID": "appveyor-build-id", "APPVEYOR_BUILD_NUMBER": "appveyor-pipeline-number", - "APPVEYOR_REPO_COMMIT": "appveyor-repo-commit", + "APPVEYOR_REPO_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "APPVEYOR_REPO_COMMIT_AUTHOR": "appveyor-commit-author-name", "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL": "appveyor-commit-author-email@datadoghq.com", "APPVEYOR_REPO_COMMIT_MESSAGE": "appveyor-commit-message", diff --git a/packages/dd-trace/test/plugins/util/ci-env/azurepipelines.json b/packages/dd-trace/test/plugins/util/ci-env/azurepipelines.json index 1ce9636e449..9262c329866 100644 --- a/packages/dd-trace/test/plugins/util/ci-env/azurepipelines.json +++ b/packages/dd-trace/test/plugins/util/ci-env/azurepipelines.json @@ -3,12 +3,12 @@ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "master", "BUILD_SOURCESDIRECTORY": "/foo/bar", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "SYSTEM_JOBID": "azure-pipelines-job-id", "SYSTEM_TASKINSTANCEID": "azure-pipelines-task-id", @@ -29,23 +29,23 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commit", - "git.repository_url": "https://azure-pipelines-server-uri.com/build" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "master", "BUILD_SOURCESDIRECTORY": "/foo/bar", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "SYSTEM_JOBID": "azure-pipelines-job-id", - "SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI": "https://azure-pipelines-server-uri.com/pull", + "SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI": "https://azure-pipelines-server-uri.com/pull.git", "SYSTEM_TASKINSTANCEID": "azure-pipelines-task-id", "SYSTEM_TEAMFOUNDATIONSERVERURI": "https://azure-pipelines-server-uri.com/", "SYSTEM_TEAMPROJECTID": "azure-pipelines-project-id", @@ -64,20 +64,20 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commit", - "git.repository_url": "https://azure-pipelines-server-uri.com/pull" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/pull.git" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "origin/master", "BUILD_SOURCESDIRECTORY": "foo/bar", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "SYSTEM_JOBID": "azure-pipelines-job-id", "SYSTEM_TASKINSTANCEID": "azure-pipelines-task-id", @@ -98,20 +98,20 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commit", - "git.repository_url": "https://azure-pipelines-server-uri.com/build" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "origin/master", "BUILD_SOURCESDIRECTORY": "/foo/bar~", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "HOME": "/not-my-home", "SYSTEM_JOBID": "azure-pipelines-job-id", @@ -134,20 +134,20 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commit", - "git.repository_url": "https://azure-pipelines-server-uri.com/build" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "origin/master", "BUILD_SOURCESDIRECTORY": "/foo/~/bar", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "HOME": "/not-my-home", "SYSTEM_JOBID": "azure-pipelines-job-id", @@ -170,20 +170,20 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commit", - "git.repository_url": "https://azure-pipelines-server-uri.com/build" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "origin/master", "BUILD_SOURCESDIRECTORY": "~/foo/bar", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "HOME": "/not-my-home", "SYSTEM_JOBID": "azure-pipelines-job-id", @@ -206,20 +206,20 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commit", - "git.repository_url": "https://azure-pipelines-server-uri.com/build" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "origin/master", "BUILD_SOURCESDIRECTORY": "~foo/bar", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "HOME": "/not-my-home", "SYSTEM_JOBID": "azure-pipelines-job-id", @@ -242,20 +242,20 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commit", - "git.repository_url": "https://azure-pipelines-server-uri.com/build" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "origin/master", "BUILD_SOURCESDIRECTORY": "~", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "HOME": "/not-my-home", "SYSTEM_JOBID": "azure-pipelines-job-id", @@ -278,20 +278,20 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commit", - "git.repository_url": "https://azure-pipelines-server-uri.com/build" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "origin/master", "BUILD_SOURCESDIRECTORY": "/foo/bar", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "SYSTEM_JOBID": "azure-pipelines-job-id", "SYSTEM_TASKINSTANCEID": "azure-pipelines-task-id", @@ -312,20 +312,20 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commit", - "git.repository_url": "https://azure-pipelines-server-uri.com/build" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "refs/heads/master", "BUILD_SOURCESDIRECTORY": "/foo/bar", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "SYSTEM_JOBID": "azure-pipelines-job-id", "SYSTEM_TASKINSTANCEID": "azure-pipelines-task-id", @@ -346,20 +346,20 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commit", - "git.repository_url": "https://azure-pipelines-server-uri.com/build" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "refs/heads/feature/one", "BUILD_SOURCESDIRECTORY": "/foo/bar", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "SYSTEM_JOBID": "azure-pipelines-job-id", "SYSTEM_TASKINSTANCEID": "azure-pipelines-task-id", @@ -380,20 +380,20 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commit", - "git.repository_url": "https://azure-pipelines-server-uri.com/build" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "origin/tags/0.1.0", "BUILD_SOURCESDIRECTORY": "/foo/bar", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "SYSTEM_JOBID": "azure-pipelines-job-id", "SYSTEM_TASKINSTANCEID": "azure-pipelines-task-id", @@ -413,8 +413,8 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commit", - "git.repository_url": "https://azure-pipelines-server-uri.com/build", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git", "git.tag": "0.1.0" } ], @@ -422,12 +422,12 @@ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "refs/heads/tags/0.1.0", "BUILD_SOURCESDIRECTORY": "/foo/bar", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "SYSTEM_JOBID": "azure-pipelines-job-id", "SYSTEM_TASKINSTANCEID": "azure-pipelines-task-id", @@ -447,8 +447,8 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commit", - "git.repository_url": "https://azure-pipelines-server-uri.com/build", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git", "git.tag": "0.1.0" } ], @@ -456,16 +456,16 @@ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "origin/master", "BUILD_SOURCESDIRECTORY": "/foo/bar", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "SYSTEM_JOBID": "azure-pipelines-job-id", "SYSTEM_PULLREQUEST_SOURCEBRANCH": "origin/pr", - "SYSTEM_PULLREQUEST_SOURCECOMMITID": "commitPR", + "SYSTEM_PULLREQUEST_SOURCECOMMITID": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "SYSTEM_TASKINSTANCEID": "azure-pipelines-task-id", "SYSTEM_TEAMFOUNDATIONSERVERURI": "https://azure-pipelines-server-uri.com/", "SYSTEM_TEAMPROJECTID": "azure-pipelines-project-id", @@ -484,24 +484,24 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commitPR", - "git.repository_url": "https://azure-pipelines-server-uri.com/build" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "refs/heads/master", "BUILD_SOURCESDIRECTORY": "/foo/bar", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "SYSTEM_JOBID": "azure-pipelines-job-id", "SYSTEM_PULLREQUEST_SOURCEBRANCH": "refs/heads/pr", - "SYSTEM_PULLREQUEST_SOURCECOMMITID": "commitPR", + "SYSTEM_PULLREQUEST_SOURCECOMMITID": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "SYSTEM_STAGEDISPLAYNAME": "azure-pipelines-stage-name", "SYSTEM_TASKINSTANCEID": "azure-pipelines-task-id", "SYSTEM_TEAMFOUNDATIONSERVERURI": "https://azure-pipelines-server-uri.com/", @@ -522,25 +522,25 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commitPR", - "git.repository_url": "https://azure-pipelines-server-uri.com/build" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build", + "BUILD_REPOSITORY_URI": "https://azure-pipelines-server-uri.com/build.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEBRANCH": "refs/heads/feature/one", "BUILD_SOURCESDIRECTORY": "/foo/bar", - "BUILD_SOURCEVERSION": "commit", + "BUILD_SOURCEVERSION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", "SYSTEM_JOBDISPLAYNAME": "azure-pipelines-job-name", "SYSTEM_JOBID": "azure-pipelines-job-id", "SYSTEM_PULLREQUEST_SOURCEBRANCH": "refs/heads/pr", - "SYSTEM_PULLREQUEST_SOURCECOMMITID": "commitPR", + "SYSTEM_PULLREQUEST_SOURCECOMMITID": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "SYSTEM_TASKINSTANCEID": "azure-pipelines-task-id", "SYSTEM_TEAMFOUNDATIONSERVERURI": "https://azure-pipelines-server-uri.com/", "SYSTEM_TEAMPROJECTID": "azure-pipelines-project-id", @@ -560,8 +560,8 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.commit.sha": "commitPR", - "git.repository_url": "https://azure-pipelines-server-uri.com/build" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://azure-pipelines-server-uri.com/build.git" } ], [ @@ -654,7 +654,7 @@ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "https://user:password@dev.azure.com/fabrikamfiber/", + "BUILD_REPOSITORY_URI": "https://user:password@dev.azure.com/fabrikamfiber/repo.git", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", @@ -675,7 +675,7 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.repository_url": "https://dev.azure.com/fabrikamfiber/" + "git.repository_url": "https://dev.azure.com/fabrikamfiber/repo.git" } ] ] diff --git a/packages/dd-trace/test/plugins/util/ci-env/bitbucket.json b/packages/dd-trace/test/plugins/util/ci-env/bitbucket.json index 3a924128c16..4fa0d2fb0ce 100644 --- a/packages/dd-trace/test/plugins/util/ci-env/bitbucket.json +++ b/packages/dd-trace/test/plugins/util/ci-env/bitbucket.json @@ -4,8 +4,8 @@ "BITBUCKET_BRANCH": "master", "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_CLONE_DIR": "/foo/bar", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo" }, @@ -18,8 +18,8 @@ "ci.provider.name": "bitbucket", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "bitbucket-commit", - "git.repository_url": "https://bitbucket-repo-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitbucket-repo-url.com/repo.git" } ], [ @@ -27,8 +27,8 @@ "BITBUCKET_BRANCH": "master", "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_CLONE_DIR": "foo/bar", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo" }, @@ -41,8 +41,8 @@ "ci.provider.name": "bitbucket", "ci.workspace_path": "foo/bar", "git.branch": "master", - "git.commit.sha": "bitbucket-commit", - "git.repository_url": "https://bitbucket-repo-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitbucket-repo-url.com/repo.git" } ], [ @@ -50,7 +50,7 @@ "BITBUCKET_BRANCH": "master", "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_CLONE_DIR": "foo/bar", - "BITBUCKET_COMMIT": "bitbucket-commit", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BITBUCKET_GIT_SSH_ORIGIN": "git@github.com:DataDog/dummy-example.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo" @@ -64,7 +64,7 @@ "ci.provider.name": "bitbucket", "ci.workspace_path": "foo/bar", "git.branch": "master", - "git.commit.sha": "bitbucket-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "git@github.com:DataDog/dummy-example.git" } ], @@ -73,8 +73,8 @@ "BITBUCKET_BRANCH": "master", "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_CLONE_DIR": "/foo/bar~", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo" }, @@ -87,8 +87,8 @@ "ci.provider.name": "bitbucket", "ci.workspace_path": "/foo/bar~", "git.branch": "master", - "git.commit.sha": "bitbucket-commit", - "git.repository_url": "https://bitbucket-repo-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitbucket-repo-url.com/repo.git" } ], [ @@ -96,8 +96,8 @@ "BITBUCKET_BRANCH": "master", "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_CLONE_DIR": "/foo/~/bar", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo" }, @@ -110,8 +110,8 @@ "ci.provider.name": "bitbucket", "ci.workspace_path": "/foo/~/bar", "git.branch": "master", - "git.commit.sha": "bitbucket-commit", - "git.repository_url": "https://bitbucket-repo-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitbucket-repo-url.com/repo.git" } ], [ @@ -119,8 +119,8 @@ "BITBUCKET_BRANCH": "master", "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_CLONE_DIR": "~/foo/bar", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo", "HOME": "/not-my-home", @@ -135,8 +135,8 @@ "ci.provider.name": "bitbucket", "ci.workspace_path": "/not-my-home/foo/bar", "git.branch": "master", - "git.commit.sha": "bitbucket-commit", - "git.repository_url": "https://bitbucket-repo-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitbucket-repo-url.com/repo.git" } ], [ @@ -144,8 +144,8 @@ "BITBUCKET_BRANCH": "master", "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_CLONE_DIR": "~foo/bar", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo" }, @@ -158,8 +158,8 @@ "ci.provider.name": "bitbucket", "ci.workspace_path": "~foo/bar", "git.branch": "master", - "git.commit.sha": "bitbucket-commit", - "git.repository_url": "https://bitbucket-repo-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitbucket-repo-url.com/repo.git" } ], [ @@ -167,8 +167,8 @@ "BITBUCKET_BRANCH": "master", "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_CLONE_DIR": "~", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo", "HOME": "/not-my-home", @@ -183,8 +183,8 @@ "ci.provider.name": "bitbucket", "ci.workspace_path": "/not-my-home", "git.branch": "master", - "git.commit.sha": "bitbucket-commit", - "git.repository_url": "https://bitbucket-repo-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitbucket-repo-url.com/repo.git" } ], [ @@ -192,8 +192,8 @@ "BITBUCKET_BRANCH": "master", "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_CLONE_DIR": "/foo/bar", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo" }, @@ -206,8 +206,8 @@ "ci.provider.name": "bitbucket", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "bitbucket-commit", - "git.repository_url": "https://bitbucket-repo-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitbucket-repo-url.com/repo.git" } ], [ @@ -215,8 +215,8 @@ "BITBUCKET_BRANCH": "origin/master", "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_CLONE_DIR": "/foo/bar", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo" }, @@ -229,8 +229,8 @@ "ci.provider.name": "bitbucket", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "bitbucket-commit", - "git.repository_url": "https://bitbucket-repo-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitbucket-repo-url.com/repo.git" } ], [ @@ -238,8 +238,8 @@ "BITBUCKET_BRANCH": "refs/heads/master", "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_CLONE_DIR": "/foo/bar", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo" }, @@ -252,8 +252,8 @@ "ci.provider.name": "bitbucket", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "bitbucket-commit", - "git.repository_url": "https://bitbucket-repo-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitbucket-repo-url.com/repo.git" } ], [ @@ -261,8 +261,8 @@ "BITBUCKET_BRANCH": "refs/heads/feature/one", "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_CLONE_DIR": "/foo/bar", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo" }, @@ -275,16 +275,16 @@ "ci.provider.name": "bitbucket", "ci.workspace_path": "/foo/bar", "git.branch": "feature/one", - "git.commit.sha": "bitbucket-commit", - "git.repository_url": "https://bitbucket-repo-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitbucket-repo-url.com/repo.git" } ], [ { "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_CLONE_DIR": "/foo/bar", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo", "BITBUCKET_TAG": "origin/tags/0.1.0" @@ -297,8 +297,8 @@ "ci.pipeline.url": "https://bitbucket.org/bitbucket-repo/addon/pipelines/home#!/results/bitbucket-build-num", "ci.provider.name": "bitbucket", "ci.workspace_path": "/foo/bar", - "git.commit.sha": "bitbucket-commit", - "git.repository_url": "https://bitbucket-repo-url.com/", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitbucket-repo-url.com/repo.git", "git.tag": "0.1.0" } ], @@ -306,8 +306,8 @@ { "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_CLONE_DIR": "/foo/bar", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo", "BITBUCKET_TAG": "refs/heads/tags/0.1.0" @@ -320,16 +320,16 @@ "ci.pipeline.url": "https://bitbucket.org/bitbucket-repo/addon/pipelines/home#!/results/bitbucket-build-num", "ci.provider.name": "bitbucket", "ci.workspace_path": "/foo/bar", - "git.commit.sha": "bitbucket-commit", - "git.repository_url": "https://bitbucket-repo-url.com/", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitbucket-repo-url.com/repo.git", "git.tag": "0.1.0" } ], [ { "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo", "DD_GIT_BRANCH": "user-supplied-branch", @@ -365,8 +365,8 @@ [ { "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", - "BITBUCKET_COMMIT": "bitbucket-commit", - "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo", "DD_GIT_COMMIT_AUTHOR_DATE": "usersupplied-authordate", @@ -402,7 +402,7 @@ [ { "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", - "BITBUCKET_COMMIT": "bitbucket-commit", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BITBUCKET_GIT_SSH_ORIGIN": "https://user:password@bitbucket.org/DataDog/dogweb.git", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo" @@ -414,7 +414,7 @@ "ci.pipeline.number": "bitbucket-build-num", "ci.pipeline.url": "https://bitbucket.org/bitbucket-repo/addon/pipelines/home#!/results/bitbucket-build-num", "ci.provider.name": "bitbucket", - "git.commit.sha": "bitbucket-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://bitbucket.org/DataDog/dogweb.git" } ] diff --git a/packages/dd-trace/test/plugins/util/ci-env/bitrise.json b/packages/dd-trace/test/plugins/util/ci-env/bitrise.json index 2a279375c92..5563094dc01 100644 --- a/packages/dd-trace/test/plugins/util/ci-env/bitrise.json +++ b/packages/dd-trace/test/plugins/util/ci-env/bitrise.json @@ -4,12 +4,12 @@ "BITRISE_BUILD_NUMBER": "bitrise-pipeline-number", "BITRISE_BUILD_SLUG": "bitrise-pipeline-id", "BITRISE_BUILD_URL": "https://bitrise-build-url.com//", - "BITRISE_GIT_COMMIT": "gitcommit", + "BITRISE_GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_SOURCE_DIR": "/foo/bar", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", - "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/" + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/repo.git" }, { "ci.pipeline.id": "bitrise-pipeline-id", @@ -19,8 +19,8 @@ "ci.provider.name": "bitrise", "ci.workspace_path": "/foo/bar", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "gitcommit", - "git.repository_url": "https://bitrise-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitrise-build-url.com/repo.git" } ], [ @@ -28,11 +28,11 @@ "BITRISE_BUILD_NUMBER": "bitrise-pipeline-number", "BITRISE_BUILD_SLUG": "bitrise-pipeline-id", "BITRISE_BUILD_URL": "https://bitrise-build-url.com//", - "BITRISE_GIT_COMMIT": "gitcommit", + "BITRISE_GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_SOURCE_DIR": "/foo/bar", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_REPOSITORY_URL": "git@github.com:DataDog/dummy-example.git" }, { @@ -43,7 +43,7 @@ "ci.provider.name": "bitrise", "ci.workspace_path": "/foo/bar", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "gitcommit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "git@github.com:DataDog/dummy-example.git" } ], @@ -56,8 +56,8 @@ "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_SOURCE_DIR": "/foo/bar", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", - "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/" + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/repo.git" }, { "ci.pipeline.id": "bitrise-pipeline-id", @@ -68,8 +68,8 @@ "ci.workspace_path": "/foo/bar", "git.branch": "master", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", - "git.repository_url": "https://bitrise-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitrise-build-url.com/repo.git" } ], [ @@ -81,8 +81,8 @@ "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_SOURCE_DIR": "foo/bar", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", - "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/" + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/repo.git" }, { "ci.pipeline.id": "bitrise-pipeline-id", @@ -93,8 +93,8 @@ "ci.workspace_path": "foo/bar", "git.branch": "master", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", - "git.repository_url": "https://bitrise-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitrise-build-url.com/repo.git" } ], [ @@ -106,8 +106,8 @@ "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_SOURCE_DIR": "/foo/bar~", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", - "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/" + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/repo.git" }, { "ci.pipeline.id": "bitrise-pipeline-id", @@ -118,8 +118,8 @@ "ci.workspace_path": "/foo/bar~", "git.branch": "master", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", - "git.repository_url": "https://bitrise-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitrise-build-url.com/repo.git" } ], [ @@ -131,8 +131,8 @@ "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_SOURCE_DIR": "/foo/~/bar", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", - "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/" + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/repo.git" }, { "ci.pipeline.id": "bitrise-pipeline-id", @@ -143,8 +143,8 @@ "ci.workspace_path": "/foo/~/bar", "git.branch": "master", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", - "git.repository_url": "https://bitrise-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitrise-build-url.com/repo.git" } ], [ @@ -156,8 +156,8 @@ "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_SOURCE_DIR": "~/foo/bar", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", - "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/", + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/repo.git", "HOME": "/not-my-home", "USERPROFILE": "/not-my-home" }, @@ -170,8 +170,8 @@ "ci.workspace_path": "/not-my-home/foo/bar", "git.branch": "master", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", - "git.repository_url": "https://bitrise-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitrise-build-url.com/repo.git" } ], [ @@ -183,8 +183,8 @@ "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_SOURCE_DIR": "~foo/bar", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", - "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/", + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/repo.git", "HOME": "/not-my-home", "USERPROFILE": "/not-my-home" }, @@ -197,8 +197,8 @@ "ci.workspace_path": "~foo/bar", "git.branch": "master", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", - "git.repository_url": "https://bitrise-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitrise-build-url.com/repo.git" } ], [ @@ -210,8 +210,8 @@ "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_SOURCE_DIR": "~", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", - "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/", + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/repo.git", "HOME": "/not-my-home", "USERPROFILE": "/not-my-home" }, @@ -224,8 +224,8 @@ "ci.workspace_path": "/not-my-home", "git.branch": "master", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", - "git.repository_url": "https://bitrise-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitrise-build-url.com/repo.git" } ], [ @@ -237,8 +237,8 @@ "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_SOURCE_DIR": "/foo/bar", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", - "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/" + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/repo.git" }, { "ci.pipeline.id": "bitrise-pipeline-id", @@ -249,8 +249,8 @@ "ci.workspace_path": "/foo/bar", "git.branch": "master", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", - "git.repository_url": "https://bitrise-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitrise-build-url.com/repo.git" } ], [ @@ -262,8 +262,8 @@ "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_SOURCE_DIR": "/foo/bar", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", - "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/" + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/repo.git" }, { "ci.pipeline.id": "bitrise-pipeline-id", @@ -274,8 +274,8 @@ "ci.workspace_path": "/foo/bar", "git.branch": "feature/one", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", - "git.repository_url": "https://bitrise-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitrise-build-url.com/repo.git" } ], [ @@ -288,8 +288,8 @@ "BITRISE_GIT_TAG": "origin/tags/0.1.0", "BITRISE_SOURCE_DIR": "/foo/bar", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", - "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/" + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/repo.git" }, { "ci.pipeline.id": "bitrise-pipeline-id", @@ -299,8 +299,8 @@ "ci.provider.name": "bitrise", "ci.workspace_path": "/foo/bar", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", - "git.repository_url": "https://bitrise-build-url.com/", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitrise-build-url.com/repo.git", "git.tag": "0.1.0" } ], @@ -314,8 +314,8 @@ "BITRISE_GIT_TAG": "refs/heads/tags/0.1.0", "BITRISE_SOURCE_DIR": "/foo/bar", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", - "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/" + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_REPOSITORY_URL": "https://bitrise-build-url.com/repo.git" }, { "ci.pipeline.id": "bitrise-pipeline-id", @@ -325,8 +325,8 @@ "ci.provider.name": "bitrise", "ci.workspace_path": "/foo/bar", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", - "git.repository_url": "https://bitrise-build-url.com/", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitrise-build-url.com/repo.git", "git.tag": "0.1.0" } ], @@ -339,7 +339,7 @@ "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_SOURCE_DIR": "/foo/bar", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_REPOSITORY_URL": "http://hostname.com/repo.git" }, { @@ -351,7 +351,7 @@ "ci.workspace_path": "/foo/bar", "git.branch": "master", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -364,7 +364,7 @@ "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_SOURCE_DIR": "/foo/bar", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_REPOSITORY_URL": "git@hostname.com:org/repo.git" }, { @@ -376,7 +376,7 @@ "ci.workspace_path": "/foo/bar", "git.branch": "master", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "git@hostname.com:org/repo.git" } ], @@ -389,7 +389,7 @@ "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_SOURCE_DIR": "/foo/bar", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_REPOSITORY_URL": "git@hostname.com:org/repo.git" }, { @@ -401,7 +401,7 @@ "ci.workspace_path": "/foo/bar", "git.branch": "notmaster", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "git@hostname.com:org/repo.git" } ], @@ -422,7 +422,7 @@ "DD_GIT_COMMIT_MESSAGE": "usersupplied-message", "DD_GIT_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "DD_GIT_REPOSITORY_URL": "git@github.com:DataDog/userrepo.git", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit" + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123" }, { "ci.pipeline.id": "bitrise-pipeline-id", @@ -459,7 +459,7 @@ "DD_GIT_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "DD_GIT_REPOSITORY_URL": "git@github.com:DataDog/userrepo.git", "DD_GIT_TAG": "0.0.2", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit" + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123" }, { "ci.pipeline.id": "bitrise-pipeline-id", @@ -486,7 +486,7 @@ "BITRISE_BUILD_URL": "https://bitrise-build-url.com//", "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", - "GIT_CLONE_COMMIT_HASH": "bitrise-git-commit", + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_REPOSITORY_URL": "https://user:password@github.com/DataDog/dogweb.git" }, { @@ -496,7 +496,7 @@ "ci.pipeline.url": "https://bitrise-build-url.com//", "ci.provider.name": "bitrise", "git.commit.message": "bitrise-git-commit-message", - "git.commit.sha": "bitrise-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/DataDog/dogweb.git" } ] diff --git a/packages/dd-trace/test/plugins/util/ci-env/buddy.json b/packages/dd-trace/test/plugins/util/ci-env/buddy.json index 57f34d10a8b..26bf616455b 100644 --- a/packages/dd-trace/test/plugins/util/ci-env/buddy.json +++ b/packages/dd-trace/test/plugins/util/ci-env/buddy.json @@ -4,7 +4,7 @@ "BUDDY": "true", "BUDDY_EXECUTION_BRANCH": "master", "BUDDY_EXECUTION_ID": "buddy-execution-id", - "BUDDY_EXECUTION_REVISION": "e5e13f8b7f8d5c6096a0501dc09b48eef05fea96", + "BUDDY_EXECUTION_REVISION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUDDY_EXECUTION_REVISION_COMMITTER_EMAIL": "mikebenson@buddy.works", "BUDDY_EXECUTION_REVISION_COMMITTER_NAME": "Mike Benson", "BUDDY_EXECUTION_REVISION_MESSAGE": "Create buddy.yml", @@ -12,7 +12,7 @@ "BUDDY_EXECUTION_URL": "https://app.buddy.works/myworkspace/my-project/pipelines/pipeline/456/execution/5d9dc42c422f5a268b389d08", "BUDDY_PIPELINE_ID": "456", "BUDDY_PIPELINE_NAME": "Deploy to Production", - "BUDDY_SCM_URL": "https://github.com/buddyworks/my-project" + "BUDDY_SCM_URL": "https://github.com/buddyworks/my-project.git" }, { "ci.pipeline.id": "456/buddy-execution-id", @@ -24,8 +24,8 @@ "git.commit.committer.email": "mikebenson@buddy.works", "git.commit.committer.name": "Mike Benson", "git.commit.message": "Create buddy.yml", - "git.commit.sha": "e5e13f8b7f8d5c6096a0501dc09b48eef05fea96", - "git.repository_url": "https://github.com/buddyworks/my-project", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://github.com/buddyworks/my-project.git", "git.tag": "v1.0" } ], @@ -34,7 +34,7 @@ "BUDDY": "true", "BUDDY_EXECUTION_BRANCH": "my-name-is-rotag/fix-original-bug", "BUDDY_EXECUTION_ID": "buddy-execution-id", - "BUDDY_EXECUTION_REVISION": "e5e13f8b7f8d5c6096a0501dc09b48eef05fea96", + "BUDDY_EXECUTION_REVISION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUDDY_EXECUTION_REVISION_COMMITTER_EMAIL": "mikebenson@buddy.works", "BUDDY_EXECUTION_REVISION_COMMITTER_NAME": "Mike Benson", "BUDDY_EXECUTION_REVISION_MESSAGE": "Create buddy.yml", @@ -42,7 +42,7 @@ "BUDDY_EXECUTION_URL": "https://app.buddy.works/myworkspace/my-project/pipelines/pipeline/456/execution/5d9dc42c422f5a268b389d08", "BUDDY_PIPELINE_ID": "456", "BUDDY_PIPELINE_NAME": "Deploy to Production", - "BUDDY_SCM_URL": "https://github.com/buddyworks/my-project" + "BUDDY_SCM_URL": "https://github.com/buddyworks/my-project.git" }, { "ci.pipeline.id": "456/buddy-execution-id", @@ -54,8 +54,8 @@ "git.commit.committer.email": "mikebenson@buddy.works", "git.commit.committer.name": "Mike Benson", "git.commit.message": "Create buddy.yml", - "git.commit.sha": "e5e13f8b7f8d5c6096a0501dc09b48eef05fea96", - "git.repository_url": "https://github.com/buddyworks/my-project", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://github.com/buddyworks/my-project.git", "git.tag": "v1.0" } ], @@ -64,7 +64,7 @@ "BUDDY": "true", "BUDDY_EXECUTION_BRANCH": "refs/heads/feature/one", "BUDDY_EXECUTION_ID": "buddy-execution-id", - "BUDDY_EXECUTION_REVISION": "e5e13f8b7f8d5c6096a0501dc09b48eef05fea96", + "BUDDY_EXECUTION_REVISION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUDDY_EXECUTION_REVISION_COMMITTER_EMAIL": "mikebenson@buddy.works", "BUDDY_EXECUTION_REVISION_COMMITTER_NAME": "Mike Benson", "BUDDY_EXECUTION_REVISION_MESSAGE": "Create buddy.yml", @@ -72,7 +72,7 @@ "BUDDY_EXECUTION_URL": "https://app.buddy.works/myworkspace/my-project/pipelines/pipeline/456/execution/5d9dc42c422f5a268b389d08", "BUDDY_PIPELINE_ID": "456", "BUDDY_PIPELINE_NAME": "Deploy to Production", - "BUDDY_SCM_URL": "https://github.com/buddyworks/my-project" + "BUDDY_SCM_URL": "https://github.com/buddyworks/my-project.git" }, { "ci.pipeline.id": "456/buddy-execution-id", @@ -84,8 +84,8 @@ "git.commit.committer.email": "mikebenson@buddy.works", "git.commit.committer.name": "Mike Benson", "git.commit.message": "Create buddy.yml", - "git.commit.sha": "e5e13f8b7f8d5c6096a0501dc09b48eef05fea96", - "git.repository_url": "https://github.com/buddyworks/my-project", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://github.com/buddyworks/my-project.git", "git.tag": "0.2.0" } ], @@ -94,7 +94,7 @@ "BUDDY": "true", "BUDDY_EXECUTION_BRANCH": "master", "BUDDY_EXECUTION_ID": "buddy-execution-id", - "BUDDY_EXECUTION_REVISION": "e5e13f8b7f8d5c6096a0501dc09b48eef05fea96", + "BUDDY_EXECUTION_REVISION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUDDY_EXECUTION_REVISION_COMMITTER_EMAIL": "mikebenson@buddy.works", "BUDDY_EXECUTION_REVISION_COMMITTER_NAME": "Mike Benson", "BUDDY_EXECUTION_REVISION_MESSAGE": "Create buddy.yml", @@ -102,7 +102,7 @@ "BUDDY_EXECUTION_URL": "https://app.buddy.works/myworkspace/my-project/pipelines/pipeline/456/execution/5d9dc42c422f5a268b389d08", "BUDDY_PIPELINE_ID": "456", "BUDDY_PIPELINE_NAME": "Deploy to Production", - "BUDDY_SCM_URL": "https://github.com/buddyworks/my-project", + "BUDDY_SCM_URL": "https://github.com/buddyworks/my-project.git", "DD_GIT_BRANCH": "user-supplied-branch", "DD_GIT_COMMIT_AUTHOR_DATE": "usersupplied-authordate", "DD_GIT_COMMIT_AUTHOR_EMAIL": "usersupplied-authoremail", @@ -139,7 +139,7 @@ "BUDDY": "true", "BUDDY_EXECUTION_BRANCH": "master", "BUDDY_EXECUTION_ID": "buddy-execution-id", - "BUDDY_EXECUTION_REVISION": "e5e13f8b7f8d5c6096a0501dc09b48eef05fea96", + "BUDDY_EXECUTION_REVISION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUDDY_EXECUTION_REVISION_COMMITTER_EMAIL": "mikebenson@buddy.works", "BUDDY_EXECUTION_REVISION_COMMITTER_NAME": "Mike Benson", "BUDDY_EXECUTION_REVISION_MESSAGE": "Create buddy.yml", @@ -147,7 +147,7 @@ "BUDDY_EXECUTION_URL": "https://app.buddy.works/myworkspace/my-project/pipelines/pipeline/456/execution/5d9dc42c422f5a268b389d08", "BUDDY_PIPELINE_ID": "456", "BUDDY_PIPELINE_NAME": "Deploy to Production", - "BUDDY_SCM_URL": "https://github.com/buddyworks/my-project", + "BUDDY_SCM_URL": "https://github.com/buddyworks/my-project.git", "DD_GIT_BRANCH": "user-supplied-branch", "DD_GIT_COMMIT_AUTHOR_DATE": "usersupplied-authordate", "DD_GIT_COMMIT_AUTHOR_EMAIL": "usersupplied-authoremail", diff --git a/packages/dd-trace/test/plugins/util/ci-env/buildkite.json b/packages/dd-trace/test/plugins/util/ci-env/buildkite.json index e68fdca4e7e..c332fd740d7 100644 --- a/packages/dd-trace/test/plugins/util/ci-env/buildkite.json +++ b/packages/dd-trace/test/plugins/util/ci-env/buildkite.json @@ -9,7 +9,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -29,7 +29,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -43,7 +43,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -63,7 +63,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -77,7 +77,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -97,7 +97,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -111,7 +111,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -131,7 +131,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -145,7 +145,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -167,7 +167,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -181,7 +181,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -203,7 +203,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -217,7 +217,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -239,7 +239,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -253,7 +253,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -273,7 +273,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -287,7 +287,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -307,7 +307,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -321,7 +321,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -341,7 +341,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -355,7 +355,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -375,7 +375,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "git@hostname.com:org/repo.git" } ], @@ -389,7 +389,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -409,7 +409,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -423,7 +423,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -443,7 +443,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -457,7 +457,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -477,7 +477,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -491,7 +491,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -510,7 +510,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git", "git.tag": "0.1.0" } @@ -525,7 +525,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -544,7 +544,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git", "git.tag": "0.1.0" } @@ -559,7 +559,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -578,7 +578,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git", "git.tag": "0.1.0" } @@ -592,7 +592,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -637,7 +637,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -682,7 +682,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -700,7 +700,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/DataDog/dogweb.git" } ], @@ -716,7 +716,7 @@ "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", - "BUILDKITE_COMMIT": "buildkite-git-commit", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", @@ -735,7 +735,7 @@ "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", - "git.commit.sha": "buildkite-git-commit" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123" } ] ] diff --git a/packages/dd-trace/test/plugins/util/ci-env/circleci.json b/packages/dd-trace/test/plugins/util/ci-env/circleci.json index 46691e205dd..8efa8c353f0 100644 --- a/packages/dd-trace/test/plugins/util/ci-env/circleci.json +++ b/packages/dd-trace/test/plugins/util/ci-env/circleci.json @@ -7,8 +7,8 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/repo.git", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "/foo/bar" }, @@ -22,8 +22,8 @@ "ci.provider.name": "circleci", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "circleci-git-commit", - "git.repository_url": "https://circleci-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://circleci-build-url.com/repo.git" } ], [ @@ -34,8 +34,8 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/repo.git", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "foo/bar" }, @@ -49,8 +49,8 @@ "ci.provider.name": "circleci", "ci.workspace_path": "foo/bar", "git.branch": "master", - "git.commit.sha": "circleci-git-commit", - "git.repository_url": "https://circleci-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://circleci-build-url.com/repo.git" } ], [ @@ -61,8 +61,8 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/repo.git", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "/foo/bar~" }, @@ -76,8 +76,8 @@ "ci.provider.name": "circleci", "ci.workspace_path": "/foo/bar~", "git.branch": "master", - "git.commit.sha": "circleci-git-commit", - "git.repository_url": "https://circleci-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://circleci-build-url.com/repo.git" } ], [ @@ -88,8 +88,8 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/repo.git", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "/foo/~/bar" }, @@ -103,8 +103,8 @@ "ci.provider.name": "circleci", "ci.workspace_path": "/foo/~/bar", "git.branch": "master", - "git.commit.sha": "circleci-git-commit", - "git.repository_url": "https://circleci-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://circleci-build-url.com/repo.git" } ], [ @@ -115,8 +115,8 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/repo.git", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "~/foo/bar", "HOME": "/not-my-home", @@ -132,8 +132,8 @@ "ci.provider.name": "circleci", "ci.workspace_path": "/not-my-home/foo/bar", "git.branch": "master", - "git.commit.sha": "circleci-git-commit", - "git.repository_url": "https://circleci-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://circleci-build-url.com/repo.git" } ], [ @@ -144,8 +144,8 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/repo.git", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "~foo/bar", "HOME": "/not-my-home", @@ -161,8 +161,8 @@ "ci.provider.name": "circleci", "ci.workspace_path": "~foo/bar", "git.branch": "master", - "git.commit.sha": "circleci-git-commit", - "git.repository_url": "https://circleci-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://circleci-build-url.com/repo.git" } ], [ @@ -173,8 +173,8 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/repo.git", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "~", "HOME": "/not-my-home", @@ -190,8 +190,8 @@ "ci.provider.name": "circleci", "ci.workspace_path": "/not-my-home", "git.branch": "master", - "git.commit.sha": "circleci-git-commit", - "git.repository_url": "https://circleci-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://circleci-build-url.com/repo.git" } ], [ @@ -202,8 +202,8 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/repo.git", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "/foo/bar" }, @@ -217,8 +217,8 @@ "ci.provider.name": "circleci", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "circleci-git-commit", - "git.repository_url": "https://circleci-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://circleci-build-url.com/repo.git" } ], [ @@ -229,8 +229,8 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/repo.git", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "/foo/bar" }, @@ -244,8 +244,8 @@ "ci.provider.name": "circleci", "ci.workspace_path": "/foo/bar", "git.branch": "feature/one", - "git.commit.sha": "circleci-git-commit", - "git.repository_url": "https://circleci-build-url.com/" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://circleci-build-url.com/repo.git" } ], [ @@ -256,8 +256,8 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/repo.git", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_TAG": "origin/tags/0.1.0", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "/foo/bar" @@ -271,8 +271,8 @@ "ci.pipeline.url": "https://app.circleci.com/pipelines/workflows/circleci-pipeline-id", "ci.provider.name": "circleci", "ci.workspace_path": "/foo/bar", - "git.commit.sha": "circleci-git-commit", - "git.repository_url": "https://circleci-build-url.com/", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://circleci-build-url.com/repo.git", "git.tag": "0.1.0" } ], @@ -284,8 +284,8 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_REPOSITORY_URL": "https://circleci-build-url.com/repo.git", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_TAG": "refs/heads/tags/0.1.0", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "/foo/bar" @@ -299,8 +299,8 @@ "ci.pipeline.url": "https://app.circleci.com/pipelines/workflows/circleci-pipeline-id", "ci.provider.name": "circleci", "ci.workspace_path": "/foo/bar", - "git.commit.sha": "circleci-git-commit", - "git.repository_url": "https://circleci-build-url.com/", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://circleci-build-url.com/repo.git", "git.tag": "0.1.0" } ], @@ -313,7 +313,7 @@ "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", "CIRCLE_REPOSITORY_URL": "http://hostname.com/repo.git", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "/foo/bar" }, @@ -327,7 +327,7 @@ "ci.provider.name": "circleci", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "circleci-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -340,7 +340,7 @@ "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", "CIRCLE_REPOSITORY_URL": "http://user@hostname.com/repo.git", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "/foo/bar" }, @@ -354,7 +354,7 @@ "ci.provider.name": "circleci", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "circleci-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -367,7 +367,7 @@ "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", "CIRCLE_REPOSITORY_URL": "http://user%E2%82%AC@hostname.com/repo.git", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "/foo/bar" }, @@ -381,7 +381,7 @@ "ci.provider.name": "circleci", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "circleci-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -394,7 +394,7 @@ "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", "CIRCLE_REPOSITORY_URL": "http://user:pwd@hostname.com/repo.git", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "/foo/bar" }, @@ -408,7 +408,7 @@ "ci.provider.name": "circleci", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "circleci-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -421,7 +421,7 @@ "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", "CIRCLE_REPOSITORY_URL": "git@hostname.com:org/repo.git", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "CIRCLE_WORKING_DIRECTORY": "/foo/bar" }, @@ -435,7 +435,7 @@ "ci.provider.name": "circleci", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "circleci-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "git@hostname.com:org/repo.git" } ], @@ -446,7 +446,7 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "DD_GIT_BRANCH": "user-supplied-branch", "DD_GIT_COMMIT_AUTHOR_DATE": "usersupplied-authordate", @@ -486,7 +486,7 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", "DD_GIT_COMMIT_AUTHOR_DATE": "usersupplied-authordate", "DD_GIT_COMMIT_AUTHOR_EMAIL": "usersupplied-authoremail", @@ -527,7 +527,7 @@ "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", "CIRCLE_REPOSITORY_URL": "https://user:password@github.com/DataDog/dogweb.git", - "CIRCLE_SHA1": "circleci-git-commit", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id" }, { @@ -538,7 +538,7 @@ "ci.pipeline.name": "circleci-pipeline-name", "ci.pipeline.url": "https://app.circleci.com/pipelines/workflows/circleci-pipeline-id", "ci.provider.name": "circleci", - "git.commit.sha": "circleci-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/DataDog/dogweb.git" } ] diff --git a/packages/dd-trace/test/plugins/util/ci-env/github.json b/packages/dd-trace/test/plugins/util/ci-env/github.json index 918ff12a5ef..e5df52c58ba 100644 --- a/packages/dd-trace/test/plugins/util/ci-env/github.json +++ b/packages/dd-trace/test/plugins/util/ci-env/github.json @@ -8,14 +8,14 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://ghenterprise.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "/foo/bar" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://ghenterprise.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://ghenterprise.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://ghenterprise.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -23,7 +23,7 @@ "ci.provider.name": "github", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://ghenterprise.com/ghactions-repo.git" } ], @@ -37,14 +37,14 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "/foo/bar" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -52,7 +52,7 @@ "ci.provider.name": "github", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git" } ], @@ -66,14 +66,14 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "foo/bar" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -81,7 +81,7 @@ "ci.provider.name": "github", "ci.workspace_path": "foo/bar", "git.branch": "master", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git" } ], @@ -95,14 +95,14 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "/foo/bar~" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -110,7 +110,7 @@ "ci.provider.name": "github", "ci.workspace_path": "/foo/bar~", "git.branch": "master", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git" } ], @@ -124,14 +124,14 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "/foo/~/bar" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -139,7 +139,7 @@ "ci.provider.name": "github", "ci.workspace_path": "/foo/~/bar", "git.branch": "master", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git" } ], @@ -153,7 +153,7 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "~/foo/bar", "HOME": "/not-my-home", @@ -162,7 +162,7 @@ { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -170,7 +170,7 @@ "ci.provider.name": "github", "ci.workspace_path": "/not-my-home/foo/bar", "git.branch": "master", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git" } ], @@ -184,7 +184,7 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "~foo/bar", "HOME": "/not-my-home", @@ -193,7 +193,7 @@ { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -201,7 +201,7 @@ "ci.provider.name": "github", "ci.workspace_path": "~foo/bar", "git.branch": "master", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git" } ], @@ -215,7 +215,7 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "~", "HOME": "/not-my-home", @@ -224,7 +224,7 @@ { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -232,7 +232,7 @@ "ci.provider.name": "github", "ci.workspace_path": "/not-my-home", "git.branch": "master", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git" } ], @@ -246,14 +246,14 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "/foo/bar" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -261,7 +261,7 @@ "ci.provider.name": "github", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git" } ], @@ -275,14 +275,14 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "/foo/bar" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -290,7 +290,7 @@ "ci.provider.name": "github", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git" } ], @@ -304,14 +304,14 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "/foo/bar" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -319,7 +319,7 @@ "ci.provider.name": "github", "ci.workspace_path": "/foo/bar", "git.branch": "feature/one", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git" } ], @@ -333,21 +333,21 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "/foo/bar" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", "ci.pipeline.url": "https://github.com/ghactions-repo/actions/runs/ghactions-pipeline-id/attempts/ghactions-run-attempt", "ci.provider.name": "github", "ci.workspace_path": "/foo/bar", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git", "git.tag": "0.1.0" } @@ -362,21 +362,21 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "/foo/bar" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", "ci.pipeline.url": "https://github.com/ghactions-repo/actions/runs/ghactions-pipeline-id/attempts/ghactions-run-attempt", "ci.provider.name": "github", "ci.workspace_path": "/foo/bar", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git", "git.tag": "0.1.0" } @@ -392,14 +392,14 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "/foo/bar" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -407,7 +407,7 @@ "ci.provider.name": "github", "ci.workspace_path": "/foo/bar", "git.branch": "other", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git" } ], @@ -422,14 +422,14 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "/foo/bar" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -437,7 +437,7 @@ "ci.provider.name": "github", "ci.workspace_path": "/foo/bar", "git.branch": "other", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git" } ], @@ -452,14 +452,14 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "/foo/bar" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -467,7 +467,7 @@ "ci.provider.name": "github", "ci.workspace_path": "/foo/bar", "git.branch": "feature/other", - "git.commit.sha": "ghactions-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/ghactions-repo.git" } ], @@ -490,14 +490,14 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "foo/bar" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", @@ -535,14 +535,14 @@ "GITHUB_RUN_ID": "ghactions-pipeline-id", "GITHUB_RUN_NUMBER": "ghactions-pipeline-number", "GITHUB_SERVER_URL": "https://github.com", - "GITHUB_SHA": "ghactions-commit", + "GITHUB_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GITHUB_WORKFLOW": "ghactions-pipeline-name", "GITHUB_WORKSPACE": "foo/bar" }, { "_dd.ci.env_vars": "{\"GITHUB_SERVER_URL\":\"https://github.com\",\"GITHUB_REPOSITORY\":\"ghactions-repo\",\"GITHUB_RUN_ID\":\"ghactions-pipeline-id\",\"GITHUB_RUN_ATTEMPT\":\"ghactions-run-attempt\"}", "ci.job.name": "github-job-name", - "ci.job.url": "https://github.com/ghactions-repo/commit/ghactions-commit/checks", + "ci.job.url": "https://github.com/ghactions-repo/commit/b9f0fb3fdbb94c9d24b2c75b49663122a529e123/checks", "ci.pipeline.id": "ghactions-pipeline-id", "ci.pipeline.name": "ghactions-pipeline-name", "ci.pipeline.number": "ghactions-pipeline-number", diff --git a/packages/dd-trace/test/plugins/util/ci-env/gitlab.json b/packages/dd-trace/test/plugins/util/ci-env/gitlab.json index be6dd9aeb27..c1879ed80bd 100644 --- a/packages/dd-trace/test/plugins/util/ci-env/gitlab.json +++ b/packages/dd-trace/test/plugins/util/ci-env/gitlab.json @@ -4,7 +4,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -35,7 +35,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://gitlab.com/repo/myrepo.git" } ], @@ -44,7 +44,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -75,7 +75,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://gitlab.com/repo/myrepo.git" } ], @@ -84,7 +84,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -115,7 +115,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://gitlab.com/repo/myrepo.git" } ], @@ -124,7 +124,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -157,7 +157,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://gitlab.com/repo/myrepo.git" } ], @@ -166,7 +166,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -199,7 +199,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://gitlab.com/repo/myrepo.git" } ], @@ -208,7 +208,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -241,7 +241,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://gitlab.com/repo/myrepo.git" } ], @@ -250,7 +250,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "refs/heads/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -281,7 +281,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://gitlab.com/repo/myrepo.git" } ], @@ -290,7 +290,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "refs/heads/feature/one", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -321,7 +321,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://gitlab.com/repo/myrepo.git" } ], @@ -330,7 +330,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TAG": "origin/tags/0.1.0", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", @@ -362,7 +362,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://gitlab.com/repo/myrepo.git", "git.tag": "0.1.0" } @@ -372,7 +372,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TAG": "refs/heads/tags/0.1.0", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", @@ -404,7 +404,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://gitlab.com/repo/myrepo.git", "git.tag": "0.1.0" } @@ -414,7 +414,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TAG": "0.1.0", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", @@ -446,7 +446,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://gitlab.com/repo/myrepo.git", "git.tag": "0.1.0" } @@ -456,7 +456,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -487,7 +487,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -496,7 +496,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -527,7 +527,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -536,7 +536,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -567,7 +567,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -576,7 +576,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -607,7 +607,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -616,7 +616,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -647,7 +647,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "git@hostname.com:org/repo.git" } ], @@ -656,7 +656,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -709,7 +709,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -763,7 +763,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -794,7 +794,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://gitlab.com/DataDog/dogweb.git" } ], @@ -803,7 +803,7 @@ "CI_COMMIT_AUTHOR": "John Doe ", "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", "CI_COMMIT_REF_NAME": "origin/master", - "CI_COMMIT_SHA": "gitlab-git-commit", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", "CI_JOB_ID": "gitlab-job-id", "CI_JOB_NAME": "gitlab-job-name", @@ -838,7 +838,7 @@ "git.commit.author.email": "john@doe.com", "git.commit.author.name": "John Doe", "git.commit.message": "gitlab-git-commit-message", - "git.commit.sha": "gitlab-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://gitlab.com/repo/myrepo.git" } ] diff --git a/packages/dd-trace/test/plugins/util/ci-env/jenkins.json b/packages/dd-trace/test/plugins/util/ci-env/jenkins.json index 8f6799796aa..3e791b5f7ff 100644 --- a/packages/dd-trace/test/plugins/util/ci-env/jenkins.json +++ b/packages/dd-trace/test/plugins/util/ci-env/jenkins.json @@ -6,9 +6,9 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL_1": "https://jenkins.com/repo/sample", - "GIT_URL_2": "https://jenkins.com/repo/otherSample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL_1": "https://jenkins.com/repo/sample.git", + "GIT_URL_2": "https://jenkins.com/repo/otherSample.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", "JOB_URL": "https://jenkins.com/job" @@ -21,8 +21,8 @@ "ci.pipeline.url": "https://jenkins.com/pipeline", "ci.provider.name": "jenkins", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -32,8 +32,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", "JOB_URL": "https://jenkins.com/job" @@ -46,8 +46,8 @@ "ci.pipeline.url": "https://jenkins.com/pipeline", "ci.provider.name": "jenkins", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -57,8 +57,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", "JOB_URL": "https://jenkins.com/job" @@ -71,8 +71,8 @@ "ci.pipeline.url": "https://jenkins.com/pipeline", "ci.provider.name": "jenkins", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -82,8 +82,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", "JOB_URL": "https://jenkins.com/job", @@ -98,8 +98,8 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "foo/bar", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -109,8 +109,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", "JOB_URL": "https://jenkins.com/job", @@ -125,8 +125,8 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/bar~", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -136,8 +136,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", "JOB_URL": "https://jenkins.com/job", @@ -152,8 +152,8 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/~/bar", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -163,8 +163,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "HOME": "/not-my-home", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", @@ -181,8 +181,8 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/not-my-home/foo/bar", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -192,8 +192,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "HOME": "/not-my-home", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", @@ -210,8 +210,8 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "~foo/bar", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -221,8 +221,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "HOME": "/not-my-home", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", @@ -239,8 +239,8 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/not-my-home", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -250,8 +250,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", "JOB_URL": "https://jenkins.com/job", @@ -266,8 +266,8 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -277,8 +277,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "refs/heads/master", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName/master", "JOB_URL": "https://jenkins.com/job", @@ -293,8 +293,8 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -304,8 +304,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "refs/heads/master", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName/another", "JOB_URL": "https://jenkins.com/job", @@ -320,8 +320,8 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -331,8 +331,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "refs/heads/feature/one", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName/feature/one", "JOB_URL": "https://jenkins.com/job", @@ -347,8 +347,8 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/bar", "git.branch": "feature/one", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -358,8 +358,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "refs/heads/master", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName/KEY1=VALUE1,KEY2=VALUE2", "JOB_URL": "https://jenkins.com/job", @@ -374,8 +374,8 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -385,8 +385,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "refs/heads/master", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName/KEY1=VALUE1,KEY2=VALUE2/master", "JOB_URL": "https://jenkins.com/job", @@ -401,8 +401,8 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git" } ], [ @@ -412,8 +412,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/tags/0.1.0", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job", "WORKSPACE": "/foo/bar" @@ -425,8 +425,8 @@ "ci.pipeline.url": "https://jenkins.com/pipeline", "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/bar", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git", "git.tag": "0.1.0" } ], @@ -437,8 +437,8 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "refs/heads/tags/0.1.0", - "GIT_COMMIT": "jenkins-git-commit", - "GIT_URL": "https://jenkins.com/repo/sample", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL": "https://jenkins.com/repo/sample.git", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job", "WORKSPACE": "/foo/bar" @@ -450,8 +450,8 @@ "ci.pipeline.url": "https://jenkins.com/pipeline", "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/bar", - "git.commit.sha": "jenkins-git-commit", - "git.repository_url": "https://jenkins.com/repo/sample", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://jenkins.com/repo/sample.git", "git.tag": "0.1.0" } ], @@ -462,7 +462,7 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "http://hostname.com/repo.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", @@ -478,7 +478,7 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -489,7 +489,7 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "http://user@hostname.com/repo.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", @@ -505,7 +505,7 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -516,7 +516,7 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "http://user%E2%82%AC@hostname.com/repo.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", @@ -532,7 +532,7 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -543,7 +543,7 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "http://user:pwd@hostname.com/repo.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", @@ -559,7 +559,7 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "http://hostname.com/repo.git" } ], @@ -570,7 +570,7 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_BRANCH": "origin/master", - "GIT_COMMIT": "jenkins-git-commit", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "git@hostname.com:org/repo.git", "JENKINS_URL": "jenkins", "JOB_NAME": "jobName", @@ -586,7 +586,7 @@ "ci.provider.name": "jenkins", "ci.workspace_path": "/foo/bar", "git.branch": "master", - "git.commit.sha": "jenkins-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "git@hostname.com:org/repo.git" } ], @@ -606,7 +606,7 @@ "DD_GIT_COMMIT_MESSAGE": "usersupplied-message", "DD_GIT_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "DD_GIT_REPOSITORY_URL": "git@github.com:DataDog/userrepo.git", - "GIT_COMMIT": "jenkins-git-commit", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job" }, @@ -644,7 +644,7 @@ "DD_GIT_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "DD_GIT_REPOSITORY_URL": "git@github.com:DataDog/userrepo.git", "DD_GIT_TAG": "0.0.2", - "GIT_COMMIT": "jenkins-git-commit", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job" }, @@ -672,7 +672,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", - "GIT_COMMIT": "jenkins-git-commit", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL_1": "https://user:password@github.com/DataDog/dogweb.git", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job" @@ -683,7 +683,7 @@ "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", "ci.provider.name": "jenkins", - "git.commit.sha": "jenkins-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/DataDog/dogweb.git" } ], @@ -693,7 +693,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", - "GIT_COMMIT": "jenkins-git-commit", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job", "NODE_LABELS": "built-in linux", @@ -707,7 +707,7 @@ "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", "ci.provider.name": "jenkins", - "git.commit.sha": "jenkins-git-commit" + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123" } ] ] diff --git a/packages/dd-trace/test/plugins/util/ci-env/travisci.json b/packages/dd-trace/test/plugins/util/ci-env/travisci.json index b29aef78eb4..2131938546f 100644 --- a/packages/dd-trace/test/plugins/util/ci-env/travisci.json +++ b/packages/dd-trace/test/plugins/util/ci-env/travisci.json @@ -7,7 +7,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo", @@ -22,7 +22,7 @@ "ci.provider.name": "travisci", "ci.workspace_path": "/foo/bar", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git", "git.tag": "0.1.0" } @@ -35,7 +35,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo", @@ -50,7 +50,7 @@ "ci.provider.name": "travisci", "ci.workspace_path": "/foo/bar", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git", "git.tag": "0.1.0" } @@ -62,7 +62,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo" @@ -76,7 +76,7 @@ "ci.provider.name": "travisci", "git.branch": "master", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git" } ], @@ -88,7 +88,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo" @@ -103,7 +103,7 @@ "ci.workspace_path": "foo/bar", "git.branch": "master", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git" } ], @@ -115,7 +115,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo" @@ -130,7 +130,7 @@ "ci.workspace_path": "/foo/bar~", "git.branch": "master", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git" } ], @@ -142,7 +142,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo" @@ -157,7 +157,7 @@ "ci.workspace_path": "/foo/~/bar", "git.branch": "master", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git" } ], @@ -170,7 +170,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo", @@ -186,7 +186,7 @@ "ci.workspace_path": "/not-my-home/foo/bar", "git.branch": "master", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git" } ], @@ -198,7 +198,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo" @@ -213,7 +213,7 @@ "ci.workspace_path": "~foo/bar", "git.branch": "master", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git" } ], @@ -226,7 +226,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo", @@ -242,7 +242,7 @@ "ci.workspace_path": "/not-my-home", "git.branch": "master", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git" } ], @@ -254,7 +254,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo" @@ -269,7 +269,7 @@ "ci.workspace_path": "/foo/bar", "git.branch": "master", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git" } ], @@ -281,7 +281,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo" @@ -296,7 +296,7 @@ "ci.workspace_path": "/foo/bar", "git.branch": "master", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git" } ], @@ -308,7 +308,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo" @@ -323,7 +323,7 @@ "ci.workspace_path": "/foo/bar", "git.branch": "feature/one", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git" } ], @@ -335,7 +335,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_PULL_REQUEST_BRANCH": "origin/master", @@ -352,7 +352,7 @@ "ci.workspace_path": "/foo/bar", "git.branch": "master", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git" } ], @@ -364,7 +364,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_PULL_REQUEST_BRANCH": "refs/heads/master", @@ -381,7 +381,7 @@ "ci.workspace_path": "/foo/bar", "git.branch": "master", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git" } ], @@ -393,7 +393,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_PULL_REQUEST_BRANCH": "refs/heads/feature/one", @@ -410,7 +410,7 @@ "ci.workspace_path": "/foo/bar", "git.branch": "feature/one", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git" } ], @@ -430,7 +430,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo" @@ -470,7 +470,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo" @@ -502,7 +502,7 @@ "TRAVIS_BUILD_ID": "travis-pipeline-id", "TRAVIS_BUILD_NUMBER": "travis-pipeline-number", "TRAVIS_BUILD_WEB_URL": "https://travisci.com/pipeline", - "TRAVIS_COMMIT": "travis-git-commit", + "TRAVIS_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "TRAVIS_COMMIT_MESSAGE": "travis-commit-message", "TRAVIS_JOB_WEB_URL": "https://travisci.com/job", "TRAVIS_REPO_SLUG": "user/repo", @@ -517,7 +517,7 @@ "ci.provider.name": "travisci", "ci.workspace_path": "/foo/bar", "git.commit.message": "travis-commit-message", - "git.commit.sha": "travis-git-commit", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "git.repository_url": "https://github.com/user/repo.git", "git.tag": "0.1.0" } diff --git a/packages/dd-trace/test/plugins/util/test.spec.js b/packages/dd-trace/test/plugins/util/test.spec.js index 7f0c1a601b1..06e3d29fa55 100644 --- a/packages/dd-trace/test/plugins/util/test.spec.js +++ b/packages/dd-trace/test/plugins/util/test.spec.js @@ -12,9 +12,12 @@ const { getCodeOwnersForFilename, getCoveredFilenamesFromCoverage, mergeCoverage, - resetCoverage + resetCoverage, + removeInvalidMetadata } = require('../../../src/plugins/util/test') +const { GIT_REPOSITORY_URL, GIT_COMMIT_SHA, CI_PIPELINE_URL } = require('../../../src/plugins/util/tags') + describe('getTestParametersString', () => { it('returns formatted test parameters and removes params from input', () => { const input = { 'test_stuff': [['params'], [{ b: 'c' }]] } @@ -164,3 +167,54 @@ describe('coverage utils', () => { }) }) }) + +describe('metadata validation', () => { + it('should remove invalid metadata', () => { + const invalidMetadata1 = { + [GIT_REPOSITORY_URL]: 'www.datadog.com', + [CI_PIPELINE_URL]: 'www.datadog.com', + [GIT_COMMIT_SHA]: 'abc123' + } + const invalidMetadata2 = { + [GIT_REPOSITORY_URL]: 'https://datadog.com/repo', + [CI_PIPELINE_URL]: 'datadog.com', + [GIT_COMMIT_SHA]: 'abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123' + } + const invalidMetadata3 = { + [GIT_REPOSITORY_URL]: 'datadog.com', + [CI_PIPELINE_URL]: 'datadog.com', + [GIT_COMMIT_SHA]: 'abc123' + } + const invalidMetadata4 = { + [GIT_REPOSITORY_URL]: 'datadog.com/repo.git', + [CI_PIPELINE_URL]: 'www.datadog.com5', + [GIT_COMMIT_SHA]: 'abc123' + } + const invalidMetadata5 = { [GIT_REPOSITORY_URL]: '', [CI_PIPELINE_URL]: '', [GIT_COMMIT_SHA]: '' } + const invalidMetadatas = [invalidMetadata1, invalidMetadata2, invalidMetadata3, invalidMetadata4, invalidMetadata5] + invalidMetadatas.forEach((invalidMetadata) => { + expect(JSON.stringify(removeInvalidMetadata(invalidMetadata))).to.equal(JSON.stringify({})) + }) + }) + it('should keep valid metadata', () => { + const validMetadata1 = { + [GIT_REPOSITORY_URL]: 'https://datadoghq.com/myrepo/repo.git', + [CI_PIPELINE_URL]: 'https://datadog.com', + [GIT_COMMIT_SHA]: 'cb466452bfe18d4f6be2836c2a5551843013cf381234223920318230492823f3' + } + const validMetadata2 = { + [GIT_REPOSITORY_URL]: 'http://datadoghq.com/myrepo/repo.git', + [CI_PIPELINE_URL]: 'http://datadog.com', + [GIT_COMMIT_SHA]: 'cb466452bfe18d4f6be2836c2a5551843013cf38' + } + const validMetadata3 = { + [GIT_REPOSITORY_URL]: 'git@github.com:DataDog/dd-trace-js.git', + [CI_PIPELINE_URL]: 'https://datadog.com/pipeline', + [GIT_COMMIT_SHA]: 'cb466452bfe18d4f6be2836c2a5551843013cf381234223920318230492823f3' + } + const validMetadatas = [validMetadata1, validMetadata2, validMetadata3] + validMetadatas.forEach((validMetadata) => { + expect(JSON.stringify(removeInvalidMetadata(validMetadata))).to.be.equal(JSON.stringify(validMetadata)) + }) + }) +}) diff --git a/packages/dd-trace/test/profiling/config.spec.js b/packages/dd-trace/test/profiling/config.spec.js index 6e99fa87c27..b49a20c6f16 100644 --- a/packages/dd-trace/test/profiling/config.spec.js +++ b/packages/dd-trace/test/profiling/config.spec.js @@ -7,7 +7,6 @@ const os = require('os') const path = require('path') const { AgentExporter } = require('../../src/profiling/exporters/agent') const { FileExporter } = require('../../src/profiling/exporters/file') -const CpuProfiler = require('../../src/profiling/profilers/cpu') const WallProfiler = require('../../src/profiling/profilers/wall') const SpaceProfiler = require('../../src/profiling/profilers/space') const { ConsoleLogger } = require('../../src/profiling/loggers/console') @@ -58,7 +57,7 @@ describe('config', () => { error () { } }, exporters: 'agent,file', - profilers: 'wall,cpu-experimental', + profilers: 'wall', url: 'http://localhost:1234/' } @@ -79,9 +78,8 @@ describe('config', () => { expect(config.exporters[0]._url.toString()).to.equal(options.url) expect(config.exporters[1]).to.be.an.instanceof(FileExporter) expect(config.profilers).to.be.an('array') - expect(config.profilers.length).to.equal(2) + expect(config.profilers.length).to.equal(1) expect(config.profilers[0]).to.be.an.instanceOf(WallProfiler) - expect(config.profilers[1]).to.be.an.instanceOf(CpuProfiler) }) it('should filter out invalid profilers', () => { diff --git a/packages/dd-trace/test/profiling/profilers/cpu.spec.js b/packages/dd-trace/test/profiling/profilers/cpu.spec.js deleted file mode 100644 index f9b847825f0..00000000000 --- a/packages/dd-trace/test/profiling/profilers/cpu.spec.js +++ /dev/null @@ -1,175 +0,0 @@ -'use strict' - -require('../../setup/tap') - -const { expect } = require('chai') -const proxyquire = require('proxyquire') -const sinon = require('sinon') -const tracer = require('../../..') - -describe('profilers/native/cpu', () => { - let NativeCpuProfiler - let CpuProfiler - let pprof - let start - let stop - let profile - let setter - let getter - - beforeEach(() => { - CpuProfiler = sinon.stub() - start = sinon.stub() - stop = sinon.stub() - profile = sinon.stub().returns('profile') - setter = sinon.stub() - getter = sinon.stub() - - CpuProfiler.prototype.start = start - CpuProfiler.prototype.stop = stop - CpuProfiler.prototype.profile = profile - Object.defineProperty(CpuProfiler.prototype, 'labels', { - set: setter, - get: getter - }) - - pprof = { - encode: sinon.stub().returns(Promise.resolve()), - CpuProfiler - } - - NativeCpuProfiler = proxyquire('../../../src/profiling/profilers/cpu', { - '@datadog/pprof': pprof - }) - }) - - it('should start the internal time profiler', () => { - const profiler = new NativeCpuProfiler() - - expect(profiler._started).to.be.false - profiler.start() - expect(profiler._started).to.be.true - - sinon.assert.calledOnce(start) - sinon.assert.calledWith(start, 99) - }) - - it('should use given sample frequency', () => { - const profiler = new NativeCpuProfiler({ - frequency: 123 - }) - - profiler.start() - - sinon.assert.calledOnce(start) - sinon.assert.calledWith(start, 123) - }) - - it('should not get profile when not started', () => { - const profiler = new NativeCpuProfiler() - - profiler.profile() - - sinon.assert.notCalled(profile) - }) - - it('should get profile when started', () => { - const profiler = new NativeCpuProfiler() - - profiler.start() - profiler.profile() - - sinon.assert.calledOnce(profile) - }) - - it('should not stop when not started', () => { - const profiler = new NativeCpuProfiler() - - profiler.stop() - - sinon.assert.notCalled(stop) - }) - - it('should stop when started', () => { - const profiler = new NativeCpuProfiler() - - expect(profiler._started).to.be.false - profiler.start() - expect(profiler._started).to.be.true - profiler.stop() - expect(profiler._started).to.be.false - - sinon.assert.calledOnce(stop) - }) - - it('should encode profile', () => { - const profiler = new NativeCpuProfiler() - - profiler.start() - - const profile = profiler.profile() - - profiler.encode(profile) - - sinon.assert.calledOnce(pprof.encode) - }) - - it('should track labels across async boundaries', () => { - tracer.init() - tracer.trace('foo.bar', { - service: 'service', - resource: 'resource', - type: 'web' - }, (span, cb) => { - const profiler = new NativeCpuProfiler() - profiler.start() - - // Should immediately have labels available - const spanId = span.context().toSpanId() - sinon.assert.calledWithMatch(setter, { - 'local root span id': spanId, - 'span id': spanId - }) - - setter.resetHistory() - - setImmediate(() => { - // Should also have labels available asynchronously - sinon.assert.calledWithMatch(setter, { - 'local root span id': spanId, - 'span id': spanId - }) - cb() - }) - }) - }) - - it('should collect endpoints', () => { - tracer.init() - tracer.trace('foo.bar', { - service: 'service', - resource: 'resource', - type: 'web' - }, (_, cb) => { - const profiler = new NativeCpuProfiler({ - endpointCollection: true - }) - profiler.start() - - // Should immediately have labels available - sinon.assert.calledWithMatch(setter, { - 'trace endpoint': 'resource' - }) - - setter.resetHistory() - - setImmediate(() => { - // Should also have labels available asynchronously - sinon.assert.calledWithMatch(setter, { - 'trace endpoint': 'resource' - }) - cb() - }) - }) - }) -}) diff --git a/packages/dd-trace/test/profiling/profilers/wall.spec.js b/packages/dd-trace/test/profiling/profilers/wall.spec.js index 7dac7539817..4b6d3731cd9 100644 --- a/packages/dd-trace/test/profiling/profilers/wall.spec.js +++ b/packages/dd-trace/test/profiling/profilers/wall.spec.js @@ -9,14 +9,13 @@ const sinon = require('sinon') describe('profilers/native/wall', () => { let NativeWallProfiler let pprof - let stop beforeEach(() => { - stop = sinon.stub().returns('profile') pprof = { encode: sinon.stub().returns(Promise.resolve()), time: { - start: sinon.stub().returns(stop) + start: sinon.stub(), + stop: sinon.stub().returns('profile') } } @@ -45,7 +44,12 @@ describe('profilers/native/wall', () => { process._stopProfilerIdleNotifier = stop sinon.assert.calledOnce(pprof.time.start) - sinon.assert.calledWith(pprof.time.start, 1e6 / 99) + sinon.assert.calledWith(pprof.time.start, + { intervalMicros: 1e6 / 99, + durationMillis: 60000, + sourceMapper: undefined, + customLabels: false, + lineNumbers: false }) }) it('should use the provided configuration options', () => { @@ -53,8 +57,14 @@ describe('profilers/native/wall', () => { const profiler = new NativeWallProfiler({ samplingInterval }) profiler.start() + profiler.stop() - sinon.assert.calledWith(pprof.time.start, samplingInterval) + sinon.assert.calledWith(pprof.time.start, + { intervalMicros: 500, + durationMillis: 60000, + sourceMapper: undefined, + customLabels: false, + lineNumbers: false }) }) it('should not stop when not started', () => { @@ -62,7 +72,7 @@ describe('profilers/native/wall', () => { profiler.stop() - sinon.assert.notCalled(stop) + sinon.assert.notCalled(pprof.time.stop) }) it('should stop the internal time profiler', () => { @@ -71,7 +81,7 @@ describe('profilers/native/wall', () => { profiler.start() profiler.stop() - sinon.assert.calledOnce(stop) + sinon.assert.calledOnce(pprof.time.stop) }) it('should stop the internal time profiler only once', () => { @@ -81,7 +91,7 @@ describe('profilers/native/wall', () => { profiler.stop() profiler.stop() - sinon.assert.calledOnce(stop) + sinon.assert.calledOnce(pprof.time.stop) }) it('should collect profiles from the internal time profiler', () => { @@ -93,8 +103,9 @@ describe('profilers/native/wall', () => { expect(profile).to.equal('profile') - sinon.assert.calledOnce(stop) + sinon.assert.calledOnce(pprof.time.stop) sinon.assert.calledOnce(pprof.time.start) + profiler.stop() }) it('should encode profiles from the pprof time profiler', () => { @@ -106,6 +117,8 @@ describe('profilers/native/wall', () => { profiler.encode(profile) + profiler.stop() + sinon.assert.calledOnce(pprof.encode) }) @@ -115,7 +128,13 @@ describe('profilers/native/wall', () => { const mapper = {} profiler.start({ mapper }) + profiler.stop() - sinon.assert.calledWith(pprof.time.start, 1e6 / 99, null, mapper, false) + sinon.assert.calledWith(pprof.time.start, + { intervalMicros: 1e6 / 99, + durationMillis: 60000, + sourceMapper: mapper, + customLabels: false, + lineNumbers: false }) }) }) diff --git a/packages/dd-trace/test/telemetry/dependencies.spec.js b/packages/dd-trace/test/telemetry/dependencies.spec.js index 1b0a304ec60..5ccaa6d18cf 100644 --- a/packages/dd-trace/test/telemetry/dependencies.spec.js +++ b/packages/dd-trace/test/telemetry/dependencies.spec.js @@ -41,6 +41,7 @@ describe('dependencies', () => { afterEach(() => { dependencies.stop() + sendData.reset() global.setImmediate = originalSetImmediate }) diff --git a/packages/diagnostics_channel/src/index.js b/packages/diagnostics_channel/src/index.js index ead90759dcc..eb6f175ea24 100644 --- a/packages/diagnostics_channel/src/index.js +++ b/packages/diagnostics_channel/src/index.js @@ -54,4 +54,68 @@ if (major === '19' && minor === '9') { } } +if (!Channel.prototype.runStores) { + const ActiveChannelPrototype = getActiveChannelPrototype() + + Channel.prototype.bindStore = ActiveChannelPrototype.bindStore = function (store, transform) { + if (!this._stores) { + this._stores = new Map() + } + this._stores.set(store, transform) + } + + Channel.prototype.unbindStore = ActiveChannelPrototype.runStores = function (store) { + if (!this._stores) return + this._stores.delete(store) + } + + Channel.prototype.runStores = ActiveChannelPrototype.runStores = function (data, fn, thisArg, ...args) { + if (!this._stores) return Reflect.apply(fn, thisArg, args) + + let run = () => { + this.publish(data) + return Reflect.apply(fn, thisArg, args) + } + + for (const entry of this._stores.entries()) { + const store = entry[0] + const transform = entry[1] + run = wrapStoreRun(store, data, run, transform) + } + + return run() + } +} + +function defaultTransform (data) { + return data +} + +function wrapStoreRun (store, data, next, transform = defaultTransform) { + return () => { + let context + try { + context = transform(data) + } catch (err) { + process.nextTick(() => { + throw err + }) + return next() + } + + return store.run(context, next) + } +} + +function getActiveChannelPrototype () { + const dummyChannel = channel('foo') + const listener = () => {} + + dummyChannel.subscribe(listener) + const ActiveChannelPrototype = Object.getPrototypeOf(dummyChannel) + dummyChannel.unsubscribe(listener) + + return ActiveChannelPrototype +} + module.exports = dc diff --git a/yarn.lock b/yarn.lock index 0b32157cf59..536c03a20e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -409,18 +409,16 @@ node-addon-api "^6.1.0" node-gyp-build "^3.9.0" -"@datadog/pprof@2.2.3": - version "2.2.3" - resolved "https://registry.yarnpkg.com/@datadog/pprof/-/pprof-2.2.3.tgz#a22ca30e386f5aa8559f4b2e297b76c80551c26d" - integrity sha512-cZXvNBBzvTMUx2xOxp49cZJ7/HOF7geVxqeRbveeJUVKwi8ZxmU1rQGcWPFX4iEEtfQu1M3NqbhmNtYsMJdEsQ== +"@datadog/pprof@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@datadog/pprof/-/pprof-3.0.0.tgz#b5e6df853589512ceb470c44cfc50cbe2ebfa5ab" + integrity sha512-nE/iWBX6h61SXrVWA6DeJ/m2iJX9ZNHrcoxFzHkK0LnSbNzrMlQZ0yw24ExhvIPLOFP4uFW057Cm48rsgr0NyQ== dependencies: delay "^5.0.0" - node-gyp-build "^3.9.0" + node-gyp-build "<4.0" p-limit "^3.1.0" - pify "^5.0.0" pprof-format "^2.0.7" - source-map "^0.7.3" - split "^1.0.1" + source-map "^0.7.4" "@datadog/sketches-js@^2.1.0": version "2.1.0" @@ -3314,7 +3312,7 @@ node-addon-api@^6.1.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-6.1.0.tgz#ac8470034e58e67d0c6f1204a18ae6995d9c0d76" integrity sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA== -node-gyp-build@^3.9.0: +node-gyp-build@<4.0, node-gyp-build@^3.9.0: version "3.9.0" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-3.9.0.tgz#53a350187dd4d5276750da21605d1cb681d09e25" integrity sha512-zLcTg6P4AbcHPq465ZMFNXx7XpKKJh+7kkN699NiQWisR2uWYOWNWqRHAmbnmKiL4e9aLSlmy5U7rEMUXV59+A== @@ -3612,11 +3610,6 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -pify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-5.0.0.tgz#1f5eca3f5e87ebec28cc6d54a0e4aaf00acc127f" - integrity sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA== - pkg-dir@^4.1.0: version "4.2.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" @@ -3666,10 +3659,10 @@ propagate@^2.0.0: resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== -protobufjs@^7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.1.2.tgz#a0cf6aeaf82f5625bffcf5a38b7cd2a7de05890c" - integrity sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ== +protobufjs@^7.2.4: + version "7.2.4" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.4.tgz#3fc1ec0cdc89dd91aef9ba6037ba07408485c3ae" + integrity sha512-AT+RJgD2sH8phPmCf7OUZR8xGdcJRga4+1cOaXJ64hvcSkVhNcRHOwIxUatPH15+nj59WAGTDv3LSGZPEQbJaQ== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -4116,7 +4109,7 @@ source-map@^0.6.0, source-map@^0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@^0.7.3: +source-map@^0.7.4: version "0.7.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== @@ -4133,13 +4126,6 @@ spawn-wrap@^2.0.0: signal-exit "^3.0.2" which "^2.0.1" -split@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" - integrity sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg== - dependencies: - through "2" - sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -4377,7 +4363,7 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== -through@2, through@~2.3.4, through@~2.3.8: +through@~2.3.4, through@~2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==