Skip to content

Commit ffa3de4

Browse files
authored
vendor bundled non-datadog dependencies (#6958)
1 parent 519137b commit ffa3de4

File tree

143 files changed

+4626
-523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+4626
-523
lines changed

.github/chainguard/dependabot-automation.sts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ issuer: https://token.actions.githubusercontent.com
33
subject: repo:DataDog/dd-trace-js:pull_request
44

55
claim_pattern:
6-
event_name: pull_request_target
6+
event_name: pull_request
77
ref: refs/heads/master
88
ref_protected: "true"
99
job_workflow_ref: DataDog/dd-trace-js/.github/workflows/dependabot-automation.yml@refs/heads/master

.github/dependabot.yml

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,6 @@ updates:
6060
- dependency-name: "@types/node"
6161
# Update the types manually with new Node.js version support
6262
update-types: ["version-update:semver-major"]
63-
- dependency-name: "jest-docblock"
64-
# 30.0.0 onwards only supports Node.js 18.14.x and above
65-
update-types: ["version-update:semver-major"]
66-
# The path-to-regexp version has to be the same as used in express v4.
67-
# Consider vendoring it instead.
68-
- dependency-name: "path-to-regexp"
69-
- dependency-name: "lru-cache"
70-
# 11.0.0 onwards only supports Node.js 20 and above
71-
update-types: ["version-update:semver-major"]
72-
- dependency-name: "limiter"
73-
# 2.0.0 onwards breaks our tests. 3.0.0 works but it requires Node.js v16.
74-
# That breaks cypress in our v5 release line. Update when v5 is EOL.
75-
# Reverting this commit should suffice.
76-
update-types: ["version-update:semver-major"]
7763
- dependency-name: "glob"
7864
# 11.0.0 onwards only supports Node.js 20 and above
7965
update-types: ["version-update:semver-major"]
@@ -87,6 +73,9 @@ updates:
8773
# Thus, we ignore them and update them manually.
8874
- dependency-name: "@opentelemetry/api"
8975
- dependency-name: "@opentelemetry/api-logs"
76+
- dependency-name: "tap"
77+
# Contain breaking changes that are incompatible with our test usage
78+
update-types: ["version-update:semver-major"]
9079
groups:
9180
dev-minor-and-patch-dependencies:
9281
dependency-type: "development"
@@ -103,6 +92,49 @@ updates:
10392
- "minor"
10493
- "patch"
10594

95+
# Vendored dependencies
96+
- package-ecosystem: "npm"
97+
directories:
98+
- "/vendor"
99+
schedule:
100+
interval: "weekly"
101+
open-pull-requests-limit: 100
102+
cooldown:
103+
default-days: 5
104+
labels:
105+
- dependabot
106+
- dependencies
107+
- javascript
108+
- semver-patch
109+
ignore:
110+
- dependency-name: "jest-docblock"
111+
# 30.0.0 onwards only supports Node.js 18.14.x and above
112+
update-types: ["version-update:semver-major"]
113+
# The path-to-regexp version has to be the same as used in express v4.
114+
- dependency-name: "path-to-regexp"
115+
- dependency-name: "lru-cache"
116+
# 11.0.0 onwards only supports Node.js 20 and above
117+
update-types: ["version-update:semver-major"]
118+
- dependency-name: "limiter"
119+
# 2.0.0 onwards breaks our tests. 3.0.0 works but it requires Node.js v16.
120+
# That breaks cypress in our v5 release line. Update when v5 is EOL.
121+
# Reverting this commit should suffice.
122+
update-types: ["version-update:semver-major"]
123+
- dependency-name: "@opentelemetry/core"
124+
# 2.0.0 onwards only supports Node.js 18.19.0 and above
125+
update-types: ["version-update:semver-major"]
126+
- dependency-name: "@opentelemetry/resources"
127+
# 2.0.0 onwards only supports Node.js 18.19.0 and above
128+
update-types: ["version-update:semver-major"]
129+
groups:
130+
vendor-minor-and-patch-dependencies:
131+
dependency-type: "production"
132+
patterns:
133+
- "*"
134+
update-types:
135+
- "minor"
136+
- "patch"
137+
106138
# Instrumented library support range
107139
- package-ecosystem: "npm"
108140
directories:

.github/workflows/audit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ jobs:
1616
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1717
- uses: ./.github/actions/node/latest
1818
- run: yarn audit
19+
- run: yarn audit
20+
working-directory: ./vendor

.github/workflows/dependabot-automation.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: 'Dependabot Automation'
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
types:
66
- opened
77

@@ -37,3 +37,36 @@ jobs:
3737
env:
3838
PR_URL: ${{ github.event.pull_request.html_url }}
3939
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
40+
41+
vendor:
42+
if: github.event.pull_request.user.login == 'dependabot[bot]'
43+
runs-on: ubuntu-latest
44+
permissions:
45+
id-token: write
46+
contents: write
47+
steps:
48+
- name: Dependabot metadata
49+
id: metadata
50+
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # 2.4.0
51+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
52+
if: steps.metadata.outputs.dependency-group == 'vendor-minor-and-patch-dependencies'
53+
- run: yarn
54+
working-directory: ./vendor
55+
if: steps.metadata.outputs.dependency-group == 'vendor-minor-and-patch-dependencies'
56+
- name: Create commits
57+
id: create-commits
58+
run: |
59+
git config user.name github-actions
60+
git config user.email github-actions@github.com
61+
git add -A
62+
git commit -m "update vendored dependencies with new versions"
63+
64+
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
65+
if: steps.metadata.outputs.dependency-group == 'vendor-minor-and-patch-dependencies'
66+
- name: Push commits
67+
uses: DataDog/commit-headless@5a0f3876e0fbdd3a86b3e008acf4ec562db59eee # action/v2.0.1
68+
with:
69+
branch: ${{ github.ref_name }}
70+
command: push
71+
commits: "${{ steps.create-commits.outputs.commits }}"
72+
if: steps.metadata.outputs.dependency-group == 'vendor-minor-and-patch-dependencies'

.github/workflows/platform.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ jobs:
6060
- run: ./node_modules/.bin/bun pm pack --gzip-level 0 --filename bun.tgz && tar -zxf bun.tgz -C bun
6161
- run: diff -r npm bun
6262

63+
bundle-validate:
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
67+
- uses: ./.github/actions/node/active-lts
68+
# Running `yarn` also automatically runs `rspack` as a postinstall script.
69+
- run: yarn --frozen-lockfile
70+
working-directory: vendor
71+
- run: git diff --exit-code
72+
6373
core:
6474
runs-on: ubuntu-latest
6575
steps:

.github/workflows/project.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,22 @@ jobs:
5151
- uses: ./.github/actions/install
5252
- run: npm run lint
5353

54+
# The package size is especially useful in constrained environments, so the
55+
# computation is done only on the package that would be installed there.
56+
# In order to do that, the current folder is wiped and replaced with what
57+
# would be installed is those environments before running the computation.
5458
package-size-report:
5559
runs-on: ubuntu-latest
5660
permissions:
5761
pull-requests: write
5862
steps:
5963
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
6064
- uses: ./.github/actions/node/latest
61-
- uses: ./.github/actions/install
65+
- run: FILENAME=$(npm pack --pack-destination /tmp) && mv /tmp/$FILENAME /tmp/dd-trace.tgz
66+
- run: rm -rf *
67+
- run: tar -zxf /tmp/dd-trace.tgz -C $(pwd) --strip-components=1
68+
- run: yarn --prod --ignore-optional
69+
- run: ls -lisa
6270
- name: Compute module size tree and report
6371
uses: qard/heaviest-objects-in-the-universe@1e02edbdda803a45537a808ede97866db47756d3 # Unreleased
6472
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ packages/dd-trace/test/plugins/versions/node_modules
131131
packages/dd-trace/test/plugins/versions/yarn.lock
132132
!packages/dd-trace/**/telemetry/logs
133133
packages/datadog-plugin-azure-functions/test/integration-test/fixtures/node_modules
134+
!packages/node_modules
134135
__azurite_db_queue__.json
135136
__azurite_db_queue_extent__.json
136137
__queuestorage__/AzuriteConfig

0 commit comments

Comments
 (0)