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

[CI] Commit package-lock.json file? #5784

Open
chalin opened this issue Dec 13, 2024 · 1 comment · May be fixed by #5787
Open

[CI] Commit package-lock.json file? #5784

chalin opened this issue Dec 13, 2024 · 1 comment · May be fixed by #5787
Labels
CI/infra CI & infrastructure

Comments

@chalin
Copy link
Contributor

chalin commented Dec 13, 2024

I've resisted the idea of committing the package-lock.json file out of concern that it would cause headaches during merge and rebases, especially for long-standing PRs (which we have enough of to be of concern.

But experience with a file with a similar profile (refcache.json) has proven to be not as bad as I expected. Given that, I'd like to suggest that we give it a try: i.e., commit package-lock.json. We should probably agree on the (maleable) convention that only site maintainers and approvers should update the lock file.

Of course, after a trial period, we can always fall back to our current situation, or even pushing things further and making package.json into a substitute lock file by pinning packages to exact version, which is what we do currently for Hugo.

Pros of committing the lock file: it can help us optimize our CI, and simplify some workflows. No extra lock file to maintain since it gets generated dynamically as needed.

Cons: as mentioned before, it can complicate merges and rebases, esp. for long-standing PRs. Another con is that we need to "maintain" the lock file.

Thoughts?

@chalin chalin added the CI/infra CI & infrastructure label Dec 13, 2024
@svrnm
Copy link
Member

svrnm commented Dec 13, 2024

Let's give it a try. I think we might be better of with it. If we run into lots of issues with it with merging and rebasing we still can write yet another fix command to clean the package-lock and update it with the current version

@chalin chalin linked a pull request Dec 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/infra CI & infrastructure
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants