diff --git a/.agents/skills/apm-integrations/SKILL.md b/.agents/skills/apm-integrations/SKILL.md index d416ced37fd..898e10bf7f2 100644 --- a/.agents/skills/apm-integrations/SKILL.md +++ b/.agents/skills/apm-integrations/SKILL.md @@ -135,7 +135,7 @@ Follow these steps when creating or modifying an integration: 5. **Write tests** — Add unit tests and ESM integration tests. See [Testing](references/testing.md) for templates. 6. **Run tests** — Validate with: ```bash - # Run plugin tests (preferred CI command — handles yarn services automatically) + # Run plugin tests (preferred CI command — handles `npm run services` automatically) PLUGINS="" npm run test:plugins:ci # If the plugin needs external services (databases, message brokers, etc.), diff --git a/.agents/skills/apm-integrations/references/new-integration-guide.md b/.agents/skills/apm-integrations/references/new-integration-guide.md index c63af7cafd7..44c2c10c45c 100644 --- a/.agents/skills/apm-integrations/references/new-integration-guide.md +++ b/.agents/skills/apm-integrations/references/new-integration-guide.md @@ -262,7 +262,7 @@ Add to `.github/workflows/apm-integrations.yml`: with: version: ${{ matrix.node-version }} - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci strategy: matrix: node-version: [18, 22] @@ -278,7 +278,7 @@ See [Testing](testing.md) for complete templates. **ESM integration tests** — `packages/datadog-plugin-/test/integration-test/` ```bash -# CI command (preferred) — handles dependency installation via yarn services +# CI command (preferred) — handles dependency installation via `npm run services` PLUGINS="" npm run test:plugins:ci ``` diff --git a/.agents/skills/apm-integrations/references/testing.md b/.agents/skills/apm-integrations/references/testing.md index d500d0d52a0..2dba676de92 100644 --- a/.agents/skills/apm-integrations/references/testing.md +++ b/.agents/skills/apm-integrations/references/testing.md @@ -191,13 +191,13 @@ describe('esm', () => { ## Running Tests -dd-trace uses a non-standard dependency installation for plugin tests. Libraries under test are installed per-version via `yarn services`, not through the normal `node_modules`. The `:ci` script handles this automatically. +dd-trace uses a non-standard dependency installation for plugin tests. Libraries under test are installed per-version via `npm run services` (which drives `scripts/install_plugin_modules.js` and a bun isolated install per sandbox), not through the normal `node_modules`. The `:ci` script handles this automatically. ```bash -# CI command (preferred) — runs yarn services for dependency installation, then tests +# CI command (preferred) — runs `npm run services` for dependency installation, then tests PLUGINS="" npm run test:plugins:ci -# Unit tests only (assumes yarn services already ran) +# Unit tests only (assumes `npm run services` already ran) PLUGINS="" npm run test:plugins # With external services (e.g., databases, message brokers) diff --git a/.cursor/worktrees.json b/.cursor/worktrees.json index d9cf01692f1..d60701606b5 100644 --- a/.cursor/worktrees.json +++ b/.cursor/worktrees.json @@ -1,5 +1,5 @@ { "scripts": { - "postCreate": "yarn install" + "postCreate": "bun install" } } diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2dd73427495..7068d0c4a4e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -255,6 +255,8 @@ /.github/workflows/aiguard.yml @DataDog/asm-js /.github/workflows/appsec.yml @DataDog/asm-js /.github/workflows/debugger.yml @DataDog/debugger-nodejs +/.github/workflows/install-smoke.yml @DataDog/lang-platform-js +/docs/ @DataDog/lang-platform-js /.github/workflows/instrumentation.yml @DataDog/apm-idm-js /.github/workflows/electron.yml @DataDog/apm-idm-js /.github/workflows/serverless.yml @DataDog/serverless-aws @DataDog/apm-serverless diff --git a/.github/actions/datadog-ci/.yarnrc b/.github/actions/datadog-ci/.yarnrc deleted file mode 100644 index 142dad81709..00000000000 --- a/.github/actions/datadog-ci/.yarnrc +++ /dev/null @@ -1 +0,0 @@ -registry "https://registry.npmjs.org" diff --git a/.github/actions/datadog-ci/action.yml b/.github/actions/datadog-ci/action.yml index 13924ed071c..1bc6e88f8de 100644 --- a/.github/actions/datadog-ci/action.yml +++ b/.github/actions/datadog-ci/action.yml @@ -8,6 +8,12 @@ runs: with: node-version: '20' + # Stay on npm here so the action works in container jobs that lack `unzip` + # (the playwright matrix runs in `ghcr.io/datadog/dd-trace-js/playwright-tools`, + # which ships without it and breaks `oven-sh/setup-bun`). `npm ci` consumes + # the committed `package-lock.json`, pinning the tarball integrity hash so a + # republished `@datadog/datadog-ci` at the same version number cannot land + # without an explicit lockfile update. - uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 with: max_attempts: 3 @@ -15,7 +21,7 @@ runs: retry_wait_seconds: 30 command: | cd ${{ github.workspace }}/.github/actions/datadog-ci - yarn install --frozen-lockfile + npm ci --ignore-scripts --no-audit --no-fund - shell: bash run: echo "${{ github.workspace }}/.github/actions/datadog-ci/node_modules/.bin" >> $GITHUB_PATH diff --git a/.github/actions/datadog-ci/package-lock.json b/.github/actions/datadog-ci/package-lock.json new file mode 100644 index 00000000000..31a9848262a --- /dev/null +++ b/.github/actions/datadog-ci/package-lock.json @@ -0,0 +1,27 @@ +{ + "name": "datadog-ci", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "datadog-ci", + "version": "1.0.0", + "dependencies": { + "@datadog/datadog-ci": "5.16.0" + } + }, + "node_modules/@datadog/datadog-ci": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/@datadog/datadog-ci/-/datadog-ci-5.16.0.tgz", + "integrity": "sha512-0ykDASeq6cM9LAZibf/n8VxyVYLFGSCGmepuY0tLzcFHZuob2hszN++C8R91afW3cOTy/fKWHdDADFKv4qD1RQ==", + "license": "Apache-2.0", + "bin": { + "datadog-ci": "dist/bundle.js" + }, + "engines": { + "node": ">=20" + } + } + } +} diff --git a/.github/actions/datadog-ci/yarn.lock b/.github/actions/datadog-ci/yarn.lock deleted file mode 100644 index 0a1c6bbdeaf..00000000000 --- a/.github/actions/datadog-ci/yarn.lock +++ /dev/null @@ -1,8 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@datadog/datadog-ci@5.16.0": - version "5.16.0" - resolved "https://registry.npmjs.org/@datadog/datadog-ci/-/datadog-ci-5.16.0.tgz#54c40e97ff0ba14d661beaec4f8efec1808b8bbe" - integrity sha512-0ykDASeq6cM9LAZibf/n8VxyVYLFGSCGmepuY0tLzcFHZuob2hszN++C8R91afW3cOTy/fKWHdDADFKv4qD1RQ== diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml index 4dbb54dd6d9..e9d9b07d83a 100644 --- a/.github/actions/install/action.yml +++ b/.github/actions/install/action.yml @@ -1,13 +1,48 @@ name: Install dependencies description: Install dependencies +inputs: + cache: + description: Restore and save the bun-install output tar between runs of this workflow/job. + required: false + default: 'false' runs: using: composite steps: - - uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 + - id: install-cache + if: inputs.cache == 'true' + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + # `bun install` runs `prepare`, which `cd vendor && npm ci --include=dev` runs + # `node rspack` and lands the bundled artefacts under `vendor/dist`. Both + # `vendor/package-lock.json` and `bun.lock` feed the install graph, so the cache + # key has to invalidate when either moves. + key: install-cache-${{ github.workflow }}-${{ github.job }}-${{ hashFiles('bun.lock', 'vendor/package-lock.json') }}-v3 + path: install-cache.tar + - if: inputs.cache == 'true' && steps.install-cache.outputs.cache-hit == 'true' + shell: bash + run: tar -xf install-cache.tar + - if: inputs.cache != 'true' || steps.install-cache.outputs.cache-hit != 'true' + uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 env: _DD_IGNORE_ENGINES: 'true' with: max_attempts: 3 timeout_minutes: 5 retry_wait_seconds: 30 - command: bun install --linker=hoisted --trust --network-concurrency 8 + # `--frozen-lockfile` makes CI fail the install step when `bun.lock` and + # `package.json` disagree (typical Dependabot bump, contributor who + # edited `package.json` without re-running `bun install`). Without it, + # the install would silently resolve fresh against the registry and the + # supply-chain pin in `bunfig.toml` (`minimumReleaseAge`) would be the + # only thing left protecting that run. The four native packages that + # need their `install` script to fetch the prebuilt binary live in + # `trustedDependencies` in `package.json` — the CLI's `--trust` flag is + # mutually exclusive with `--frozen-lockfile`, so the trust list has to + # be declarative. + command: bun install --frozen-lockfile --linker=hoisted --network-concurrency 8 + - if: inputs.cache == 'true' && steps.install-cache.outputs.cache-hit != 'true' + shell: bash + # `node_modules` alone misses `vendor/dist/*` (produced by the rspack postinstall) + # and `vendor/node_modules` (needed for it to re-run on the next miss); without + # them, every cache-hit job fails to require `vendor/dist/limiter` and friends. + run: tar -cf install-cache.tar node_modules vendor/node_modules vendor/dist diff --git a/.github/actions/instrumentations/test/action.yml b/.github/actions/instrumentations/test/action.yml index faf48e5cc09..79e183c4fd5 100644 --- a/.github/actions/instrumentations/test/action.yml +++ b/.github/actions/instrumentations/test/action.yml @@ -7,10 +7,10 @@ runs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:instrumentations:ci + - run: npm run test:instrumentations:ci shell: bash - uses: ./.github/actions/node/latest - - run: yarn test:instrumentations:ci + - run: npm run test:instrumentations:ci shell: bash - uses: ./.github/actions/coverage with: diff --git a/.github/actions/plugins/integration-test-newest-lts/action.yml b/.github/actions/plugins/integration-test-newest-lts/action.yml index a826b42efb5..3993dadc29c 100644 --- a/.github/actions/plugins/integration-test-newest-lts/action.yml +++ b/.github/actions/plugins/integration-test-newest-lts/action.yml @@ -12,7 +12,7 @@ runs: id: dd-sts - uses: ./.github/actions/node/newest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:integration:plugins:coverage + - run: npm run test:integration:plugins:coverage shell: bash - uses: ./.github/actions/coverage with: diff --git a/.github/actions/plugins/integration-test/action.yml b/.github/actions/plugins/integration-test/action.yml index 4d910f46e0f..ba1c92e14c7 100644 --- a/.github/actions/plugins/integration-test/action.yml +++ b/.github/actions/plugins/integration-test/action.yml @@ -8,10 +8,10 @@ runs: - uses: ./.github/actions/testagent/start - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:integration:plugins:coverage + - run: npm run test:integration:plugins:coverage shell: bash - uses: ./.github/actions/node/latest - - run: yarn test:integration:plugins:coverage + - run: npm run test:integration:plugins:coverage shell: bash - uses: ./.github/actions/coverage with: diff --git a/.github/actions/plugins/test-and-upstream/action.yml b/.github/actions/plugins/test-and-upstream/action.yml index 202df98575f..e86b0485c01 100644 --- a/.github/actions/plugins/test-and-upstream/action.yml +++ b/.github/actions/plugins/test-and-upstream/action.yml @@ -15,14 +15,14 @@ runs: - if: ${{ inputs.node-floor == 'newest-maintenance-lts' }} uses: ./.github/actions/node/newest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci shell: bash - - run: yarn test:plugins:upstream + - run: npm run test:plugins:upstream shell: bash - uses: ./.github/actions/node/latest - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci shell: bash - - run: yarn test:plugins:upstream + - run: npm run test:plugins:upstream shell: bash - uses: ./.github/actions/coverage with: diff --git a/.github/actions/plugins/test/action.yml b/.github/actions/plugins/test/action.yml index 1c86f086473..546da933c8d 100644 --- a/.github/actions/plugins/test/action.yml +++ b/.github/actions/plugins/test/action.yml @@ -15,10 +15,10 @@ runs: - if: ${{ inputs.node-floor == 'newest-maintenance-lts' }} uses: ./.github/actions/node/newest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci shell: bash - uses: ./.github/actions/node/latest - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci shell: bash - uses: ./.github/actions/coverage with: diff --git a/.github/actions/plugins/upstream/action.yml b/.github/actions/plugins/upstream/action.yml index cb908f4091a..62994f14c20 100644 --- a/.github/actions/plugins/upstream/action.yml +++ b/.github/actions/plugins/upstream/action.yml @@ -15,10 +15,10 @@ runs: - if: ${{ inputs.node-floor == 'newest-maintenance-lts' }} uses: ./.github/actions/node/newest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:plugins:upstream + - run: npm run test:plugins:upstream shell: bash - uses: ./.github/actions/node/latest - - run: yarn test:plugins:upstream + - run: npm run test:plugins:upstream shell: bash # `test:plugins:upstream` runs each plugin's upstream test suite (e.g., axios's own tests) # against the unit-test harness, which intentionally does not produce NYC coverage for diff --git a/.github/chainguard/yarn-dedupe.sts.yaml b/.github/chainguard/yarn-dedupe.sts.yaml deleted file mode 100644 index 69712d20929..00000000000 --- a/.github/chainguard/yarn-dedupe.sts.yaml +++ /dev/null @@ -1,12 +0,0 @@ -issuer: https://token.actions.githubusercontent.com - -subject: repo:DataDog/dd-trace-js:pull_request - -claim_pattern: - event_name: pull_request - ref: refs/pull/[0-9]+/merge - job_workflow_ref: DataDog/dd-trace-js/\.github/workflows/project.yml@refs/pull/[0-9]+/merge - -permissions: - contents: write - diff --git a/.github/workflows/aiguard.yml b/.github/workflows/aiguard.yml index 24c7eefe8f2..cd81e4cde74 100644 --- a/.github/workflows/aiguard.yml +++ b/.github/workflows/aiguard.yml @@ -23,7 +23,7 @@ jobs: id: dd-sts - uses: ./.github/actions/node/latest - uses: ./.github/actions/install - - run: yarn test:aiguard:ci + - run: npm run test:aiguard:ci - uses: ./.github/actions/coverage with: flags: aiguard-macos @@ -44,13 +44,13 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:aiguard:ci + - run: npm run test:aiguard:ci - uses: ./.github/actions/node/newest-maintenance-lts - - run: yarn test:aiguard:ci + - run: npm run test:aiguard:ci - uses: ./.github/actions/node/active-lts - - run: yarn test:aiguard:ci + - run: npm run test:aiguard:ci - uses: ./.github/actions/node/latest - - run: yarn test:aiguard:ci + - run: npm run test:aiguard:ci - uses: ./.github/actions/coverage with: flags: aiguard-ubuntu @@ -73,7 +73,9 @@ jobs: with: version: 24.14.1 # TODO: remove pin when https://github.com/nodejs/node/issues/62991 is fixed - uses: ./.github/actions/install - - run: yarn test:aiguard:ci + with: + cache: "true" + - run: npm run test:aiguard:ci - uses: ./.github/actions/node-crash-report if: failure() - uses: ./.github/actions/coverage @@ -102,7 +104,7 @@ jobs: with: version: ${{ matrix.version }} - uses: ./.github/actions/install - - run: yarn test:integration:aiguard:coverage + - run: npm run test:integration:aiguard:coverage - uses: ./.github/actions/coverage with: flags: aiguard-integration-${{ matrix.version }} diff --git a/.github/workflows/all-green.yml b/.github/workflows/all-green.yml index 92ff4482437..f64269a7aba 100644 --- a/.github/workflows/all-green.yml +++ b/.github/workflows/all-green.yml @@ -31,7 +31,7 @@ jobs: - uses: ./.github/actions/node with: version: active - - run: yarn add @actions/core @actions/github octokit + - run: bun install @actions/core @actions/github octokit - run: node scripts/all-green.mjs env: DELAY: ${{ github.run_attempt == 1 && '5' || '0' }} # 5 minutes on first attempt, no delay on reruns diff --git a/.github/workflows/apm-capabilities.yml b/.github/workflows/apm-capabilities.yml index fc3906d93ec..ff27d904850 100644 --- a/.github/workflows/apm-capabilities.yml +++ b/.github/workflows/apm-capabilities.yml @@ -31,7 +31,7 @@ jobs: id: dd-sts - uses: ./.github/actions/node/latest - uses: ./.github/actions/install - - run: yarn test:trace:core:ci + - run: npm run test:trace:core:ci - uses: ./.github/actions/coverage with: flags: apm-capabilities-tracing-macos @@ -57,7 +57,7 @@ jobs: with: version: ${{ matrix.node-version }} - uses: ./.github/actions/install - - run: yarn test:trace:core:ci + - run: npm run test:trace:core:ci - uses: ./.github/actions/coverage with: flags: apm-capabilities-tracing-ubuntu-${{ matrix.node-version }} @@ -79,7 +79,9 @@ jobs: with: version: 24.14.1 # TODO: remove pin when https://github.com/nodejs/node/issues/62991 is fixed - uses: ./.github/actions/install - - run: yarn test:trace:core:ci + with: + cache: "true" + - run: npm run test:trace:core:ci - uses: ./.github/actions/node-crash-report if: failure() - uses: ./.github/actions/coverage diff --git a/.github/workflows/apm-integrations.yml b/.github/workflows/apm-integrations.yml index 9235d65efc7..cd3c25321bd 100644 --- a/.github/workflows/apm-integrations.yml +++ b/.github/workflows/apm-integrations.yml @@ -77,11 +77,10 @@ jobs: - uses: ./.github/actions/node with: version: ${{ matrix.node-version }} - - run: yarn config set ignore-engines true - name: Install dependencies uses: ./.github/actions/install - name: Run tests - run: yarn test:plugins:ci + run: npm run test:plugins:ci - uses: ./.github/actions/coverage with: flags: apm-integrations-aerospike-${{ matrix.node-version }}-${{ matrix.range_clean }} @@ -227,13 +226,13 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/node/newest-maintenance-lts - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/node/active-lts - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/coverage with: flags: apm-integrations-child-process @@ -302,7 +301,7 @@ jobs: with: version: ${{ matrix.node-version }} - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/coverage with: flags: apm-integrations-confluentinc-kafka-javascript-${{ matrix.node-version }} @@ -365,8 +364,7 @@ jobs: with: version: ${{ matrix.node-version }} - uses: ./.github/actions/install - - run: yarn config set ignore-engines true - - run: yarn test:plugins:ci --ignore-engines + - run: npm run test:plugins:ci - uses: ./.github/actions/coverage with: flags: apm-integrations-couchbase-${{ matrix.node-version }} @@ -398,13 +396,13 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/node/newest-maintenance-lts - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/node/active-lts - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/coverage with: flags: apm-integrations-dns @@ -434,7 +432,7 @@ jobs: id: dd-sts - uses: ./.github/actions/node/latest - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/coverage with: flags: apm-integrations-elasticsearch @@ -477,7 +475,7 @@ jobs: # Bounded at 30s so an Xvfb crash fails fast instead of hanging. timeout 30 bash -c 'until xdpyinfo -display :99 >/dev/null 2>&1; do sleep 0.1; done' # Point Electron at the virtual display started above. - - run: DISPLAY=:99 yarn test:plugins:ci + - run: DISPLAY=:99 npm run test:plugins:ci - uses: ./.github/actions/push_to_test_optimization if: "!cancelled()" with: @@ -491,7 +489,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: ./.github/actions/node/latest - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci express-mongo-sanitize: runs-on: ubuntu-latest @@ -621,7 +619,7 @@ jobs: with: version: ${{ matrix.node-version }} - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/coverage with: flags: apm-integrations-http-${{ matrix.node-version }} @@ -643,13 +641,13 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/node/newest-maintenance-lts - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/node/active-lts - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/coverage with: flags: apm-integrations-http2 @@ -701,7 +699,7 @@ jobs: with: version: ${{ matrix.node-version }} - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/coverage with: flags: apm-integrations-kafkajs-${{ matrix.node-version }} @@ -946,13 +944,13 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/node/newest-maintenance-lts - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/node/active-lts - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/coverage with: flags: apm-integrations-net @@ -995,7 +993,7 @@ jobs: id: dd-sts - uses: ./.github/actions/node/latest - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/coverage with: flags: apm-integrations-next-${{ matrix.range }} @@ -1068,9 +1066,8 @@ jobs: sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 sudo sh -c "echo /opt/oracle/instantclient_19_28 > /etc/ld.so.conf.d/oracle-instantclient.conf" sudo ldconfig - - run: yarn config set ignore-engines true - - run: yarn services --ignore-engines - - run: yarn test:plugins:ci --ignore-engines + - run: npm run services + - run: npm run test:plugins:ci - if: always() uses: ./.github/actions/testagent/logs with: @@ -1180,7 +1177,7 @@ jobs: version: ${{ matrix.node-version }} - uses: ./.github/actions/install - name: Run tests - run: yarn test:plugins:ci + run: npm run test:plugins:ci - uses: ./.github/actions/coverage with: flags: apm-integrations-prisma-${{ matrix.node-version }}-${{ matrix.range_clean }} @@ -1284,9 +1281,9 @@ jobs: - uses: ./.github/actions/testagent/start - uses: ./.github/actions/node/active-lts - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/node/oldest-maintenance-lts - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/coverage with: flags: apm-integrations-restify @@ -1348,7 +1345,7 @@ jobs: id: dd-sts - uses: ./.github/actions/node/latest - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - uses: ./.github/actions/coverage with: flags: apm-integrations-sharedb @@ -1380,8 +1377,8 @@ jobs: id: dd-sts - uses: ./.github/actions/node/latest - uses: ./.github/actions/install - - run: yarn test:plugins:ci - - run: yarn test:plugins:upstream + - run: npm run test:plugins:ci + - run: npm run test:plugins:upstream - uses: ./.github/actions/coverage with: flags: apm-integrations-tedious diff --git a/.github/workflows/appsec.yml b/.github/workflows/appsec.yml index 4f23228f4e4..123e7a9646d 100644 --- a/.github/workflows/appsec.yml +++ b/.github/workflows/appsec.yml @@ -32,7 +32,7 @@ jobs: id: dd-sts - uses: ./.github/actions/node/latest - uses: ./.github/actions/install - - run: yarn test:appsec:ci + - run: npm run test:appsec:ci - uses: ./.github/actions/coverage with: flags: appsec-macos @@ -53,13 +53,13 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:ci + - run: npm run test:appsec:ci - uses: ./.github/actions/node/newest-maintenance-lts - - run: yarn test:appsec:ci + - run: npm run test:appsec:ci - uses: ./.github/actions/node/active-lts - - run: yarn test:appsec:ci + - run: npm run test:appsec:ci - uses: ./.github/actions/node/latest - - run: yarn test:appsec:ci + - run: npm run test:appsec:ci - uses: ./.github/actions/coverage with: flags: appsec-ubuntu @@ -82,7 +82,9 @@ jobs: with: version: 24.14.1 # TODO: remove pin when https://github.com/nodejs/node/issues/62991 is fixed - uses: ./.github/actions/install - - run: yarn test:appsec:ci + with: + cache: "true" + - run: npm run test:appsec:ci - uses: ./.github/actions/node-crash-report if: failure() - uses: ./.github/actions/coverage @@ -118,9 +120,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-ldapjs @@ -152,9 +154,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/newest-maintenance-lts - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-postgres @@ -186,9 +188,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/newest-maintenance-lts - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-mysql @@ -211,9 +213,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-express @@ -236,9 +238,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-fastify @@ -261,9 +263,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-graphql @@ -292,9 +294,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-mongodb-core @@ -323,9 +325,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-mongoose @@ -347,13 +349,13 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/newest-maintenance-lts - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/active-lts - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-sourcing @@ -400,7 +402,7 @@ jobs: with: version: ${{ matrix.version }} - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-next-${{ matrix.version }}-${{ matrix.range_clean || matrix.range }} @@ -423,9 +425,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-lodash @@ -452,7 +454,7 @@ jobs: with: version: ${{ matrix.version }} - uses: ./.github/actions/install - - run: yarn test:integration:appsec:coverage + - run: npm run test:integration:appsec:coverage - uses: ./.github/actions/coverage with: flags: appsec-integration-${{ matrix.version }} @@ -474,9 +476,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-passport @@ -498,9 +500,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-template @@ -523,9 +525,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-node-serialize @@ -566,9 +568,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-kafka @@ -590,9 +592,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/node/latest - - run: yarn test:appsec:plugins:ci + - run: npm run test:appsec:plugins:ci - uses: ./.github/actions/coverage with: flags: appsec-stripe diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index d9c82d8d2e8..d0afaf79c9e 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -15,6 +15,6 @@ jobs: steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: ./.github/actions/node/latest - - run: yarn audit - - run: yarn audit + - run: bun audit + - run: bun audit working-directory: ./vendor diff --git a/.github/workflows/debugger.yml b/.github/workflows/debugger.yml index f9daaf0e50a..a392fbe4854 100644 --- a/.github/workflows/debugger.yml +++ b/.github/workflows/debugger.yml @@ -29,9 +29,9 @@ jobs: with: version: ${{ matrix.version }} - uses: ./.github/actions/install - - run: yarn test:code-origin:ci - - run: yarn test:debugger:ci - - run: yarn test:integration:debugger:coverage + - run: npm run test:code-origin:ci + - run: npm run test:debugger:ci + - run: npm run test:integration:debugger:coverage - uses: ./.github/actions/coverage with: flags: debugger-ubuntu-${{ matrix.version }} diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml index e983f828f76..7fb47131ac8 100644 --- a/.github/workflows/electron.yml +++ b/.github/workflows/electron.yml @@ -25,7 +25,7 @@ jobs: with: version: '24.15' - uses: ./.github/actions/install - - run: yarn test:integration:electron + - run: npm run test:integration:electron - uses: ./.github/actions/push_to_test_optimization if: "!cancelled()" with: @@ -45,7 +45,7 @@ jobs: - uses: ./.github/actions/install # Electron needs a display even for headless (show: false) windows. # xvfb-run provides a virtual framebuffer so the test can run without a physical display. - - run: xvfb-run --auto-servernum yarn test:integration:electron + - run: xvfb-run --auto-servernum npm run test:integration:electron - uses: ./.github/actions/push_to_test_optimization if: "!cancelled()" with: diff --git a/.github/workflows/flakiness.yml b/.github/workflows/flakiness.yml index c9f88e14fb1..ec279ca3c1e 100644 --- a/.github/workflows/flakiness.yml +++ b/.github/workflows/flakiness.yml @@ -35,11 +35,11 @@ jobs: .github package.json scripts - yarn.lock + bun.lock - uses: ./.github/actions/node with: version: active - - run: yarn install --frozen-lockfile --ignore-scripts + - run: bun install --frozen-lockfile --ignore-scripts - run: node scripts/flakiness.mjs - run: cat flakiness.md >> $GITHUB_STEP_SUMMARY - id: slack diff --git a/.github/workflows/install-smoke.yml b/.github/workflows/install-smoke.yml new file mode 100644 index 00000000000..8e49e29109c --- /dev/null +++ b/.github/workflows/install-smoke.yml @@ -0,0 +1,40 @@ +name: Install smoke test + +on: + pull_request: + push: + branches: [master, mq-working-branch-master-*] + schedule: + - cron: 0 4 * * * + +concurrency: + group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_id || github.ref }} + cancel-in-progress: true + +jobs: + pino-sandbox: + name: Sandbox install (pino) + runs-on: ubuntu-latest + permissions: + id-token: write + env: + _DD_IGNORE_ENGINES: 'true' + PLUGINS: pino + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: ./.github/actions/dd-sts-api-key + id: dd-sts + - uses: ./.github/actions/node + with: + version: oldest + - uses: ./.github/actions/install + - name: Synthesize and install per-version sandboxes + run: npm run services + - name: Assert sandbox version resolution + run: npm run test:scripts + - name: Smoke-test the pino plugin against the sandbox + run: npm run test:plugins -- --grep "should not alter the default behavior" + - uses: ./.github/actions/push_to_test_optimization + if: "!cancelled()" + with: + dd_api_key: ${{ steps.dd-sts.outputs.api_key }} diff --git a/.github/workflows/instrumentation.yml b/.github/workflows/instrumentation.yml index 3466daf6517..5c43e0af28d 100644 --- a/.github/workflows/instrumentation.yml +++ b/.github/workflows/instrumentation.yml @@ -31,9 +31,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:esbuild:ci + - run: npm run test:esbuild:ci - uses: ./.github/actions/node/latest - - run: yarn test:esbuild:ci + - run: npm run test:esbuild:ci - uses: ./.github/actions/coverage with: flags: platform-esbuild @@ -49,9 +49,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:webpack:ci + - run: npm run test:webpack:ci - uses: ./.github/actions/node/latest - - run: yarn test:webpack:ci + - run: npm run test:webpack:ci - uses: ./.github/actions/coverage with: flags: platform-webpack @@ -145,8 +145,9 @@ jobs: with: version: ${{ matrix.node-version }} - uses: ./.github/actions/install - - run: yarn config set ignore-engines true - - run: yarn test:instrumentations:ci --ignore-engines + - env: + _DD_IGNORE_ENGINES: 'true' + run: npm run test:instrumentations:ci - uses: ./.github/actions/coverage with: flags: instrumentations-${{ github.job }}-${{ matrix.node-version }} @@ -272,7 +273,7 @@ jobs: max_attempts: 5 timeout_minutes: 15 retry_wait_seconds: 20 - command: yarn test:instrumentations:ci + command: npm run test:instrumentations:ci - uses: ./.github/actions/node/latest - name: Run instrumentation tests (latest, with retries) uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 @@ -280,7 +281,7 @@ jobs: max_attempts: 5 timeout_minutes: 15 retry_wait_seconds: 20 - command: yarn test:instrumentations:ci + command: npm run test:instrumentations:ci - uses: ./.github/actions/coverage with: flags: instrumentations-${{ github.job }} @@ -504,16 +505,16 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:instrumentations:misc:ci + - run: npm run test:instrumentations:misc:ci shell: bash - uses: ./.github/actions/node/newest-maintenance-lts - - run: yarn test:instrumentations:misc:ci + - run: npm run test:instrumentations:misc:ci shell: bash - uses: ./.github/actions/node/active-lts - - run: yarn test:instrumentations:misc:ci + - run: npm run test:instrumentations:misc:ci shell: bash - uses: ./.github/actions/node/latest - - run: yarn test:instrumentations:misc:ci + - run: npm run test:instrumentations:misc:ci shell: bash - uses: ./.github/actions/coverage with: @@ -544,9 +545,9 @@ jobs: # Disable core dumps since some integration tests intentionally abort and core dump generation takes around 5-10s - uses: ./.github/actions/install - run: sudo sysctl -w kernel.core_pattern='|/bin/false' - - run: yarn test:integration:esbuild:coverage - env: + - env: ESBUILD_VERSION: ${{ matrix.esbuild_version }} + run: npm run test:integration:esbuild:coverage - uses: ./.github/actions/coverage with: flags: instrumentations-integration-esbuild-${{ matrix.esbuild_version }}-${{ matrix.version }} @@ -578,7 +579,7 @@ jobs: # TODO: Webpack bundles dd-trace into a single file with the customer code, so the # NYC counters end up bundled too and the bootstrap can't find them at the original # paths. Switch to `:coverage` once the harness handles bundled output. - - run: yarn test:integration:webpack + - run: npm run test:integration:webpack - uses: ./.github/actions/push_to_test_optimization if: "!cancelled()" with: diff --git a/.github/workflows/llmobs.yml b/.github/workflows/llmobs.yml index 8075929b958..e835b01d27d 100644 --- a/.github/workflows/llmobs.yml +++ b/.github/workflows/llmobs.yml @@ -38,7 +38,7 @@ jobs: with: version: ${{ matrix.version }} - uses: ./.github/actions/install - - run: yarn test:llmobs:sdk:ci + - run: npm run test:llmobs:sdk:ci - if: always() uses: ./.github/actions/testagent/logs with: @@ -71,8 +71,8 @@ jobs: with: version: ${{ matrix.version }} - uses: ./.github/actions/install - - run: yarn test:plugins:ci - - run: yarn test:llmobs:plugins:ci + - run: npm run test:plugins:ci + - run: npm run test:llmobs:plugins:ci shell: bash - uses: ./.github/actions/coverage with: @@ -100,12 +100,12 @@ jobs: - uses: ./.github/actions/testagent/start - uses: ./.github/actions/node/newest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:plugins:ci - - run: yarn test:llmobs:plugins:ci + - run: npm run test:plugins:ci + - run: npm run test:llmobs:plugins:ci shell: bash - uses: ./.github/actions/node/latest - - run: yarn test:plugins:ci - - run: yarn test:llmobs:plugins:ci + - run: npm run test:plugins:ci + - run: npm run test:llmobs:plugins:ci shell: bash - uses: ./.github/actions/coverage with: @@ -133,10 +133,10 @@ jobs: - uses: ./.github/actions/testagent/start - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:llmobs:plugins:ci + - run: npm run test:llmobs:plugins:ci shell: bash - uses: ./.github/actions/node/latest - - run: yarn test:llmobs:plugins:ci + - run: npm run test:llmobs:plugins:ci shell: bash - uses: ./.github/actions/coverage with: @@ -164,12 +164,12 @@ jobs: - uses: ./.github/actions/testagent/start - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:plugins:ci - - run: yarn test:llmobs:plugins:ci + - run: npm run test:plugins:ci + - run: npm run test:llmobs:plugins:ci shell: bash - uses: ./.github/actions/node/latest - - run: yarn test:plugins:ci - - run: yarn test:llmobs:plugins:ci + - run: npm run test:plugins:ci + - run: npm run test:llmobs:plugins:ci shell: bash - uses: ./.github/actions/coverage with: @@ -197,12 +197,12 @@ jobs: - uses: ./.github/actions/testagent/start - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:plugins:ci - - run: yarn test:llmobs:plugins:ci + - run: npm run test:plugins:ci + - run: npm run test:llmobs:plugins:ci shell: bash - uses: ./.github/actions/node/latest - - run: yarn test:plugins:ci - - run: yarn test:llmobs:plugins:ci + - run: npm run test:plugins:ci + - run: npm run test:llmobs:plugins:ci shell: bash - uses: ./.github/actions/coverage with: @@ -230,12 +230,12 @@ jobs: - uses: ./.github/actions/testagent/start - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:plugins:ci - - run: yarn test:llmobs:plugins:ci + - run: npm run test:plugins:ci + - run: npm run test:llmobs:plugins:ci shell: bash - uses: ./.github/actions/node/latest - - run: yarn test:plugins:ci - - run: yarn test:llmobs:plugins:ci + - run: npm run test:plugins:ci + - run: npm run test:llmobs:plugins:ci shell: bash - uses: ./.github/actions/coverage with: @@ -263,12 +263,12 @@ jobs: - uses: ./.github/actions/testagent/start - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:plugins:ci - - run: yarn test:llmobs:plugins:ci + - run: npm run test:plugins:ci + - run: npm run test:llmobs:plugins:ci shell: bash - uses: ./.github/actions/node/latest - - run: yarn test:plugins:ci - - run: yarn test:llmobs:plugins:ci + - run: npm run test:plugins:ci + - run: npm run test:llmobs:plugins:ci shell: bash - uses: ./.github/actions/coverage with: diff --git a/.github/workflows/openfeature.yml b/.github/workflows/openfeature.yml index cbdd45f1705..1700737b9c4 100644 --- a/.github/workflows/openfeature.yml +++ b/.github/workflows/openfeature.yml @@ -29,7 +29,7 @@ jobs: with: version: ${{ matrix.version }} - uses: ./.github/actions/install - - run: yarn test:openfeature:ci + - run: npm run test:openfeature:ci - uses: ./.github/actions/coverage with: flags: openfeature-unit-${{ matrix.version }} @@ -50,7 +50,7 @@ jobs: id: dd-sts - uses: ./.github/actions/node/latest - uses: ./.github/actions/install - - run: yarn test:integration:openfeature:coverage + - run: npm run test:integration:openfeature:coverage - uses: ./.github/actions/coverage with: flags: openfeature-macos @@ -71,13 +71,13 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:integration:openfeature:coverage + - run: npm run test:integration:openfeature:coverage - uses: ./.github/actions/node/newest-maintenance-lts - - run: yarn test:integration:openfeature:coverage + - run: npm run test:integration:openfeature:coverage - uses: ./.github/actions/node/active-lts - - run: yarn test:integration:openfeature:coverage + - run: npm run test:integration:openfeature:coverage - uses: ./.github/actions/node/latest - - run: yarn test:integration:openfeature:coverage + - run: npm run test:integration:openfeature:coverage - uses: ./.github/actions/coverage with: flags: openfeature-ubuntu @@ -100,7 +100,9 @@ jobs: with: version: 24.14.1 # TODO: remove pin when https://github.com/nodejs/node/issues/62991 is fixed - uses: ./.github/actions/install - - run: yarn test:integration:openfeature:coverage + with: + cache: "true" + - run: npm run test:integration:openfeature:coverage - uses: ./.github/actions/node-crash-report if: failure() - uses: ./.github/actions/coverage diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 346daf44826..0a3a7a74e4e 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -60,7 +60,19 @@ jobs: - run: mkdir -p /tmp/app - run: npm i -g pnpm if: matrix.manager.name == 'pnpm' - - run: cd /tmp/app && ${{ matrix.manager.install }} /tmp/dd-trace.tgz + # Wrapped in nick-fields/retry to bound the worst case: on this PR + # the bun matrix entry has been stalling indefinitely at `Resolving + # dependencies` on the consumer install, matching the symptom in + # oven-sh/bun#5831. The four other package managers finish in ~3-5s + # against the same dd-trace.tgz, so a 2-minute per-attempt cap is + # generous for the happy path and tight enough that a stalled bun + # retries quickly instead of holding the job for 6 hours. + - uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 + with: + max_attempts: 3 + timeout_minutes: 2 + retry_wait_seconds: 5 + command: cd /tmp/app && ${{ matrix.manager.install }} /tmp/dd-trace.tgz - run: echo "require('dd-trace').init()" >> /tmp/app/index.js - run: node /tmp/app @@ -85,7 +97,7 @@ jobs: id: dd-sts - uses: ./.github/actions/node/active-lts - uses: ./.github/actions/install - - run: yarn test:integration:bun + - run: npm run test:integration:bun - uses: ./.github/actions/push_to_test_optimization if: always() with: @@ -101,9 +113,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:core:ci + - run: npm run test:core:ci - uses: ./.github/actions/node/latest - - run: yarn test:core:ci + - run: npm run test:core:ci - uses: ./.github/actions/coverage with: flags: platform-core @@ -145,7 +157,7 @@ jobs: # Disable core dumps since some integration tests intentionally abort and core dump generation takes around 5-10s - uses: ./.github/actions/install - run: sudo sysctl -w kernel.core_pattern='|/bin/false' - - run: yarn test:integration:coverage + - run: npm run test:integration:coverage - uses: ./.github/actions/coverage with: flags: platform-integration-${{ matrix.version }} @@ -174,7 +186,7 @@ jobs: - uses: ./.github/actions/install # Disable core dumps since crashtracking tests intentionally abort - run: sudo sysctl -w kernel.core_pattern='|/bin/false' - - run: yarn test:integration:crashtracking + - run: npm run test:integration:crashtracking - uses: ./.github/actions/push_to_test_optimization if: "!cancelled()" with: @@ -190,7 +202,7 @@ jobs: id: dd-sts - uses: ./.github/actions/node/latest - uses: ./.github/actions/install - - run: yarn test:trace:guardrails:ci + - run: npm run test:trace:guardrails:ci - uses: ./.github/actions/coverage with: flags: platform-unit-guardrails @@ -255,9 +267,9 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:shimmer:ci + - run: npm run test:shimmer:ci - uses: ./.github/actions/node/latest - - run: yarn test:shimmer:ci + - run: npm run test:shimmer:ci - uses: ./.github/actions/coverage with: flags: platform-shimmer diff --git a/.github/workflows/profiling.yml b/.github/workflows/profiling.yml index 28d9eac8781..f4c426422bf 100644 --- a/.github/workflows/profiling.yml +++ b/.github/workflows/profiling.yml @@ -32,8 +32,8 @@ jobs: id: dd-sts - uses: ./.github/actions/node/latest - uses: ./.github/actions/install - - run: yarn test:profiler:ci - - run: yarn test:integration:profiler:coverage + - run: npm run test:profiler:ci + - run: npm run test:integration:profiler:coverage - uses: ./.github/actions/coverage with: flags: profiling-macos @@ -54,17 +54,17 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:profiler:ci - - run: yarn test:integration:profiler:coverage + - run: npm run test:profiler:ci + - run: npm run test:integration:profiler:coverage - uses: ./.github/actions/node/newest-maintenance-lts - - run: yarn test:profiler:ci - - run: yarn test:integration:profiler:coverage + - run: npm run test:profiler:ci + - run: npm run test:integration:profiler:coverage - uses: ./.github/actions/node/active-lts - - run: yarn test:profiler:ci - - run: yarn test:integration:profiler:coverage + - run: npm run test:profiler:ci + - run: npm run test:integration:profiler:coverage - uses: ./.github/actions/node/latest - - run: yarn test:profiler:ci - - run: yarn test:integration:profiler:coverage + - run: npm run test:profiler:ci + - run: npm run test:integration:profiler:coverage - uses: ./.github/actions/coverage with: flags: profiling-ubuntu @@ -87,8 +87,10 @@ jobs: with: version: 24.14.1 # TODO: remove pin when https://github.com/nodejs/node/issues/62991 is fixed - uses: ./.github/actions/install - - run: yarn test:profiler:ci - - run: yarn test:integration:profiler:coverage + with: + cache: "true" + - run: npm run test:profiler:ci + - run: npm run test:integration:profiler:coverage - uses: ./.github/actions/node-crash-report if: failure() - uses: ./.github/actions/coverage diff --git a/.github/workflows/project.yml b/.github/workflows/project.yml index 0c71450eab9..d0dfbf30f87 100644 --- a/.github/workflows/project.yml +++ b/.github/workflows/project.yml @@ -92,7 +92,10 @@ jobs: - run: FILENAME=$(npm pack --silent --pack-destination /tmp) && mv /tmp/$FILENAME /tmp/dd-trace.tgz - run: rm -rf * - run: tar -zxf /tmp/dd-trace.tgz -C $(pwd) --strip-components=1 - - run: yarn --prod --ignore-optional + # `--ignore-scripts` skips the `prepare` script (`cd vendor && npm ci --include=dev`): + # the packed tarball ships pre-built `vendor/dist/**` artifacts but not + # `vendor/package-lock.json`, so a fresh consumer install can't rebuild vendor. + - run: bun install --production --omit=optional --ignore-scripts - run: ls -lisa - name: Compute module size tree and report uses: qard/heaviest-objects-in-the-universe@1e02edbdda803a45537a808ede97866db47756d3 # Unreleased @@ -189,7 +192,8 @@ jobs: if-no-files-found: error supported-integrations-push: - # See yarn-dedupe-push: skip the bot's own re-trigger after it pushes. + # The bot pushes via the GitHub API, which re-triggers `pull_request: synchronize` with + # `github.actor == 'dd-octo-sts[bot]'`. Skip that follow-up run so we don't push twice. if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && needs.supported-integrations.outputs.has_changes == 'true' && github.actor != 'dd-octo-sts[bot]' runs-on: ubuntu-latest needs: supported-integrations @@ -232,121 +236,3 @@ jobs: ] } } } }' | gh api graphql --input - >/dev/null - - yarn-dedupe: - runs-on: ubuntu-latest - permissions: - contents: read - outputs: - has_changes: ${{ steps.diff.outputs.has_changes }} - steps: - - name: Checkout code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Setup Node.js - uses: ./.github/actions/node/latest - - - name: Install dependencies - uses: ./.github/actions/install - - - name: Run yarn dependencies:dedupe - run: yarn dependencies:dedupe - - - name: Prepare yarn.lock update (same-repo PRs only; restricted paths) - id: diff - run: | - set -euo pipefail - - if git diff --quiet; then - echo "has_changes=false" >> $GITHUB_OUTPUT - exit 0 - fi - - fail_message() { cat <<'EOF' - ❌ The yarn.lock file needs deduplication! - - The yarn dedupe command has modified your yarn.lock file. - This means there were duplicate dependencies that could be optimized. - - To fix this issue: - 1. Run 'yarn dependencies:dedupe' locally - 2. Commit the updated yarn.lock file - 3. Push your changes - - This helps keep the dependency tree clean. - EOF - } - - changes="$(git diff --name-only)" - if [ "$changes" != "yarn.lock" ]; then - echo "Unexpected changed paths during yarn dedupe:" - echo "$changes" - exit 1 - fi - - # Never push updates to fork PR branches, and don't auto-fix outside PRs. - if [ "${{ github.event_name }}" != "pull_request" ]; then - fail_message - exit 1 - fi - if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then - fail_message - exit 1 - fi - - cp yarn.lock "${RUNNER_TEMP}/yarn.lock" - echo "has_changes=true" >> $GITHUB_OUTPUT - - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - if: steps.diff.outputs.has_changes == 'true' - with: - name: yarn-lock - path: ${{ runner.temp }}/yarn.lock - if-no-files-found: error - - yarn-dedupe-push: - # If this job pushes a commit, GitHub will re-trigger the workflow on `pull_request:synchronize` - # with `github.actor == 'dd-octo-sts[bot]'`. Never attempt to mint another token / push again on - # that follow-up run. - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && needs.yarn-dedupe.outputs.has_changes == 'true' && github.actor != 'dd-octo-sts[bot]' - runs-on: ubuntu-latest - needs: yarn-dedupe - # Security: this job has an STS-minted token, but never runs installs/builds. - # It only updates yarn.lock via the GitHub API. - permissions: - id-token: write - steps: - - uses: DataDog/dd-octo-sts-action@96a25462dbcb10ebf0bfd6e2ccc917d2ab235b9a # v1.0.4 - id: octo-sts - with: - scope: DataDog/dd-trace-js - policy: yarn-dedupe - - - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: yarn-lock - path: ${{ runner.temp }}/yarn-lock-artifact - - - name: Update yarn.lock via GitHub API (server-created verified commit) - env: - GH_TOKEN: ${{ steps.octo-sts.outputs.token }} - OWNER: ${{ github.repository_owner }} - REPO: ${{ github.event.repository.name }} - BRANCH: ${{ github.event.pull_request.head.ref }} - run: | - set -euo pipefail - - test -f "${{ runner.temp }}/yarn-lock-artifact/yarn.lock" - sha="$(gh api -q '.sha' "repos/${OWNER}/${REPO}/contents/yarn.lock?ref=${BRANCH}")" - base64 -w 0 "${{ runner.temp }}/yarn-lock-artifact/yarn.lock" > "${{ runner.temp }}/yarn-lock-b64.txt" - - jq -n \ - --arg message "chore: deduplicate yarn.lock" \ - --rawfile content "${{ runner.temp }}/yarn-lock-b64.txt" \ - --arg sha "$sha" \ - --arg branch "$BRANCH" \ - '{message: $message, content: $content, sha: $sha, branch: $branch}' \ - | gh api -X PUT "repos/${OWNER}/${REPO}/contents/yarn.lock" --input - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9c8b564969..e1982510690 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,12 +114,12 @@ jobs: run: | content=`cat ./package.json | tr '\n' ' '` echo "json=$content" >> $GITHUB_OUTPUT - - run: yarn + - run: bun install --frozen-lockfile - name: Build working-directory: docs run: | - yarn - yarn build + bun install --frozen-lockfile + bun run build mv out /tmp/out - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: diff --git a/.github/workflows/serverless.yml b/.github/workflows/serverless.yml index d986082bd0e..9cca144d734 100644 --- a/.github/workflows/serverless.yml +++ b/.github/workflows/serverless.yml @@ -31,13 +31,13 @@ jobs: id: dd-sts - uses: ./.github/actions/node/oldest-maintenance-lts - uses: ./.github/actions/install - - run: yarn test:lambda:ci + - run: npm run test:lambda:ci - uses: ./.github/actions/node/newest-maintenance-lts - - run: yarn test:lambda:ci + - run: npm run test:lambda:ci - uses: ./.github/actions/node/active-lts - - run: yarn test:lambda:ci + - run: npm run test:lambda:ci - uses: ./.github/actions/node/latest - - run: yarn test:lambda:ci + - run: npm run test:lambda:ci - uses: ./.github/actions/coverage with: flags: serverless-lambda @@ -114,7 +114,7 @@ jobs: with: version: ${{ matrix.node-version }} - uses: ./.github/actions/install - - run: yarn test:plugins:ci + - run: npm run test:plugins:ci - if: always() uses: ./.github/actions/testagent/logs with: diff --git a/.github/workflows/test-optimization.yml b/.github/workflows/test-optimization.yml index b650fee9f4c..6a7b9afcd52 100644 --- a/.github/workflows/test-optimization.yml +++ b/.github/workflows/test-optimization.yml @@ -32,7 +32,7 @@ jobs: token: ${{ steps.octo-sts.outputs.token }} - uses: ./.github/actions/node/oldest-maintenance-lts - name: Test Optimization Performance Overhead Test - run: yarn bench:e2e:test-optimization + run: npm run bench:e2e:test-optimization env: GITHUB_TOKEN: ${{ steps.octo-sts.outputs.token }} TEST_ENVIRONMENT_REF_TO_TEST: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} @@ -66,7 +66,7 @@ jobs: with: path: ~/.cache/ms-playwright key: playwright-browsers-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} - - run: yarn test:integration:testopt:coverage + - run: npm run test:integration:testopt:coverage - uses: ./.github/actions/coverage with: flags: test-optimization-testopt-${{ matrix.version }} @@ -164,7 +164,7 @@ jobs: # The Playwright job runs in a container where the checkout can be owned by a different UID. # Git rejects metadata commands in that checkout unless the workspace is marked as safe. run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - run: yarn test:integration:playwright:coverage + - run: npm run test:integration:playwright:coverage env: NODE_OPTIONS: "-r ./ci/init" DD_API_KEY: ${{ steps.dd-sts.outputs.api_key }} @@ -195,7 +195,7 @@ jobs: with: version: ${{ matrix.version }} - uses: ./.github/actions/install - - run: yarn test:integration:mocha:coverage + - run: npm run test:integration:mocha:coverage env: NODE_OPTIONS: "-r ./ci/init" MOCHA_VERSION: ${{ matrix.mocha-version }} @@ -231,7 +231,7 @@ jobs: with: version: ${{ matrix.version }} - uses: ./.github/actions/install - - run: yarn test:integration:jest:coverage + - run: npm run test:integration:jest:coverage env: NODE_OPTIONS: "-r ./ci/init" JEST_VERSION: ${{ matrix.jest-version }} @@ -275,7 +275,7 @@ jobs: with: version: ${{ matrix.version }} - uses: ./.github/actions/install - - run: yarn test:integration:cucumber:coverage + - run: npm run test:integration:cucumber:coverage env: NODE_OPTIONS: "-r ./ci/init" CUCUMBER_VERSION: ${{ matrix.cucumber-version }} @@ -322,7 +322,7 @@ jobs: sudo mv chromedriver-linux64/chromedriver /usr/bin/chromedriver sudo chmod +x /usr/bin/chromedriver - uses: ./.github/actions/install - - run: yarn test:integration:selenium:coverage + - run: npm run test:integration:selenium:coverage env: NODE_OPTIONS: "-r ./ci/init" DD_API_KEY: ${{ steps.dd-sts.outputs.api_key }} @@ -392,8 +392,7 @@ jobs: with: path: ~/.cache/Cypress key: cypress-binary-${{ matrix.cypress-version }} - - run: yarn config set ignore-engines true - - run: yarn test:integration:cypress:coverage --ignore-engines + - run: npm run test:integration:cypress:coverage env: CYPRESS_VERSION: ${{ matrix.cypress-version }} NODE_OPTIONS: "-r ./ci/init" @@ -431,7 +430,7 @@ jobs: with: version: ${{ matrix.version }} - uses: ./.github/actions/install - - run: yarn test:integration:vitest:coverage + - run: npm run test:integration:vitest:coverage env: NODE_OPTIONS: "-r ./ci/init" SPEC: ${{ matrix.spec }} diff --git a/.github/workflows/update-3rdparty-licenses.yml b/.github/workflows/update-3rdparty-licenses.yml index 0af3f502530..d174213b61a 100644 --- a/.github/workflows/update-3rdparty-licenses.yml +++ b/.github/workflows/update-3rdparty-licenses.yml @@ -1,11 +1,20 @@ name: Update 3rd-party licenses +# `dd-license-attribution` does not yet read `bun.lock`; the project ships only +# `bun.lock` at the root, so the upstream auto-update tool drops every root +# runtime/optional dep on each run. `scripts/generate-3rdparty-licenses.js` +# regenerates `LICENSE-3rdparty.csv` from `bun.lock`, +# `vendor/package-lock.json`, `.github/vendored-dependencies.csv`, and the npm +# registry instead. `scripts/check_licenses.js` (run via `npm run lint`) +# enforces row-level completeness on every PR; this workflow auto-commits the +# regenerated file for bot PRs and surfaces a clear error otherwise. + on: pull_request: paths: - ".github/vendored-dependencies.csv" - "vendor/package-lock.json" - - "yarn.lock" + - "bun.lock" jobs: check-licenses: @@ -16,60 +25,13 @@ jobs: needs_update: ${{ steps.check.outputs.needs_update }} is_bot_same_repo: ${{ steps.check.outputs.is_bot_same_repo }} head_oid: ${{ steps.check.outputs.head_oid }} - env: - REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }} steps: - - name: Check out PR branch - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: "3.14" - - - name: Check out dd-license-attribution - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: watson/dd-license-attribution - ref: 8ea483b9f735bf8da632c89796789cc2a050a9a6 - path: dd-license-attribution + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Install dd-license-attribution - working-directory: dd-license-attribution - run: | - pip install . - - - name: Create mirrors.json for PR branch - env: - DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} - HEAD_REF: ${{ github.head_ref }} - run: | - cat > mirrors.json < LICENSE-3rdparty.csv - - - name: Append vendored dependencies from PR - run: | - cat .github/vendored-dependencies.csv >> LICENSE-3rdparty.csv + run: node scripts/generate-3rdparty-licenses.js - name: Check for LICENSE-3rdparty.csv changes id: check @@ -79,14 +41,13 @@ jobs: BASE_REPO: ${{ github.repository }} run: | set -e - echo "head_oid=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT if git diff --ignore-space-at-eol --exit-code LICENSE-3rdparty.csv; then echo "✅ LICENSE-3rdparty.csv is already up to date" echo "needs_update=false" >> $GITHUB_OUTPUT else - echo "📝 LICENSE-3rdparty.csv was modified by license attribution command" + echo "📝 LICENSE-3rdparty.csv was modified by the regen script" echo "needs_update=true" >> $GITHUB_OUTPUT fi @@ -109,22 +70,7 @@ jobs: run: | echo "❌ The LICENSE-3rdparty.csv file needs to be updated!" echo "" - echo "The license attribution command has modified LICENSE-3rdparty.csv." - echo "" - echo "To fix this issue:" - echo "1. Set up dd-license-attribution locally by following the installation instructions in:" - echo " https://github.com/DataDog/dd-license-attribution" - echo "2. Run the license CSV generation command locally:" - echo " dd-license-attribution generate-sbom-csv \\" - echo " --no-scancode-strategy \\" - echo " --no-github-sbom-strategy \\" - echo " https://github.com/datadog/dd-trace-js > LICENSE-3rdparty.csv" - echo "3. Append vendored dependencies:" - echo " cat .github/vendored-dependencies.csv >> LICENSE-3rdparty.csv" - echo "4. Commit the updated LICENSE-3rdparty.csv file" - echo "5. Push your changes" - echo "" - echo "This helps keep the 3rd-party license information accurate." + echo "Run 'node scripts/generate-3rdparty-licenses.js' locally and commit the result." exit 1 auto-commit-licenses: diff --git a/.gitignore b/.gitignore index a16e3f9249f..9acf8c2f3f4 100644 --- a/.gitignore +++ b/.gitignore @@ -34,8 +34,6 @@ logs *.log node-*-junit.xml npm-debug.log* -yarn-debug.log* -yarn-error.log* # Runtime data pids @@ -86,9 +84,6 @@ typings/ # Output of 'npm pack' *.tgz -# Yarn Integrity file -.yarn-integrity - # Output of tap .tap/* @@ -110,11 +105,10 @@ node-*-junit.xml # End of https://www.gitignore.io/api/node,macos,visualstudiocode -/versions +/versions/* +!/versions/bunfig.toml .bun .next -bun.lock -bun.lockb package-lock.json out build @@ -137,6 +131,7 @@ packages/dd-trace/test/plugins/versions/yarn.lock packages/datadog-plugin-azure-functions/test/integration-test/fixtures/node_modules !vendor/package-lock.json !benchmark/sirun/startup/everything-fixture/package-lock.json +!.github/actions/datadog-ci/package-lock.json vendor.patch __azurite_db_queue__.json __azurite_db_queue_extent__.json diff --git a/.gitlab/benchmarks.yml b/.gitlab/benchmarks.yml index 9e4ec5bb122..806fd9752ea 100644 --- a/.gitlab/benchmarks.yml +++ b/.gitlab/benchmarks.yml @@ -19,6 +19,19 @@ variables: interruptible: false - interruptible: true timeout: 30m # TODO: Reduce this once GitLab CI runner availability improves + before_script: + # The benchmarking-platform image is rebuilt from master and does not yet + # ship bun. Every dev-tooling install path (the root `bun install`, the + # `npm run services` plugin sandbox setup, sirun's `runall.sh` bun fallback) + # needs `bun` on `PATH`, so install it here. The official installer + # downloads a `.zip`, so make sure `unzip` is present before the curl|bash + # — Ubuntu's stock image does not include it. Drop this block once the + # image bakes bun in. + - if ! command -v bun >/dev/null 2>&1; then + command -v unzip >/dev/null 2>&1 || (apt-get update >/dev/null && apt-get install -y --no-install-recommends unzip); + curl -fsSL https://bun.sh/install | bash || (sleep 60 && curl -fsSL https://bun.sh/install | bash); + fi + - export PATH="$HOME/.bun/bin:$PATH" script: - git clone --branch dd-trace-js https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform && cd platform - bp-runner bp-runner.yml --debug diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100644 index 3d45fd49463..00000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -if [ ! -e "node_modules/.bin/yarn-deduplicate" ]; then - echo "yarn-deduplicate is not installed. Run 'yarn install' (with devDependencies) and try again." - exit 1 -fi - -yarn dependencies:dedupe -git add yarn.lock diff --git a/.yarnrc b/.yarnrc deleted file mode 100644 index 31a4f99e020..00000000000 --- a/.yarnrc +++ /dev/null @@ -1,2 +0,0 @@ -ignore-engines true -network-timeout 60000 diff --git a/AGENTS.md b/AGENTS.md index 7ab7c7db235..1094be52c14 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -3,20 +3,17 @@ ## Prerequisites - Node.js >= 18 -- yarn 1.x +- bun ~1.3.13 (matches `engines.bun` in `package.json`) - Docker + docker-compose (for running service dependencies in tests) ## Setup **Package manager policy:** -- Use **yarn only for installing dependencies and services**: - - `yarn add` - - `yarn install` - - `yarn services` -- Use **npm for running scripts and other commands**: `npm run