Skip to content

v5.58.1 proposal #6062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ updates:
- dependency-name: "jest-docblock"
# 30.0.0 onwards only supports Node.js 18.14.x and above
update-types: ["version-update:semver-major"]
# The path-to-regexp version has to be the same as used in express v4.
# Consider vendoring it instead.
- dependency-name: "path-to-regexp"
- dependency-name: "lru-cache"
# 11.0.0 onwards only supports Node.js 20 and above
update-types: ["version-update:semver-major"]
groups:
dev-minor-and-patch-dependencies:
dependency-type: "development"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ jobs:
version: ${{ matrix.version }}
- uses: ./.github/actions/install
- run: yarn add --ignore-scripts mocha@10 # Use older mocha to support old Node.js versions
- run: yarn add --ignore-scripts express@4 # Use older express to support old Node.js versions
- run: node node_modules/.bin/mocha --colors --timeout 30000 integration-tests/init.spec.js

integration-guardrails-unsupported:
Expand Down
1 change: 1 addition & 0 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ dev,sinon,BSD-3-Clause,Copyright 2010-2017 Christian Johansen
dev,sinon-chai,WTFPL and BSD-2-Clause,Copyright 2004 Sam Hocevar 2012–2017 Domenic Denicola
dev,tap,ISC,Copyright 2011-2022 Isaac Z. Schlueter and Contributors
dev,tiktoken,MIT,Copyright (c) 2022 OpenAI, Shantanu Jain
dev,workerpool,Apache license 2.0,Copyright (C) 2014-2024 Jos de Jong wjosdejong@gmail.com
dev,yaml,ISC,Copyright Eemeli Aro <eemeli@gmail.com>
dev,yarn-deduplicate,Apache license 2.0,Copyright [yyyy] [name of copyright owner]
file,aws-lambda-nodejs-runtime-interface-client,Apache 2.0,Copyright 2019 Amazon.com Inc. or its affiliates. All Rights Reserved.
Expand Down
2 changes: 2 additions & 0 deletions benchmark/sirun/appsec-iast/insecure-bank.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const http = require('http')
const app = require('/opt/insecure-bank-js/app') // eslint-disable-line import/no-absolute-path

Expand Down
2 changes: 2 additions & 0 deletions benchmark/sirun/appsec/insecure-bank.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const http = require('http')
const app = require('/opt/insecure-bank-js/app') // eslint-disable-line import/no-absolute-path

