-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Allow update-check
to work in read-only envs & add timeout
#19636
Conversation
🦋 Changeset detectedLatest commit: 58137f8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
eca2fb7
to
09f6d03
Compare
The cache dir usually doesn't exist, so we need to create it first. If the dir shouldn't exist already, this also catches the case when fs is read only - if it should exist but fs is read only, the cache is now forgivable enough to not fail. 'fs.access' would not be sufficiently reliable anyway, since permission could change between the check and write action.
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.
Works properly in a no-network and readonly filesystem environment in my tests 👍
…s#19636) * Allow update-check to work in read-only envs & add timeout * Update deps in 'update-check' * Add changeset * Switch to `got` * Fix dir check The cache dir usually doesn't exist, so we need to create it first. If the dir shouldn't exist already, this also catches the case when fs is read only - if it should exist but fs is read only, the cache is now forgivable enough to not fail. 'fs.access' would not be sufficiently reliable anyway, since permission could change between the check and write action. * Add basic test * Disable retry
Fixes #19578
Switching to the request library
got
for the following reasons:node-fetch-cache
Tested in Docker (with
--read-only
&--network none
) ✅