Skip to content
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

Some way to manage package-lock.json #11

Open
seebees opened this issue Jan 23, 2020 · 3 comments
Open

Some way to manage package-lock.json #11

seebees opened this issue Jan 23, 2020 · 3 comments

Comments

@seebees
Copy link
Collaborator

seebees commented Jan 23, 2020

Humans are not going to look at this file.
Dependabot or similar can handle updating dependancies,
but adding dependancies is still a manual process.

Is there a way to ensure that a given package-lock.json is valid
within the context of a package.json file?

@seebees seebees mentioned this issue Jan 23, 2020
1 task
@mattsb42-aws
Copy link
Member

Proposal: no human is ever allowed to edit the lock file. Instead, we have a GitHub Actions bot who updates that file. This could require adding dependencies as a separate pull request, but I'm not entirely convinced that is a terrible idea.

The benefit of this is that if only bots are ever editing this file, we can be much more confident that the file is generated the way that we think it is.

@seebees
Copy link
Collaborator Author

seebees commented Jan 24, 2020

This could be accomplished by pushing a change to the package.json file
and then having the bot/action push the change to the package-lock.json file to the PR...

@mattsb42-aws
Copy link
Member

I did consider that. My concern with that is that separating the commits in a PR that were made by a human from the commits that were made by a bot is tenuous at best, and impossible at worst (say, if someone rebases after the changes).

My root issue is that we have this very important file that defines exactly what dependencies are pulled in as well as the root of trust for validating those dependencies...but this file is simultaneously impossible for a human to validate or otherwise review.

This is not a problem that is unique to this project or to JS, though JS is one of the few ecosystems I have personally encountered where is is common practice to enshrine the dependency lock file in source code.

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

No branches or pull requests

2 participants