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

fix(upgrade): Fix yarn upgrade when using --scope with exotic deps #7017

Merged
merged 2 commits into from Feb 18, 2019

Conversation

Projects
None yet
3 participants
@rally25rs
Copy link
Contributor

rally25rs commented Feb 9, 2019

Summary

Exotic dependencies (github urls for example) were not being unlocked from the lockfile when running
yarn upgrade --scope @whatever/ which was resulting in dependencies not being upgraded. This was
due to trying to find the dep in the lockfile just by it's url instead of in name@url format.

For example if you have the dependency:

    "@yarn/test-git-repo": "https://github.com/yarnpkg/e2e-test-repo#master"

then yarn.lock contains

"@yarn/test-git-repo@https://github.com/yarnpkg/e2e-test-repo#master":
  version "1.0.0"
  resolved "https://github.com/yarnpkg/e2e-test-repo#5c57959f3c55a6cd6004e3855ca59ba98bfff56c"

but when yarn upgrade would try to unlock the dependency, it was searching for a lock on

https://github.com/yarnpkg/e2e-test-repo#master

instead of on

@yarn/test-git-repo@https://github.com/yarnpkg/e2e-test-repo#master

This resulted in the dependency still being locked to the previous version/SHA and no upgrade being performed.

fixes #7016

Test plan

Added regression test for scoped github dependency. (fixtures/upgrade/package-not-in-registry-scoped)

Also fixed an existing test; __tests__/fixtures/upgrade/package-not-in-registry/yarn.lock already had the latest commit sha in the lockfile, so the upgrade that it was testing never actually had to change versions, it was already current. I changed the sha in the lockfile to an older commit so that the upgrade would actually have to do something for the test to pass.

fix(upgrade): Fix yarn upgrade when using --scope with exotic depende…
…ncies.

Exotic dependencies (github urls for example) were not being unlocked from the lockfile when running
`yarn upgrade --scope @whatever/` which was resulting in dependencies not being upgraded. This was
due to trying to find the dep in the lockfile just by it's url instead of in `name@url` format.

fixes #7016

@rally25rs rally25rs requested a review from arcanis Feb 9, 2019

@madkin10
Copy link

madkin10 left a comment

Good catch 👍

@arcanis arcanis merged commit c837fef into yarnpkg:master Feb 18, 2019

14 checks passed

Yarn Acceptance Tests #20190209.2 succeeded
Details
buildsize No significant change
Details
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: install Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: test-linux-node10 Your tests passed on CircleCI!
Details
ci/circleci: test-linux-node4 Your tests passed on CircleCI!
Details
ci/circleci: test-linux-node6 Your tests passed on CircleCI!
Details
ci/circleci: test-linux-node8 Your tests passed on CircleCI!
Details
ci/circleci: test-macos-node10 Your tests passed on CircleCI!
Details
ci/circleci: test-macos-node6 Your tests passed on CircleCI!
Details
ci/circleci: test-macos-node8 Your tests passed on CircleCI!
Details
ci/circleci: test-pkg-tests-linux-node10 Your tests passed on CircleCI!
Details
ci/circleci: test-pkg-tests-linux-node8 Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment