Skip to content

vendor on npm prepare instead of committing to git#7423

Merged
BridgeAR merged 15 commits intomasterfrom
vendor-on-prepare
Feb 27, 2026
Merged

vendor on npm prepare instead of committing to git#7423
BridgeAR merged 15 commits intomasterfrom
vendor-on-prepare

Conversation

@rochdev
Copy link
Copy Markdown
Member

@rochdev rochdev commented Feb 4, 2026

Please make sure your changes are properly tested!

What does this PR do?

Vendor on npm prepare instead of committing to git.

Motivation

The choice to commit vendored dependencies was to get slightly better install times locally and in CI, and being able to install from git regardless of package manager. However, these are very small benefits, and the complexity of our CI automation has exploded because of the need to automatically re-vendor after the automation. It also has the downside that every time we touch the bundler config there are dozens of files changed every time. At this point I don't think the trade-offs are worth it to keep the files in git. Vendoring on prepare makes everything much simpler.

Additional Notes

Only the files outside of vendor/dist need review, everything else is just the dist folder being deleted.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.32%. Comparing base (d5e899b) to head (83cf0ea).
⚠️ Report is 102 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7423      +/-   ##
==========================================
- Coverage   80.42%   80.32%   -0.10%     
==========================================
  Files         732      734       +2     
  Lines       31055    31602     +547     
