Revert "fix(storage): address the DSN bucket through the endpoint and refuse a DSN that names no device" - #247
Revert "fix(storage): address the DSN bucket through the endpoint and refuse a DSN that names no device"#247abnegate wants to merge 1 commit into
Conversation
… refuse a DSN that names no device"
Greptile SummaryThis PR reverts the preceding storage DSN validation and endpoint-addressing change, restoring local fallback for unusable DSNs and root-based S3 bucket handling.
Confidence Score: 4/5The PR should not merge until S3 bucket The restored bucket normalization explicitly classifies the nonempty string Files Needing Attention: src/Executor/StorageFactory.php, tests/unit/Executor/StorageFactoryTest.php Important Files Changed
Prompt To Fix All With AI### Issue 1
src/Executor/StorageFactory.php:58-60
**Bucket zero loses its namespace**
When an S3 DSN names bucket `0`, this condition treats it as empty and omits it from `$bucketRoot`, causing reads and writes to target the root namespace instead of bucket `0`.
```suggestion
$bucketRoot = $bucket === ''
? $root
: \rtrim($bucket . '/' . \ltrim($root, '/'), '/');
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Revert "fix(storage): address the DSN bu..." | Re-trigger Greptile |
| $bucketRoot = ($bucket === '' || $bucket === '0') | ||
| ? $root | ||
| : \rtrim($bucket . '/' . \ltrim($root, '/'), '/'); |
There was a problem hiding this comment.
Bucket zero loses its namespace
When an S3 DSN names bucket 0, this condition treats it as empty and omits it from $bucketRoot, causing reads and writes to target the root namespace instead of bucket 0.
| $bucketRoot = ($bucket === '' || $bucket === '0') | |
| ? $root | |
| : \rtrim($bucket . '/' . \ltrim($root, '/'), '/'); | |
| $bucketRoot = $bucket === '' | |
| ? $root | |
| : \rtrim($bucket . '/' . \ltrim($root, '/'), '/'); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/Executor/StorageFactory.php
Line: 58-60
Comment:
**Bucket zero loses its namespace**
When an S3 DSN names bucket `0`, this condition treats it as empty and omits it from `$bucketRoot`, causing reads and writes to target the root namespace instead of bucket `0`.
```suggestion
$bucketRoot = $bucket === ''
? $root
: \rtrim($bucket . '/' . \ltrim($root, '/'), '/');
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Reverts #246