Skip to content

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Dec 2, 2025

This reverts commit 5562a61, reversing changes made to 71102ea.

Summary by CodeRabbit

  • Bug Fixes

    • Simplified S3 storage file existence verification logic, removing fallback checks and nested error handling.
  • Tests

    • Removed directory existence validation tests from storage test suites.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 2, 2025

Walkthrough

The S3 storage driver's exists() method was simplified to check file existence only. The docblock was updated from "Check if file or directory exists" to "Check if file exists", and the implementation was refactored to remove fallback logic that attempted to verify existence via listObjects. The corresponding testDirectoryExists() test methods were removed from both the local and S3 test suites, eliminating tests for directory existence verification across nested paths.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Semantic behavior change: The exists() method no longer supports directory existence checks, representing an intentional API contract modification that warrants verification against dependent code
  • Test removal justification: Confirm that removal of testDirectoryExists() from both test suites is intentional and that no other code relies on directory existence checking via exists()
  • Simplified logic: The implementation refactoring in S3.php is straightforward (catch-then-return pattern), but the implications of removing the fallback path should be validated

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly indicates this is a revert of a previous merge, which directly aligns with the changeset that removes test methods and simplifies the exists() implementation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-exists-dir

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 10fe0c0 and 0c0202b.

📒 Files selected for processing (3)
  • src/Storage/Device/S3.php (2 hunks)
  • tests/Storage/Device/LocalTest.php (0 hunks)
  • tests/Storage/S3Base.php (0 hunks)
💤 Files with no reviewable changes (2)
  • tests/Storage/Device/LocalTest.php
  • tests/Storage/S3Base.php
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build & Unit
🔇 Additional comments (2)
src/Storage/Device/S3.php (2)

619-619: LGTM! Documentation accurately reflects the simplified scope.

The docblock update correctly documents that this method now only checks file existence, aligning with S3's object store architecture where directories don't exist as distinct entities.


624-633: LGTM! Clean simplification appropriate for S3's object store model.

The implementation correctly checks file existence using a HEAD request via getInfo(). The removal of directory existence fallback logic aligns with S3's architecture as an object store (noted at line 690: "S3 is an object store and does not have the concept of directories"). The broad exception handling is appropriate for existence checks where any error indicates non-existence.


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 and usage tips.

This reverts commit 5562a61, reversing
changes made to 71102ea.
@loks0n loks0n merged commit 32b6259 into main Dec 2, 2025
9 checks passed
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.

3 participants