Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
8610068 to
81112de
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Cleanup can delete unrelated hidden-directory contents because it does not validate shard ancestry.
1 open issue
What changed in this PR
Extends cache cleanup to dot-prefixed keys using the existing file format, building on concurrent-cleanup handling.
Changes:
- Traverse hidden shard directories and identify hidden cache files by non-empty suffix.
- Add cleanup and preservation tests.
- Document the fix in the changelog.
| File | Description |
|---|---|
| tests/DotKeyCleanupTest.php | Tests dot-key cleanup and preservation of unrelated hidden content. |
| src/FileCache.php | Adds depth-aware hidden-directory traversal and suffix checks. |
| CHANGELOG.md | Records the dot-prefixed cache cleanup fix. |
Review effort: Balanced
| if ($file[0] !== '.' || (strlen($file) === 2 && $depth < $this->directoryLevel)) { | ||
| $this->removeCacheFiles($fullPath, $expiredOnly, $depth + 1); |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## fix-concurrent-cleanup #115 +/- ##
============================================================
+ Coverage 98.78% 98.82% +0.03%
- Complexity 70 78 +8
============================================================
Files 1 1
Lines 165 170 +5
============================================================
+ Hits 163 168 +5
Misses 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|

GC and
clear()skip cache keys starting with a dot, including their hidden shard directories. Traverse hidden directories that match the configured shard layout and remove hidden cache files identified by the configured suffix. Preserve unrelated hidden files and directories such as.gitignoreand.git.A non-empty file suffix is required to identify hidden cache files in the existing format. The empty-suffix case in #110 relies on its new file header and is outside this fix.
Stacked on #114 to keep each extracted fix in a separate review.