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

feat(install): Add --update-checksums to cli install #4860

Merged
merged 6 commits into from
Nov 7, 2017
Merged

feat(install): Add --update-checksums to cli install #4860

merged 6 commits into from
Nov 7, 2017

Conversation

imsnif
Copy link
Member

@imsnif imsnif commented Nov 5, 2017

Summary

Fixes #4817.
When the --update-checksums flag is set, yarn would know to ignore a checksum mismatch between yarn.lock and the repository, and instead update the yarn.lock file with the proper checksum(s).

Test plan

Added new tests.

To manually check this:

  1. Change one or more of the package checksums in yarn.lock
  2. Delete node_modules (optionally also run yarn cache clean)
  3. Run yarn => checksum mismatch error will be received.
  4. Run yarn --update-checksums => will install successfully and fix the damaged checksums in yarn.lock

Update package checksum when there is a checksum mismatch between the repo and the lockfile
Provide the option to update the package checksum when there is a mismatch between the repo and the
local yarn.lock file

4817
@buildsize
Copy link

buildsize bot commented Nov 5, 2017

This change will increase the build size from 10.24 MB to 10.24 MB, an increase of 4.13 KB (0%)

File name Previous Size New Size Change
yarn-[version].noarch.rpm 885.5 KB 885.72 KB 230 bytes (0%)
yarn-[version].js 3.85 MB 3.86 MB 1.53 KB (0%)
yarn-legacy-[version].js 4 MB 4 MB 1.61 KB (0%)
yarn-v[version].tar.gz 890.12 KB 890.58 KB 471 bytes (0%)
yarn_[version]all.deb 667.26 KB 667.57 KB 320 bytes (0%)

@buildsize
Copy link

buildsize bot commented Nov 5, 2017

This change will increase the build size from 10.24 MB to 10.24 MB, an increase of 3.85 KB (0%)

File name Previous Size New Size Change
yarn-[version].noarch.rpm 885.44 KB 885.61 KB 171 bytes (0%)
yarn-[version].js 3.85 MB 3.85 MB 1.53 KB (0%)
yarn-legacy-[version].js 4 MB 4 MB 1.61 KB (0%)
yarn-v[version].tar.gz 890.08 KB 890.47 KB 405 bytes (0%)
yarn_[version]all.deb 667.31 KB 667.46 KB 156 bytes (0%)

Copy link
Member

@bestander bestander left a comment

Choose a reason for hiding this comment

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

Thanks for sending it, @imsnif!
Really nice and with tests.

Would you also send a PR to add this CLI command to the docs https://yarnpkg.com/en/docs/cli/install?

@imsnif
Copy link
Member Author

imsnif commented Nov 6, 2017

Sure thing!
Linking the PR here for symmetry's sake: yarnpkg/website#708

@bestander
Copy link
Member

Travis: ENOSPC: no space left on device, open '/tmp/ramfs/jest_dx/jest-transform-cache-
Let's wait for other CI to finish queue

@bestander
Copy link
Member

@imsnif, could you merge master into this PR?
It does not look like CI failures are affected by your change so let's rerun them

@imsnif
Copy link
Member Author

imsnif commented Nov 6, 2017

Merged: helped with Travis, but not so much with circleci or appveyor... networking issues?
The build also failed for me locally, but they were the same failures that were in Travis on master, so I assumed some work was being done there.

@BYK BYK changed the title Add --update-checksums to cli install feat(install): Add --update-checksums to cli install Nov 7, 2017
@BYK BYK merged commit 8918b6c into yarnpkg:master Nov 7, 2017
calvinhuang pushed a commit to calvinhuang/yarn that referenced this pull request Nov 9, 2017
**Summary**

Fixes yarnpkg#4817.
When the `--update-checksums` flag is set, yarn would know to ignore a checksum mismatch between `yarn.lock` and the repository, and instead update the yarn.lock file with the proper checksum(s).

**Test plan**

Added new tests.

To manually check this:
1. Change one or more of the package checksums in `yarn.lock`
2. Delete node_modules (optionally also run `yarn cache clean`)
3. Run `yarn` => checksum mismatch error will be received.
4. Run `yarn --update-checksums` => will install successfully and fix the damaged checksums in `yarn.lock`
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.

Moving repositories without recreating yarn.lock?
3 participants