==========================================
+ Hits        24975    25384     +409     
- Misses       6080     6218     +138     
Flag Coverage Δ
aiguard-macos 38.80% <ø> (-0.38%) ⬇️
aiguard-ubuntu 38.93% <ø> (-0.30%) ⬇️
aiguard-windows 38.66% <ø> (-0.42%) ⬇️
apm-capabilities-tracing-macos 48.54% <ø> (-0.37%) ⬇️
apm-capabilities-tracing-ubuntu 48.57% <ø> (-0.33%) ⬇️
apm-capabilities-tracing-windows 48.27% <ø> (-0.36%) ⬇️
apm-integrations-child-process 38.38% <ø> (-0.30%) ⬇️
apm-integrations-couchbase-18 37.16% <ø> (-0.27%) ⬇️
apm-integrations-couchbase-eol 37.63% <ø> (-0.43%) ⬇️
apm-integrations-oracledb 37.62% <ø> (-0.48%) ⬇️
appsec-express 55.39% <ø> (-0.05%) ⬇️
appsec-fastify 51.72% <ø> (-0.35%) ⬇️
appsec-graphql 51.91% <ø> (-0.48%) ⬇️
appsec-kafka 44.34% <ø> (-0.39%) ⬇️
appsec-ldapjs 43.97% <ø> (-0.43%) ⬇️
appsec-lodash 43.66% <ø> (-0.41%) ⬇️
appsec-macos 58.47% <ø> (-0.08%) ⬇️
appsec-mongodb-core 48.83% <ø> (-0.44%) ⬇️
appsec-mongoose 49.50% <ø> (-0.46%) ⬇️
appsec-mysql 50.89% <ø> (-0.45%) ⬇️
appsec-node-serialize 43.17% <ø> (-0.41%) ⬇️
appsec-passport 47.64% <ø> (-0.55%) ⬇️
appsec-postgres 50.65% <ø> (-0.48%) ⬇️
appsec-sourcing 42.53% <ø> (-0.40%) ⬇️
appsec-template 43.34% <ø> (-0.42%) ⬇️
appsec-ubuntu 58.55% <ø> (-0.03%) ⬇️
appsec-windows 58.33% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-bluebird 32.10% <ø> (-0.25%) ⬇️
instrumentations-instrumentation-body-parser 40.39% <ø> (-0.44%) ⬇️
instrumentations-instrumentation-child_process 37.70% <ø> (-0.29%) ⬇️
instrumentations-instrumentation-cookie-parser 34.14% <ø> (-0.46%) ⬇️
instrumentations-instrumentation-express 34.48% <ø> (-0.47%) ⬇️
instrumentations-instrumentation-express-mongo-sanitize 34.28% <ø> (-0.47%) ⬇️
instrumentations-instrumentation-express-session 40.02% <ø> (-0.50%) ⬇️
instrumentations-instrumentation-fs 31.71% <ø> (-0.25%) ⬇️
instrumentations-instrumentation-generic-pool 29.54% <ø> (-0.28%) ⬇️
instrumentations-instrumentation-http 39.73% <ø> (+<0.01%) ⬆️
instrumentations-instrumentation-knex 32.11% <ø> (-0.25%) ⬇️
instrumentations-instrumentation-mongoose 33.28% <ø> (-0.44%) ⬇️
instrumentations-instrumentation-multer 40.13% <ø> (-0.43%) ⬇️
instrumentations-instrumentation-mysql2 38.17% <ø> (-0.20%) ⬇️
instrumentations-instrumentation-passport 43.97% <ø> (+3.10%) ⬆️
instrumentations-instrumentation-passport-http 43.63% <ø> (+2.79%) ⬆️
instrumentations-instrumentation-passport-local 44.18% <ø> (+3.34%) ⬆️
instrumentations-instrumentation-pg 37.59% <ø> (-0.30%) ⬇️
instrumentations-instrumentation-promise 32.03% <ø> (-0.25%) ⬇️
instrumentations-instrumentation-promise-js 32.04% <ø> (-0.25%) ⬇️
instrumentations-instrumentation-q 32.08% <ø> (-0.25%) ⬇️
instrumentations-instrumentation-url 32.00% <ø> (-0.25%) ⬇️
instrumentations-instrumentation-when 32.05% <ø> (-0.25%) ⬇️
llmobs-ai 41.21% <ø> (-0.30%) ⬇️
llmobs-anthropic 40.20% <ø> (-0.52%) ⬇️
llmobs-bedrock 39.15% <ø> (-0.45%) ⬇️
llmobs-google-genai 39.73% <ø> (-0.47%) ⬇️
llmobs-langchain 39.43% <ø> (-0.31%) ⬇️
llmobs-openai 44.01% <ø> (-0.57%) ⬇️
llmobs-vertex-ai 39.92% <ø> (-0.51%) ⬇️
platform-core 29.71% <ø> (+1.62%) ⬆️
platform-esbuild 32.89% <ø> (+1.40%) ⬆️
platform-instrumentations-misc 42.88% <ø> (+3.26%) ⬆️
platform-shimmer 36.14% <ø> (+1.31%) ⬆️
platform-unit-guardrails 31.27% <ø> (+0.89%) ⬆️
plugins-azure-event-hubs 24.02% <ø> (+1.38%) ⬆️
plugins-azure-service-bus 23.42% <ø> (+1.34%) ⬆️
plugins-bullmq 43.66% <ø> (-0.01%) ⬇️
plugins-cassandra 37.66% <ø> (-0.48%) ⬇️
plugins-cookie 25.08% <ø> (+1.38%) ⬆️
plugins-cookie-parser 24.87% <ø> (+1.37%) ⬆️
plugins-crypto 24.72% <ø> (+1.83%) ⬆️
plugins-dd-trace-api 38.24% <ø> (-0.29%) ⬇️
plugins-express-mongo-sanitize 25.04% <ø> (+1.36%) ⬆️
plugins-express-session 24.83% <ø> (+1.37%) ⬆️
plugins-fastify 42.15% <ø> (-0.48%) ⬇️
plugins-fetch 38.21% <ø> (-0.49%) ⬇️
plugins-fs 38.48% <ø> (-0.29%) ⬇️
plugins-generic-pool 24.06% <ø> (+1.38%) ⬆️
plugins-google-cloud-pubsub 45.33% <ø> (-0.50%) ⬇️
plugins-grpc 40.85% <ø> (-0.54%) ⬇️
plugins-handlebars 25.08% <ø> (+1.36%) ⬆️
plugins-hapi 40.02% <ø> (-0.51%) ⬇️
plugins-hono 40.29% <ø> (-0.44%) ⬇️
plugins-ioredis 38.29% <ø> (-0.29%) ⬇️
plugins-knex 24.80% <ø> (+1.29%) ⬆️
plugins-ldapjs 22.61% <ø> (+1.33%) ⬆️
plugins-light-my-request 24.48% <ø> (+1.33%) ⬆️
plugins-limitd-client 32.40% <ø> (-0.26%) ⬇️
plugins-lodash 24.13% <ø> (+1.39%) ⬆️
plugins-mariadb 39.37% <ø> (-0.34%) ⬇️
plugins-memcached 38.03% <ø> (-0.28%) ⬇️
plugins-microgateway-core 39.05% <ø> (-0.49%) ⬇️
plugins-moleculer 40.41% <ø> (-0.54%) ⬇️
plugins-mongodb 39.08% <ø> (-0.57%) ⬇️
plugins-mongodb-core 38.91% <ø> (-0.32%) ⬇️
plugins-mongoose 38.74% <ø> (-0.55%) ⬇️
plugins-multer 24.83% <ø> (+1.37%) ⬆️
plugins-mysql 39.04% <ø> (-0.29%) ⬇️
plugins-mysql2 39.15% <ø> (-0.26%) ⬇️
plugins-node-serialize 25.12% <ø> (+1.38%) ⬆️
plugins-opensearch 37.49% <ø> (-0.49%) ⬇️
plugins-passport-http 24.91% <ø> (+1.35%) ⬆️
plugins-postgres 35.60% <ø> (-0.20%) ⬇️
plugins-process 24.72% <ø> (+1.83%) ⬆️
plugins-pug 25.08% <ø> (+1.38%) ⬆️
plugins-redis 38.77% <ø> (-0.13%) ⬇️
plugins-router 42.89% <ø> (-0.45%) ⬇️
plugins-sequelize 23.66% <ø> (+1.38%) ⬆️
plugins-test-and-upstream-amqp10 38.21% <ø> (-0.43%) ⬇️
plugins-test-and-upstream-amqplib 43.60% <ø> (-0.40%) ⬇️
plugins-test-and-upstream-apollo 38.92% <ø> (-0.50%) ⬇️
plugins-test-and-upstream-avsc 38.58% <ø> (-0.34%) ⬇️
plugins-test-and-upstream-bunyan 33.69% <ø> (-0.28%) ⬇️
plugins-test-and-upstream-connect 40.69% <ø> (-0.46%) ⬇️
plugins-test-and-upstream-graphql 40.03% <ø> (-0.30%) ⬇️
plugins-test-and-upstream-koa 40.27% <ø> (-0.52%) ⬇️
plugins-test-and-upstream-protobufjs 38.81% <ø> (-0.35%) ⬇️
plugins-test-and-upstream-rhea 43.96% <ø> (-0.33%) ⬇️
plugins-undici 39.00% <ø> (-0.49%) ⬇️
plugins-url 24.72% <ø> (+1.83%) ⬆️
plugins-valkey 37.92% <ø> (-0.28%) ⬇️
plugins-vm 24.72% <ø> (+1.83%) ⬆️
plugins-winston 33.90% <ø> (-0.47%) ⬇️
plugins-ws 41.79% <ø> (+0.93%) ⬆️
profiling-macos 39.72% <ø> (-0.45%) ⬇️
profiling-ubuntu 39.85% <ø> (-0.37%) ⬇️
profiling-windows 41.07% <ø> (-0.50%) ⬇️
serverless-azure-functions-client 23.75% <ø> (+1.37%) ⬆️
serverless-azure-functions-eventhubs 23.75% <ø> (+1.37%) ⬆️
serverless-azure-functions-servicebus 23.75% <ø> (+1.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Feb 4, 2026

Benchmarks

Benchmark execution time: 2026-02-25 10:35:19

Comparing candidate commit 83cf0ea in PR branch vendor-on-prepare with baseline commit d5e899b in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 232 metrics, 28 unstable metrics.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

Overall package size

Self size: 4.77 MB
Deduped: 5.62 MB
No deduping: 5.62 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 816.75 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 bot commented Feb 4, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 83cf0ea | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@rochdev rochdev force-pushed the vendor-on-prepare branch 4 times, most recently from f2d0c36 to cebc30d Compare February 4, 2026 21:35
@rochdev rochdev marked this pull request as ready for review February 4, 2026 22:17
@rochdev rochdev requested review from a team as code owners February 4, 2026 22:17
watson
watson previously requested changes Feb 5, 2026
Copy link
Copy Markdown
Collaborator

@watson watson left a comment

Choose a reason for hiding this comment

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

I see we have a problem in .github/workflows/update-3rdparty-licenses.yml that it only triggers on updates to the root yarn.lock. This means it didn't trigger on this PR. We need to make sure that it also triggers on changes to the new vendor/package-lock.json. Can you make a change to the action, so it runs here as well? And now that you're at it, could you make sure it also triggers on changes to .github/vendored-dependencies.csv?

Copy link
Copy Markdown
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

The license script is now not picking up the vendored dependencies anymore. We should include those though.

@rochdev
Copy link
Copy Markdown
Member Author

rochdev commented Feb 6, 2026

The license script is now not picking up the vendored dependencies anymore. We should include those though.

cc @watson

@watson
Copy link
Copy Markdown
Collaborator

watson commented Feb 10, 2026

I think when I added support for multiple yarn.lock files in the same repo, I didn't also add support for multiple package-lock.json files. That needs to be added first. I'll look into it

@rochdev
Copy link
Copy Markdown
Member Author

rochdev commented Feb 10, 2026

I think when I added support for multiple yarn.lock files in the same repo, I didn't also add support for multiple package-lock.json files. That needs to be added first. I'll look into it

Since we do effectively the same work in JS for the validation, would it make sense to just generate it locally instead? Why do we need a separate project in Python to handle this?

@watson
Copy link
Copy Markdown
Collaborator

watson commented Feb 11, 2026

Since we do effectively the same work in JS for the validation, would it make sense to just generate it locally instead? Why do we need a separate project in Python to handle this?

Hmm good question. The pro for using the Python project, is that all Datadog repos use it, so it's guaranteed to follow our official requirements, any improvement or change in behavior in it benefit us all. You could reverse the question and ask if we should keep maintaining our own js-variant. I've already implemented support for package-lock.json, but just need to finish updating the tests and then I'll make a PR. Hopefully it's not a common occurrence that we change lock file formats 😅

Additionally, our own JS-variant will need significant updates to do the same work that the Python tool currently does. As far as I know, our JS-variant only validates that a dependency exists - it doesn't fetch license info from GitHub and npm.

@BridgeAR
Copy link
Copy Markdown
Member

I actually agree that having a unified tool is best. That way everyone always benefits most. We should just remove our JS variation in that case.

@rochdev
Copy link
Copy Markdown
Member Author

rochdev commented Feb 19, 2026

@watson Updated with your branch and it seems to work now. Thanks for the assist unblocking this PR!

Copy link
Copy Markdown
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

Almost LGTM. I left a few questions how to handle silent and reproducing test cases as users would face it.

- uses: ./.github/actions/node/active-lts
- run: FILENAME=$(npm pack --pack-destination /tmp) && mv /tmp/$FILENAME /tmp/dd-trace.tgz
- uses: ./.github/actions/install
- run: FILENAME=$(npm pack --silent --pack-destination /tmp) && mv /tmp/$FILENAME /tmp/dd-trace.tgz
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we not keep the output to know what happened? The same about other jobs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The output is used as input to the next task. Also, this was already not the case before.

Co-authored-by: Ruben Bridgewater <[email protected]>
@rochdev
Copy link
Copy Markdown
Member Author

rochdev commented Feb 25, 2026

@watson Any further concerns now that 3rd party dependencies are fixed?

@BridgeAR BridgeAR enabled auto-merge (squash) February 27, 2026 17:34
@BridgeAR BridgeAR dismissed watson’s stale review February 27, 2026 17:44

Dismissing to unblock releasing (the update script is currently blocked and this will likely resolve the problem). All blocking aspects should be resolved.

@BridgeAR BridgeAR merged commit 2608ddb into master Feb 27, 2026
790 checks passed
@BridgeAR BridgeAR deleted the vendor-on-prepare branch February 27, 2026 17:44
dd-octo-sts bot pushed a commit that referenced this pull request Feb 27, 2026
* remove vendor dist folder

* switch to npm for vendoring

* update license attribution script
@dd-octo-sts dd-octo-sts bot mentioned this pull request Feb 27, 2026
watson added a commit that referenced this pull request Mar 2, 2026
BridgeAR pushed a commit that referenced this pull request Mar 2, 2026
)"

This reverts commit 2608ddb.

System tests failed: DataDog/system-tests/actions/runs/22501109173/job/65191588666?pr=6394
watson added a commit that referenced this pull request Mar 2, 2026
dd-octo-sts bot pushed a commit that referenced this pull request Mar 3, 2026
juan-fernandez pushed a commit that referenced this pull request Mar 5, 2026
* remove vendor dist folder

* switch to npm for vendoring

* update license attribution script
juan-fernandez pushed a commit that referenced this pull request Mar 5, 2026
rochdev added a commit that referenced this pull request Mar 16, 2026
rochdev added a commit that referenced this pull request Mar 17, 2026
#7789)

* Revert "Revert "chore: vendor on npm prepare instead of committing to git (#7423)" (#7638)"
dd-octo-sts bot pushed a commit that referenced this pull request Mar 17, 2026
#7789)

* Revert "Revert "chore: vendor on npm prepare instead of committing to git (#7423)" (#7638)"
juan-fernandez pushed a commit that referenced this pull request Mar 18, 2026
#7789)

* Revert "Revert "chore: vendor on npm prepare instead of committing to git (#7423)" (#7638)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants