Closed valentinpalkovic closed 2 weeks ago
CI is running/has finished running commands for commit 0d576eb07b753ac2d550db047311e369e1664fcd. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this CI Pipeline Execution
Sent with 💌 from NxCloud.
Closes #
What I did
Initializing Storybook in an empty directory currently fails due to a race condition with the following error:
The issue was, that we introduced an alternative implementation for our internal caching, where we relied on file-system-cache, but we removed the package to use a custom caching solution.
The problem with the new solution is that every time we want to write into the cache, we don’t check, whether the cache folder actually exists. The cache folder itself gets initialized during module loading, so it should be, in theory, in place. Now, the crux is that when we initialize into an empty directory, we remove especially a .cache folder before continuing because in the past, we had issues initializing into an empty directory if it wasn’t empty.
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
Checklist for Maintainers
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli/src/sandbox-templates.ts
[ ] Make sure this PR contains one of the labels below:
Available labels
- `bug`: Internal changes that fixes incorrect behavior. - `maintenance`: User-facing maintenance tasks. - `dependencies`: Upgrading (sometimes downgrading) dependencies. - `build`: Internal-facing build tooling & test updates. Will not show up in release changelog. - `cleanup`: Minor cleanup style change. Will not show up in release changelog. - `documentation`: Documentation **only** changes. Will not show up in release changelog. - `feature request`: Introducing a new feature. - `BREAKING CHANGE`: Changes that break compatibility in some way with current major version. - `other`: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/core
team here._core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>
_Greptile Summary
This PR fixes a race condition in FileSystemCache by ensuring the cache directory exists before writing files during initialization of empty folders.
mkdirSync
call withrecursive: true
inset()
andsetSync()
methods in/code/core/src/common/utils/file-cache.ts