Skip to content

Clean up dot-prefixed cache keys - #115

Open
samdark wants to merge 3 commits into
fix-concurrent-cleanupfrom
fix-dot-prefixed-keys
Open

samdark wants to merge 3 commits into
fix-concurrent-cleanupfrom
fix-dot-prefixed-keys

Conversation

@samdark

@samdark samdark commented Oct 17, 2026

Copy link
Copy Markdown
Member
Q A
Is bugfix? Yes
New feature? No
Breaks BC? No
Fixed issues Extracted from #110

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 .gitignore and .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.

Copilot AI balanced review requested due to automatic review settings October 17, 2026 22:29
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: af717fc3-be7f-4453-8549-f4190d011162

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread src/FileCache.php
Comment on lines +401 to +402
if ($file[0] !== '.' || (strlen($file) === 2 && $depth < $this->directoryLevel)) {
$this->removeCacheFiles($fullPath, $expiredOnly, $depth + 1);
@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.82%. Comparing base (85387ec) to head (39f7929).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants