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 npm tag resolver when dedupe #5497

Merged
merged 4 commits into from
Jul 18, 2023

Conversation

goloveychuk
Copy link
Contributor

@goloveychuk goloveychuk commented Jun 10, 2023

What's the problem this PR addresses?
Fixes Registry failed to return tag "8.4.1" when running yarn dedupe
If I add
console.log(descriptor, locator.reference)
it logs

{
  identHash: 'c463d28440264a050b6c82da90fae465d199a53c829a9fe2e382b672d4cbe014f84892bf0c630287a36347a4e407d33459c9581068c99d313332886ced75b781',
  scope: null,
  name: 'node-gyp',
  descriptorHash: '899f4448539abee8008ed64335a3b2bfb86e39a574e1267d2582a99b0865c3b00672068397645824a04ed0141f7f43c439ae8248539b250f8c76e24831ed0b94',
  range: 'npm:latest'
} 
npm:8.4.1::__archiveUrl=https%3A%2F%2Fregistry.com%2Fartifactory%2Fapi%2Fnpm%2Fnpm-repos%2Fnode-gyp%2F-%2Fnode-gyp-8.4.1.

I guess it's self explanatory

...

How did you fix it?
Uses Semver resolver instead of tag resolver

...

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

Copy link
Member

@merceyz merceyz left a comment

Choose a reason for hiding this comment

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

@goloveychuk
Copy link
Contributor Author

@merceyz added test

@goloveychuk goloveychuk requested a review from merceyz June 10, 2023 16:57
@goloveychuk
Copy link
Contributor Author

Can we merge while it's fresh?

Copy link
Member

@merceyz merceyz left a comment

Choose a reason for hiding this comment

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

LGTM though I see some of the other resolvers are also using this.getCandidates so @arcanis could you take a look as well?

@goloveychuk
Copy link
Contributor Author

Any update?

@arcanis
Copy link
Member

arcanis commented Jul 18, 2023

I think it'd make sense to use opts.resolver rather than this everywhere, but I'd prefer to test it for some time in a RC-like release to be sure. In the meantime it should be fine to merge this specific change.

@arcanis arcanis merged commit 6ecd7b1 into yarnpkg:master Jul 18, 2023
@goloveychuk goloveychuk deleted the fix-dedupe-npm-tag branch September 27, 2023 10:00
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.

3 participants