-
Notifications
You must be signed in to change notification settings - Fork 617
refactor: hoist all devDeps to root #3032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
refactor: hoist all devDeps to root #3032
Conversation
3056842 to
804aa71
Compare
🤔 We say we support Active and Maintenance LTS versions of Node, and Node 18 is officially end of life. So it might be fine in Contrib to drop support for 18. That's a bigger discussion though (cc @open-telemetry/javascript-maintainers ) and we'll need to update docs too. |
@overbalance I don't think those EBADENGINE warnings are blocking for this PR. We already have a number of those warnings in the current state. Unfortunately an EBADENGINE warning will matter for some deps, but not for some deps that are just for testing. For example this one: That dep is used by tedious@17: which is a test dep. We intentionally install a recent-ish major version of |
46672a0 to
6ac6dbd
Compare
|
@trentm Those warnings are blocking CI from what I see. What do you recommend? |
I don't know what is going on. I can This CI step failed with a network error: https://github.com/open-telemetry/opentelemetry-js-contrib/actions/runs/18537223726/job/53057847496?pr=3032 The other test jobs are stuck in The Ideas on what this could be:
|
99cc06d to
324495b
Compare
469663e to
9cb3aef
Compare
... because we are seeing hangs in `npm ci` on #3032.
6fce51c to
6e7f06f
Compare
|
@trentm I repaired the lockfile and this is finally 🟢. Thanks for your help. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple smaller Qs left.
| "peerDependencies": { | ||
| "@opentelemetry/api": "^1.3.0" | ||
| "@opentelemetry/api": "^1.3.0", | ||
| "redis": "^5.6.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the move of this from devDependencies to peerDependencies accidental?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is intentional. I think someone else asked about this in this PR. (I know there's too much noise to see it now.) Leaving Redis in devDeps was causing TAV to fail. Would you like me to reconfirm on a new branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think someone else asked
I feel it was likely me that asked that before and that I said I'd try to figure out why it is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't acceptable to add redis as a peerDep, because it'll result in installing that particular redis when a user attempts to install the instrumentation:
% cd .../packages/instrumentation-redis
% npm pack
...
opentelemetry-instrumentation-redis-0.56.0.tgz
% cp opentelemetry-instrumentation-redis-0.56.0.tgz ~/tmp/asdf/
Then in a play/clean npm package in "~/tmp/asdf":
% npm install ./opentelemetry-instrumentation-redis-0.56.0.tgz
% cat package.json
{
...
"dependencies": {
"@opentelemetry/instrumentation-redis": "file:opentelemetry-instrumentation-redis-0.56.0.tgz"
}
}
% npm ls -a
[email protected] /Users/trentm/tmp/asdf
└─┬ @opentelemetry/[email protected]
├── @opentelemetry/[email protected]
├─┬ @opentelemetry/[email protected]
│ ├─┬ @opentelemetry/[email protected]
│ │ └── @opentelemetry/[email protected] deduped
│ ├── @opentelemetry/[email protected] deduped
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected] deduped
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ └─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected] deduped
├── @opentelemetry/[email protected]
├── @opentelemetry/[email protected]
└─┬ [email protected]
├─┬ @redis/[email protected]
│ └── @redis/[email protected] deduped
├─┬ @redis/[email protected]
│ └── [email protected]
├─┬ @redis/[email protected]
│ └── @redis/[email protected] deduped
├─┬ @redis/[email protected]
│ └── @redis/[email protected] deduped
└─┬ @redis/[email protected]
└── @redis/[email protected] dedupedI'll see if I can find the TAV issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll see if I can find the TAV issue.
TAV passes for me locally (on macOS, node v20.19.1) after I apply this change to move the "redis" dep back to "devDependencies", and run npm i to update package-lock.json:
diff --git a/packages/instrumentation-redis/package.json b/packages/instrumentation-redis/package.json
index 068654d0..a8912441 100644
--- a/packages/instrumentation-redis/package.json
+++ b/packages/instrumentation-redis/package.json
@@ -48,15 +48,15 @@
"access": "public"
},
"peerDependencies": {
- "@opentelemetry/api": "^1.3.0",
- "redis": "^5.6.0"
+ "@opentelemetry/api": "^1.3.0"
},
"devDependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/context-async-hooks": "^2.0.0",
"@opentelemetry/contrib-test-utils": "^0.54.0",
"@opentelemetry/sdk-trace-base": "^2.0.0",
- "@opentelemetry/sdk-trace-node": "^2.0.0"
+ "@opentelemetry/sdk-trace-node": "^2.0.0",
+ "redis": "^5.6.0"
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.207.0",Then to run TAV tests I did:
cd packages/instrumentation-redis
npm run test-services:start
npm run test-all-versions:with-services-env
So I'm hoping we can just make that change. Whatever the thing is that you hit is hopefully gone now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is my patch to your feature branch: https://gist.github.com/trentm/c415da5938e4ddf81aea9a7670bd4118
Unless I'm missing something, I don't have perms to push to your branch:
% git push embrace-io overbalance/hoist-all-shared-deps
ERROR: Permission to embrace-io/opentelemetry-js-contrib.git denied to trentm.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.e8586e6 to
221a5ef
Compare
79da445 to
57d2922
Compare
Unhelpful npm rantI want to try to care about reviewing package-lock changes, but ... npm, I don't even. This latest update:
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
- "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",So basically those fields are just useless noise from npm in lock files. What a waste. The package-lock.json tooling design is ...poor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has the "package-lock has lost all the platform-specific optionalDependencies except the one platform" problem again, described at https://cloud-native.slack.com/archives/C08T7MZTV8W/p1761781178575799?thread_ts=1761762353.429559&cid=C08T7MZTV8W
You'll need to manually re-add them, or do some voodoo process under a full moon something like the following to correctly re-gen the lock file:
rm package-lock.json
rm -rf node_modules
npm i
What this does
Hoists all build devDependencies to the root package.json.
Key changes
Test fixes
Dependencies
Configuration
Package-specific changes
@opentelemetry/instrumentation-socket.io
import * as expecttoimport expect(expect v29 uses default export)@opentelemetry/instrumentation-dns
@opentelemetry/instrumentation-aws-sdk
Browser packages (propagator-aws-xray, propagator-instana, instrumentation-user-interaction, instrumentation-long-task)