-
Notifications
You must be signed in to change notification settings - Fork 518
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
chore: use npm workspaces and a package-lock.json #1771
chore: use npm workspaces and a package-lock.json #1771
Conversation
- use npm workspaces instead of lerna for monorepo install handling (requires at least npm@7, so node v14 users will have to update their npm) - updates to lerna@6, which brings parallel - add package-lock.json for more reliable dev and testing Refs: open-telemetry/opentelemetry-js#4238
…aces, bump some jobs to use node:18 so we have a sufficient npm by default
Codecov Report
@@ Coverage Diff @@
## main #1771 +/- ##
=======================================
Coverage 91.44% 91.44%
=======================================
Files 143 143
Lines 7273 7273
Branches 1458 1458
=======================================
Hits 6651 6651
Misses 622 622 |
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 guess you removed the caches to test the CI and not mess with the existing ones. I think we can prefix it so there is no collision with the existing ones.
No. t2t2 did mention on that thread that we could enable npm cache on the
So that is worth trying out. |
Howdy! Saw this PR while browsing. Unless you have a good reason not too, dropping |
@RichiCoder1 Thanks. I'll try that out on the .github/workflows/lint.yml workflow a little later and compare job run times. |
… but not locally for me)
…olor codes with node 18
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1771 +/- ##
=======================================
Coverage 91.42% 91.42%
=======================================
Files 143 143
Lines 7303 7303
Branches 1461 1461
=======================================
Hits 6677 6677
Misses 626 626
|
…e, to hopefully be faster
The unit tests finally passed with node v18. This took longer than it should have. tl;dr: The following assert was failing in Node v18 because the output from the ConsoleSpanExporter was marked-up with ANSI color escape codes, which broke the opentelemetry-js-contrib/metapackages/auto-instrumentations-node/test/register.test.ts Lines 38 to 39 in 1b0caa6
The output was colored because nx is by default adding the FORCE_COLOR=true environment variable.Only Node v18 was affected because in v18.17.0, FORCE_COLOR started being honoured for non-TTY streams (stdout is not a TTY when run piped into anything, as in CI).Setting FORCE_COLOR=0 (or false ), is the only way to prevent that with envvars.
Notes:
|
@legendecas or someone else: Could you please remove the Other than that, I think everything is basically working here now. I think we could merge this now, or wait for the renovate PR to update to the 0.45.1/1.18.1 release first. |
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.
Wow, this must've been a chunk of work. Thank you so much for working on this @trentm.
We've desperately needed this change for a while now, so I'm very happy to see this PR!
It's a huge change but it looks good to me, very high quality overall. Tested locally and everything seems to work for me. @dyladan would also appreciate your review as you're more familiar with the release automation in this repo. 🙂
plugins/node/opentelemetry-instrumentation-mongodb/examples/package.json
Show resolved
Hide resolved
…ference were necessary Refs: open-telemetry/opentelemetry-js#4257
Waiting for one more CI run to finish. If there are no more comments until after the SIG meeting today (18:00 GMT) I'll merge this. |
Ah, I think this still needs one more branch update and update to its package-lock.json as the most recently merged PR modified dependencies - then we can merge this. |
I can do that now. |
Ready to merge now. |
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Since the move to npm workspaces in open-telemetry#1771 this pretest step is no longer needed for TAV test runs.
Since the move to npm workspaces in #1771 this pretest step is no longer needed for TAV test runs. Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Refs: open-telemetry/opentelemetry-js#4238
clean start in your git clones
The change from lerna to npm workspaces means that most dependencies will be
installed in the top-level
node_modules
dir. To avoid surprising conflictsfrom
node_modules
and possible package-lock files in subdirs from local dev,you should start fresh:
Either do a full
git clean -ffdx
(it is the only way to be sure) -- which will delete all non-git files -- or do this:Then install and build, test and lint:
smaller install, faster CI builds
One benefit is that size of a git clone after
npm ci
is down 10X -- from~8.6GB to ~800MB. As a result, clean builds should be faster.
reviewer notes
npm install
for all packages has completed. It resulted in various build errors. UsingprepublishOnly
is recommended (https://docs.npmjs.com/cli/v10/using-npm/scripts#prepare-and-prepublish) and is what the core repo was already doing.