Repository navigation
chore: absorb storage into packages/storage - #13926
Conversation
feat: add createDirectory method
feat: add get type method
Fix : Linode File Upload
fix: issues with delimiters in path
…ssion Add Snappy compression
Removed mentions of authors (individual credits)
chore: require validators 0.6
chore: adopt validators ^1.0 in config and storage
chore: stop committing package lock files
chore(fastly,storage): require client 0.4
fix(storage): send explicit Content-Length on every S3 request
fix(storage): pull MinIO from quay.io now that Docker Hub no longer serves it
…ations feat(storage): conditional reads and writes, file info, and upload listing
refactor(storage, domains, cdn, fastly): use client 0.5's names
# Conflicts: # composer.lock
# Conflicts: # rfc/monorepo.md
|
| "utopia-php/schedule": "*", | ||
| "utopia-php/smtp": "*", | ||
| "utopia-php/span": "*", | ||
| "utopia-php/storage": "*", |
There was a problem hiding this comment.
Production fileinfo requirement disappears
If a production installation lacks ext-fileinfo, Composer can now install it because the root declares that extension only in require-dev. Replacing the storage package hides its production requirement, but Local::getFileMimeType() still calls mime_content_type(), so that storage operation will fail. Keep the extension requirement in the production dependency graph.
Prompt To Fix With AI
This is a comment left during a code review.
Path: composer.json
Line: 215
Comment:
**Production fileinfo requirement disappears**
If a production installation lacks `ext-fileinfo`, Composer can now install it because the root declares that extension only in `require-dev`. Replacing the storage package hides its production requirement, but `Local::getFileMimeType()` still calls `mime_content_type()`, so that storage operation will fail. Keep the extension requirement in the production dependency graph.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| $reflection = new \ReflectionClass($storage); | ||
| $method = $reflection->getMethod('joinChunks'); | ||
|
|
||
| try { | ||
| $method->invoke($storage, $dest, 2); |
There was a problem hiding this comment.
Tests depend on private implementation
This test uses reflection to call the private joinChunks() method. The S3 tests similarly assert sequences of operation labels defined by their own fake. These tests can fail after a harmless internal refactor without showing a change in storage behavior. The repository requires tests to assert observable behavior, not private methods or call order; this requirement needs to be satisfied before merging.
Context Used: Call out and harshly judge implementation-coupled tests. We don't mirror source code, configuration, or version pins in assertions. We test observable behavior; use linters for syntax and schema checks. (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/storage/tests/Device/LocalTest.php
Line: 816-820
Comment:
**Tests depend on private implementation**
This test uses reflection to call the private `joinChunks()` method. The S3 tests similarly assert sequences of operation labels defined by their own fake. These tests can fail after a harmless internal refactor without showing a change in storage behavior. The repository requires tests to assert observable behavior, not private methods or call order; this requirement needs to be satisfied before merging.
**Context Used:** Call out and harshly judge implementation-coupled tests. We don't mirror source code, configuration, or version pins in assertions. We test observable behavior; use linters for syntax and schema checks. ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
|
||
| ## 1. Prerequisites | ||
|
|
||
| This library is developed in the [utopia-php monorepo](https://github.com/utopia-php/monorepo) — `utopia-php/storage` is a read-only mirror. Fork the monorepo, clone your fork, and create a `feat-XXX-YYY-storage-adapter` branch from `main`, where `XXX` is the issue ID and `YYY` the storage adapter name. The library lives in `packages/storage`. |
There was a problem hiding this comment.
Guide names wrong development repository
This prerequisite tells contributors to fork utopia-php/monorepo, but the guide’s later steps require an appwrite/appwrite checkout and pull request. Storage’s mirror is read-only, so following the prerequisite sends contributors to the wrong place. Name appwrite/appwrite as the writable home here and update the related contributing and adapter-guide links in the README.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/storage/docs/adding-new-storage-adapter.md
Line: 11
Comment:
**Guide names wrong development repository**
This prerequisite tells contributors to fork `utopia-php/monorepo`, but the guide’s later steps require an `appwrite/appwrite` checkout and pull request. Storage’s mirror is read-only, so following the prerequisite sends contributors to the wrong place. Name `appwrite/appwrite` as the writable home here and update the related contributing and adapter-guide links in the README.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
quay.io now answers 401 for the pinned MinIO image, so the package's e2e tier failed in CI before any test ran. Use the same Silo image Appwrite's S3 e2e group moved to in #13884.
# Conflicts: # composer.json # composer.lock # rfc/monorepo.md
# Conflicts: # composer.lock
Summary
Moves
utopia-php/storageintopackages/storageso Appwrite loads it directly. Wave 2 of #13828, following the playbook inrfc/monorepo.md. The mirror head7afbd2edis the4.3.0release Appwrite already locks, so there is no version gap.Add 'packages/storage/' from commit '7afbd2ed…'chore(storage): mirror plumbingmirror.ymlpoints here, README banner refreshed (no banned files to remove)refactor: load storage from packages/replace, lock, RFC baseline bulletstyle(storage): strip trailing whitespace from the adapter guidedocs/maincomposer.lockconflict re-resolved withcomposer update --lockStep A
src/Storage/*→src/src/is the release apart from the move, Pint formatting (empty{}bodies and promoted-constructor braces) and the@seetest references following the test namespace;git diff -wshows only brace placementtests/Storage/{Device,Validator}→tests/Utopia\Tests\Storage\→Utopia\Storage\Tests\; fixture paths lose one../tests/E2Edocker-compose.yml); no real-provider tests exist, nothing needs cloud credentialsphpunit.xmltestsminustests/E2Ephpstan.neonsrcandtests(was../../phpstan.neon)rector.phpIfToNullCoalescingAssignRector,RemoveDeadReturnRectorandAddVoidReturnTypeWhereNoReturnRectorso tests stay as releaseddocs/adding-new-storage-adapter.mdtests/Device/S3Test.phpScriptedClientfake'swithFollowRedirects()takesint $maxHops = Redirect::MAX_HOPSto matchpackages/client(#13910)srchas no PHPStan findings at level max.phpstan-baseline.neonholds 3, all in one test fixture: Pint'ssimplified_null_returnturns the untypeddetach()ofLocalTest's failing stream fromreturn null;intoreturn;. Listed in the RFC phase 8 burn-down as a single bullet.Root
requireutopia-php/storage: ^4.3psr/http-client ^1.0andpsr/http-message ^1.1 || ^2.0are already in the root with the same constraints;ext-fileinfo/ext-simplexmlfollow the existing rule of not hoisting extensionsreplaceutopia-php/storage: *satisfies the still-vendoredutopia-php/migration(storage 4.*)composer.lockmaindrops onlyutopia-php/storage 4.3.0Net: +8,042 / −52, nearly all the imported package. Root side is +5 / −52.
Validation
bin/monorepo validatebin/monorepo check storagebin/monorepo test storageunitbin/monorepo test storagee2e (MinIO, unique compose project, torn down)phpunit --testsuite packages --filter 'Utopia\\Storage'inappwrite/appwrite:2.3.0tests/unit/Migration/MigrationsWorkerExportTest.php(usesUtopia\Storage)Utopia\Storage(Doctor, Deletes, Messaging and Migrations workers, S3 module, CSV/JSON imports, Health stats, file push)Utopia\Storage\Device\S3resolves topackages/storage/src/Device/S3.phpcomposer validate --no-check-publishutopia-php/platformexact-pin warning)bin/monorepo split storage --dry-run8434e03e, fast-forwards from mirror head7afbd2edgit diff --checkMirror state
mainruleset (id2848844) with the split app as always-bypass, so the absorb ran with--skip-rulesetmainutopia-php-monorepo) is inbypass_pull_request_allowances, force pushes and deletions off. This may blockSplitafter merge and needs an admin to remove it; left unchanged hereAfter merge
git-subtree-*annotation and orphans the package from its mirrorSplitpushes toutopia-php/storagepackages/storagefromutopia-php/monorepoFeature: Support for MINIO Object Storage(2024). The S3 adapter already works against MinIO, which is what the e2e tier runs on; propose closingfix(storage): retry refused connections and unresolvable hosts(S3/RetryStrategy.php)fix(storage): bound Local recursive directory walks(Device/Local.php)fix(storage): delete S3 objects recursively and bound the prefix at a separator(Device/S3.php), external contributorAll three monorepo PRs target the old
src/Storage/andtests/Storage/paths, so each needs the paths rebased ontopackages/storage/srcandpackages/storage/tests.🤖 Generated with Claude Code