Skip to content

Conversation

@dyladan
Copy link
Member

@dyladan dyladan commented Jan 15, 2021

Creating this draft as a test to see how much faster CI would be with lock files checked in

answer: much much faster. CI is faster using lockfiles than when there is a cache hit

I am creating this PR as a point of discussion. Looking for input from @open-telemetry/javascript-approvers. Do you think we should check in lockfiles?

There is a good summary of the tradeoffs here: https://classic.yarnpkg.com/blog/2016/11/24/lockfiles-for-all/. It is about yarn, but applies to npm as well.

Discussion here: #1830

@codecov
Copy link

codecov bot commented Jan 15, 2021

Codecov Report

Merging #1829 (76fc976) into main (d54c5c8) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1829   +/-   ##
=======================================
  Coverage   92.35%   92.35%           
=======================================
  Files         157      157           
  Lines        5104     5104           
  Branches     1085     1085           
=======================================
  Hits         4714     4714           
  Misses        390      390           

@vmarchaud

This comment has been minimized.

@dyladan

This comment has been minimized.

Base automatically changed from master to main January 25, 2021 19:26
@obecny
Copy link
Member

obecny commented Jan 27, 2021

I think we should proceed with this further then.

@dyladan
Copy link
Member Author

dyladan commented Jan 27, 2021

ok

Copy link
Member

@vmarchaud vmarchaud left a comment

Choose a reason for hiding this comment

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

💯

@dyladan
Copy link
Member Author

dyladan commented Jan 27, 2021

Seems like all maintainers are on board. Marked as ready for reviews and will leave for a day or so to ensure nobody has any complaints before merging.

@Flarna
Copy link
Member

Flarna commented Jan 27, 2021

Are the PRs from renovate-bot taking care of updating lock files also?

I miss also some hints for devs what they shall do if they add/remove/modify a dependency. I use lock files in some projects where I usually deleted lock file + node_modules folder and then run npm install. But here we have lerna so not sure if this works as intended regarding the linked lerna subprojects.

Finally I think https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md#install-dependencies should be changed to npm ci.

@@ -0,0 +1,20 @@
{
"name": "backcompat-node10",
"version": "0.14.0",
Copy link
Member

Choose a reason for hiding this comment

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

Looks like they need a refresh

@dyladan
Copy link
Member Author

dyladan commented Jan 27, 2021

Are the PRs from renovate-bot taking care of updating lock files also?

Yes. Per renovate docs https://docs.renovatebot.com/faq/

I miss also some hints for devs what they shall do if they add/remove/modify a dependency. I use lock files in some projects where I usually deleted lock file + node_modules folder and then run npm install. But here we have lerna so not sure if this works as intended regarding the linked lerna subprojects.

It works the same way, but the lock file is regenerated and possibly different. Dependencies cross-linked by lerna are omitted entirely from the package-lock. When lerna bootstrap is run, the package.json files are copied to a backup location and temporary ones are put in place which only contain external dependencies. Then npm install is run. Then symlinks are created between lerna dependencies. Then the original package.json files are moved back.

Finally I think https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md#install-dependencies should be changed to npm ci.

It would be lerna bootstrap --ci, but only if you wanted to get the locked version of the dependencies for some reason. A bootstrap will work just as well locally and the lock file will be updated if it needs to be.

@@ -0,0 +1,9205 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

opentelemetry-plugin-fetch has been removed so we should not add a lockfile

@dyladan dyladan merged commit de8c2be into open-telemetry:main Jan 28, 2021
@dyladan dyladan deleted the package-lock branch January 28, 2021 19:59
dyladan added a commit to dyladan/opentelemetry-js that referenced this pull request Sep 9, 2022
dyladan added a commit to dyladan/opentelemetry-js that referenced this pull request Sep 9, 2022
pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this pull request Dec 15, 2023
* chore: release main

* chore: sync package-lock.json

---------

Co-authored-by: opentelemetrybot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants