-
Notifications
You must be signed in to change notification settings - Fork 3
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
Prototype a way to review NPM lockfiles in PRs #355
Comments
I think |
Hi @timmc-edx, Regarding the point where However, if someone manually changes |
Some experimentation:
So they're mostly equivalent, but that last one is a bit concerning; extraneous packages in the lockfile is exactly the kind of thing I'd want to catch. We can use the JSON output to get the actual list of problems, though! So the CI check should look something like this:
This still won't catch certain malicious edits (still researching that), but it should cover most well-intentioned mistakes. |
We are planning to add the suggested step to this lockfile check workflow. |
Renamed `lockfileversion-check-v3` to `lockfile-check` in lockfile version file. # Ticket [Prototype a way to review NPM lockfiles in PRs](edx/edx-arch-experiments#355) --------- Co-authored-by: Abdullah Waheed <[email protected]>
When someone submits a PR with changes to Javascript dependencies, it generally involves changed to
package.json
(a set of dependencies and version constraints) as well aspackage-lock.json
(the output of the dependency solver, as a lockfile). package.json is easy to review, but package-lock.json diffs can be huge, and manually reviewing them is generally infeasible.This ticket is to create a way to review package-lock.json changes to prevent accidental mismatches from being committed. Malicious PRs are not in scope.
Acceptance criteria:
npm install
has not been run since last change (which would update package-lock.json)Notes:
npm ci
will error if there are certain kinds of mismatches between the two filesnpm ls
will detect certain kinds of mismatches between package-lock.json and the node_modules directory, after runningnpm ci
The text was updated successfully, but these errors were encountered: