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

Allow update-check to work in read-only envs & add timeout #19636

Merged
merged 7 commits into from
Sep 11, 2023

Conversation

paescuj
Copy link
Member

@paescuj paescuj commented Sep 8, 2023

Fixes #19578

Switching to the request library got for the following reasons:

  • Much more popular than node-fetch-cache
  • Proper RFC 7234 HTTP caching
  • Built-in timeout support

Tested in Docker (with --read-only & --network none) ✅

@changeset-bot
Copy link

changeset-bot bot commented Sep 8, 2023

🦋 Changeset detected

Latest commit: 58137f8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@directus/update-check Patch
directus Patch

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

@paescuj paescuj force-pushed the read-only-timeout-update-check branch from eca2fb7 to 09f6d03 Compare September 9, 2023 13:19
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.
Copy link
Member

@br41nslug br41nslug left a 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 👍

@br41nslug br41nslug merged commit 9b4ac46 into main Sep 11, 2023
7 checks passed
@br41nslug br41nslug deleted the read-only-timeout-update-check branch September 11, 2023 11:52
@github-actions github-actions bot added this to the Next Release milestone Sep 11, 2023
br-rafaelbarros pushed a commit to personal-forks/directus-source that referenced this pull request Nov 7, 2023
…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
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker readonlyfilesystem could not be enable after upgrading directus 10
3 participants