Expand Down
2 changes: 2 additions & 0 deletions benchmark/sirun/encoding/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const {
ENCODER_VERSION
} = process.env
Expand Down
2 changes: 2 additions & 0 deletions benchmark/sirun/gc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const { createHistogram, PerformanceObserver } = require('perf_hooks')
if (createHistogram) {
const StatsD = require('./statsd')
Expand Down
2 changes: 2 additions & 0 deletions benchmark/sirun/means.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/* eslint-disable no-console */

const chunks = []
Expand Down
2 changes: 2 additions & 0 deletions benchmark/sirun/scope/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const {
DD_TRACE_SCOPE,
COUNT
Expand Down
2 changes: 2 additions & 0 deletions benchmark/sirun/shimmer-runtime/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/* eslint-disable require-await */

const shimmer = require('../../../packages/datadog-shimmer')
Expand Down
2 changes: 2 additions & 0 deletions benchmark/sirun/shimmer-startup/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/* eslint-disable require-await */

const shimmer = require('../../../packages/datadog-shimmer')
Expand Down
2 changes: 2 additions & 0 deletions benchmark/sirun/spans/spans.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const tracer = require('../../..').init()

tracer._tracer._processor.process = function process (span) {
Expand Down
1 change: 1 addition & 0 deletions benchmark/sirun/strip-unwanted-results.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
'use strict'

const fs = require('fs')
const path = require('path')
Expand Down
2 changes: 2 additions & 0 deletions ci/cypress/after-run.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
'use strict'

module.exports = require('../../packages/datadog-plugin-cypress/src/after-run')
2 changes: 2 additions & 0 deletions ci/cypress/after-spec.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
'use strict'

module.exports = require('../../packages/datadog-plugin-cypress/src/after-spec')
2 changes: 2 additions & 0 deletions ci/cypress/plugin.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const { NODE_MAJOR } = require('../../version')

// These polyfills are here because cypress@6.7.0, which we still support for v5, runs its plugin code
Expand Down
2 changes: 2 additions & 0 deletions ci/cypress/polyfills.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

if (!Object.hasOwn) {
Object.defineProperty(Object, 'hasOwn', {
// eslint-disable-next-line prefer-object-has-own
Expand Down
2 changes: 2 additions & 0 deletions ci/cypress/support.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
'use strict'

require('../../packages/datadog-plugin-cypress/src/support')
2 changes: 2 additions & 0 deletions ci/init.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/* eslint-disable no-console */
const tracer = require('../packages/dd-trace')
const { isTrue, isFalse } = require('../packages/dd-trace/src/util')
Expand Down
22 changes: 11 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ services:

# Use this for local development when making new VCR cassettes to persist to the test agent
# Do not use the above testagent service if using this one.
testagent-vcr:
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.24.1
ports:
- "127.0.0.1:9126:9126"
environment:
- LOG_LEVEL=DEBUG
- TRACE_LANGUAGE=javascript
- ENABLED_CHECKS=trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service
- PORT=9126
volumes:
- ${VCR_CASSETTES_PATH:-/tmp/empty-vcr}:/vcr-cassettes:delegated
# testagent-vcr:
# image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.24.1
# ports:
# - "127.0.0.1:9126:9126"
# environment:
# - LOG_LEVEL=DEBUG
# - TRACE_LANGUAGE=javascript
# - ENABLED_CHECKS=trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service
# - PORT=9126
# volumes:
# - ${VCR_CASSETTES_PATH:-/tmp/empty-vcr}:/vcr-cassettes:delegated
2 changes: 2 additions & 0 deletions esbuild.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

// TODO: It shouldn't be necessary to disable n/no-unpublished-require - Research
// eslint-disable-next-line n/no-unpublished-require
module.exports = require('./packages/datadog-esbuild/index.js')
52 changes: 51 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,19 @@ export default [
yoda: ['error', 'never']
}
},
{
...eslintPluginN.configs['flat/recommended'],
ignores: [
'integration-tests/debugger/target-app/re-evaluation/index.js',
'integration-tests/debugger/target-app/re-evaluation/unique-filename.js',
'packages/dd-trace/test/appsec/next/app-dir/**/*.js',
'packages/dd-trace/test/appsec/next/pages-dir/**/*.js',
'packages/datadog-plugin-next/test/app/**/*.js',
'packages/datadog-plugin-next/test/**/pages/**/*.js',
'packages/datadog-plugin-next/test/middleware.js',
'**/*.mjs' // TODO: This shoudln't be required, research why it is
]
},
{
name: 'dd-trace/defaults',

Expand Down Expand Up @@ -328,10 +341,23 @@ export default [
}],
'import/no-extraneous-dependencies': 'error',
'n/no-restricted-require': ['error', ['diagnostics_channel']],
'n/hashbang': 'off', // TODO: Enable this rule once we have a plan to address it
'n/no-process-exit': 'off', // TODO: Enable this rule once we have a plan to address it
'n/no-unsupported-features/node-builtins': ['error', {
ignores: [
'Response',
'async_hooks.createHook',
'async_hooks.executionAsyncId',
'async_hooks.executionAsyncResource',
'fetch',
'fs/promises.cp'
]
}],
'no-console': 'error',
'no-prototype-builtins': 'off', // Override (turned on by @eslint/js/recommended)
'no-var': 'error',
'require-await': 'error'
'require-await': 'error',
strict: 'error'
}
},
{
Expand Down Expand Up @@ -421,6 +447,26 @@ export default [
...eslintPluginMocha.configs.flat.recommended,
files: TEST_FILES
},
{
name: 'dd-trace/benchmarks',
files: [
'benchmark/**/*'
],
rules: {
'n/no-missing-require': 'off'
}
},
{
name: 'dd-trace/scripts',
files: [
'scripts/**/*'
],
rules: {
'n/no-unsupported-features/node-builtins': ['error', {
allowExperimental: true
}]
}
},
{
name: 'dd-trace/tests/all',
files: TEST_FILES,
Expand All @@ -447,6 +493,10 @@ export default [
'mocha/no-skipped-tests': 'off',
'mocha/no-top-level-hooks': 'off',
'n/handle-callback-err': 'off',
'n/no-missing-require': 'off',
'n/no-unsupported-features/node-builtins': ['error', {
allowExperimental: true
}],
'require-await': 'off'
}
},
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

// TODO: It shouldn't be necessary to disable n/no-unpublished-require - Research
// eslint-disable-next-line n/no-unpublished-require
module.exports = require('./packages/dd-trace')
2 changes: 2 additions & 0 deletions init.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/* eslint-disable no-var */

// TODO: It shouldn't be necessary to disable n/no-unpublished-require - Research
// eslint-disable-next-line n/no-unpublished-require
var guard = require('./packages/dd-trace/src/guardrails')

module.exports = guard(function () {
Expand Down
2 changes: 2 additions & 0 deletions initialize.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* hook will always be active for ESM support.
*/

/* eslint n/no-unsupported-features/node-builtins: ['error', { ignores: ['module.register'] }] */

import { isMainThread } from 'worker_threads'

import * as Module from 'node:module'
Expand Down
2 changes: 0 additions & 2 deletions integration-tests/appsec/esm-app/custom-noop-hooks.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict'

function dummyOperation (a) {
return a + 'should have ' + 'dummy operation to be rewritten' + ' without crashing'
}
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/appsec/esm-app/index.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict'
/* eslint n/no-unsupported-features/node-builtins: ['error', { ignores: ['module.register'] }] */

import childProcess from 'node:child_process'
import express from 'express'
Expand Down
2 changes: 0 additions & 2 deletions integration-tests/appsec/esm-app/worker-dep.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict'

function dummyOperation (a) {
return a + 'dummy operation with concat in worker-dep'
}
Expand Down
2 changes: 0 additions & 2 deletions integration-tests/appsec/esm-security-controls/index.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict'

import childProcess from 'node:child_process'
import express from 'express'
import { sanitize } from './sanitizer.mjs'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict'

function sanitizeDefault (input) {
return input
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict'

export function sanitize (input) {
return input
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict'

export function validate (input) {
return true
}
Expand Down
2 changes: 2 additions & 0 deletions integration-tests/ci-visibility-intake.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const express = require('express')
const bodyParser = require('body-parser')
const msgpack = require('@msgpack/msgpack')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const { createLogger, format, transports } = require('winston')

module.exports = createLogger({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const { expect } = require('chai')
const { When, Then } = require('@cucumber/cucumber')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const logger = require('./logger')

module.exports = function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const { test, expect } = require('@playwright/test')
const logger = require('./logger')
const sum = require('./sum')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const { createLogger, format, transports } = require('winston')

module.exports = createLogger({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const logger = require('./logger')

module.exports = function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const { expect } = require('chai')

const logger = require('./logger')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

module.exports = {
projects: [],
testPathIgnorePatterns: ['/node_modules/'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const { createLogger, format, transports } = require('winston')

module.exports = createLogger({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const logger = require('./logger')

module.exports = function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

module.exports = function (a, b) {
const localVariable = 2
if (a > 10) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const sum = require('./dependency')
const { expect } = require('chai')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const sum = require('./dependency')
const { expect } = require('chai')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const assert = require('assert')
const { When, Then } = require('@cucumber/cucumber')
const sum = require('./sum')
Expand Down
2 changes: 2 additions & 0 deletions integration-tests/ci-visibility/features-di/support/sum.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

function funSum (a, b) {
const localVariable = 2
if (a > 10) {
Expand Down
Loading
Loading