-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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: update notifier to consider engine range #8050
base: latest
Are you sure you want to change the base?
Conversation
We'll want a new test for the behavior this is guarding against. |
while thinking on how to write a test for this one, logically the problem this pr solves it to get correct engine matched version, we only request for |
Yes, this is behavior we don't want to accidentally regress from. The update notifier tests will likely need a bit of tweaking to get there |
f95e421
to
07fd64f
Compare
test/lib/cli/update-notifier.js
Outdated
const NEXT_MINOR = '123.420.70' | ||
const NEXT_PATCH = '123.421.69' | ||
const CURRENT_BETA = '124.0.0-beta.99999' | ||
const HAVE_BETA = '124.0.0-beta.0' | ||
|
||
const pacumentResponse = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packument not pacument (I didn't do a code suggestion cause it will need to be changed in multiple places)
test/lib/cli/update-notifier.js
Outdated
}) | ||
|
||
if (PACOTE_MOCK_REQ_COUNT > 0) { | ||
registry.nock.get('/npm').times(PACOTE_MOCK_REQ_COUNT).reply(200, pacumentResponse) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great iteration. Eventually we'd want this in the mock registry (this request AND the packument it generates) but I don't want to block the PR on that.
af46071
to
ee70630
Compare
ee70630
to
a1f0923
Compare
When doing manifest call for fetching npm manifest it was using latest every-time, however fetching
npm@*
will still givelatest
if it's satisfies the engine range otherwise it will give highest matching version for the current engine range.Pacote.manifest calls internally uses pick-manifest logic to pick the appropriate version of the manifest for the engine range.