You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should evaluate the benefits of using npm ci instead of npm install for our automated tests. While we’ve currently opted to stick with npm install to simulate how users are likely to install dependencies, we could achieve this simulation specifically during the npm tests. For the repo tests, npm ci might provide significant advantages.
However, adopting npm ci comes with some considerations:
Package sync errors: It fails if package.json and package-lock.json are out of sync. While this behavior could be desirable in the future, we would need a script or workflow to synchronize these files before enforcing it.
Benefits of using npm ci:
Immutable package files during tests: Since we don’t commit any artifacts during tests, npm ci guarantees that package.json and package-lock.json remain unchanged.
Clean installation: By removing the node_modules folder before installation, it ensures a clean, reproducible state. While our CI processes typically run on new instances (avoiding pre-existing node_modules folders), this reinforces best practices.
Up-to-date package-lock.json: Encourages keeping package-lock.json in sync with package.json.
Deterministic builds: It strictly adheres to the exact versions in package-lock.json, reducing variability in dependency resolution.
Performance improvements:npm ci is faster since it skips certain features intended for interactive environments. Although installation speed isn’t a bottleneck for us, even small optimizations can add up.
Next Steps
Let’s explore the feasibility and impact of using npm ci, including any adjustments we might need to enforce proper synchronization of package.json and package-lock.json.
The text was updated successfully, but these errors were encountered:
If we decide to adopt npm ci, here’s how I’d propose updating the workflows:
benchmark.yml and benchmark_parallel.yml: Replace the npm install commands with npm ci.
run_test.yml: Update to use npm ci by default. However, if link azle is false, fallback to npm install instead.
release.yml: Leave this workflow unchanged. Since we update package.json during the release process, we’ll also want to update package-lock.json and commit those artifacts as part of the release.
We should evaluate the benefits of using
npm ci
instead ofnpm install
for our automated tests. While we’ve currently opted to stick withnpm install
to simulate how users are likely to install dependencies, we could achieve this simulation specifically during the npm tests. For the repo tests,npm ci
might provide significant advantages.However, adopting
npm ci
comes with some considerations:package.json
andpackage-lock.json
are out of sync. While this behavior could be desirable in the future, we would need a script or workflow to synchronize these files before enforcing it.Benefits of using
npm ci
:npm ci
guarantees thatpackage.json
andpackage-lock.json
remain unchanged.node_modules
folder before installation, it ensures a clean, reproducible state. While our CI processes typically run on new instances (avoiding pre-existingnode_modules
folders), this reinforces best practices.package-lock.json
: Encourages keepingpackage-lock.json
in sync withpackage.json
.package-lock.json
, reducing variability in dependency resolution.npm ci
is faster since it skips certain features intended for interactive environments. Although installation speed isn’t a bottleneck for us, even small optimizations can add up.Next Steps
Let’s explore the feasibility and impact of using
npm ci
, including any adjustments we might need to enforce proper synchronization ofpackage.json
andpackage-lock.json
.The text was updated successfully, but these errors were encountered: