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

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

Merged
merged 2 commits into from
Feb 18, 2019

Conversation

rally25rs
Copy link
Contributor

@rally25rs 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.

…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 yarnpkg#7016
Copy link

@marcoadkins marcoadkins left a comment

Choose a reason for hiding this comment

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

Good catch 👍

@arcanis arcanis merged commit c837fef into yarnpkg:master Feb 18, 2019
@rally25rs rally25rs deleted the fix-upgrade-scope branch May 28, 2019 20:02
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.

upgrade --scope does not work for github packages
3 participants