Repository navigation
chore: absorb psr7 into packages/psr7 - #13723
Conversation
Split PSR-7 into separate package
Add PSR-7 server request implementation
docs: enforce documentation style with Vale
fix(psr7): always attach multipart body boundary to Content-Type
chore: stop committing package lock files
…the root The root replaces every absorbed package, which hides the package's own require block from the solver: a third-party dependency a package declares only resolves when the root declares it too. validate now fails for any non-php, non-ext, non-utopia-php requirement missing from the root require, and the RFC says so. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Fourth package on the plan in rfc/monorepo.md. Imported from the mirror with history (the preceding subtree merge), src/Psr7 flattened to src/, tests/Psr7 flattened to tests/ under Utopia\Psr7\Tests\, the package PHPStan config made standalone at its own level 10, and rector.php made standalone (it required the old monorepo's root config, which exists nowhere any more) with phpunitCodeQuality dropped because that set needs a package-local installed.json. psr7 was never in the root require, only a transitive dependency of five vendored packages; the root now replaces it and hoists its two PSR requirements (psr/http-factory, psr/http-message). The lock drops only utopia-php/psr7. bin/monorepo lists packages by their composer.json rather than by directory: a leftover vendor/ from another branch's test run made the tool generate replace entries for packages that were not there. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
| foreach ($manifest['require'] ?? [] as $dependency => $constraint) { | ||
| if ($dependency !== 'php' && !str_starts_with($dependency, 'ext-') && !str_starts_with($dependency, ORG . '/') && !isset($root['require'][$dependency])) { | ||
| $problems[] = "{$dependency} is required by packages/{$package} but not by the root; hoist it, replace hides the package's requirements from Composer"; | ||
| } |
There was a problem hiding this comment.
This check skips every utopia-php/* requirement and only checks whether other dependencies are present, without using $constraint. A future absorbed package could therefore add an unhoisted Utopia dependency or tighten an existing constraint while validation remains green. Because the root replace entry hides the package's own requirements, Composer could then omit that dependency or install a version outside the package's declared range.
Knowledge Base Used: Reusable platform packages
Prompt To Fix With AI
This is a comment left during a code review.
Path: bin/monorepo
Line: 700-703
Comment:
**Hoisting Validation Has Gaps**
This check skips every `utopia-php/*` requirement and only checks whether other dependencies are present, without using `$constraint`. A future absorbed package could therefore add an unhoisted Utopia dependency or tighten an existing constraint while validation remains green. Because the root `replace` entry hides the package's own requirements, Composer could then omit that dependency or install a version outside the package's declared range.
**Knowledge Base Used:** [Reusable platform packages](https://app.greptile.com/appwrite/-/custom-context/knowledge-base/appwrite/appwrite/-/docs/reusable-platform-packages.md)
---
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)
|
The hoisting rule skipped every utopia-php/* requirement. A sibling is satisfied when its own packages/ directory exists or the root still requires it from Packagist; anything else is a dependency Composer would silently drop, so it is now reported like any third-party one. Constraint ranges are still not compared: siblings in packages/ are always head. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Post-merge check: |
Summary
Fourth package on the plan in
rfc/monorepo.md, one package per PR from here. Four commits:chore(monorepo): validate that package requirements are hoisted into the root. Because the rootreplaces absorbed packages, Composer no longer reads theirrequire, so a package's third-party dependencies must be declared by the root or they silently leave the lock.validatenow fails when one is missing. The three packages already merged were only safe because they depended on nothing the root did not already require.Add 'packages/psr7/' from commit cf70bec9…: subtree import from the mirror, full history; the mirror ruleset updated by the sameabsorbrun.chore(psr7): mirror plumbing:mirror.ymlpointed here, README banner refreshed.refactor: load psr7 from packages/:src/Psr7andtests/Psr7flattened, tests underUtopia\\Psr7\\Tests\\, standalone PHPStan config at the package's own level 10, standalone Rector config (it required the old monorepo's root file, which exists nowhere any more;phpunitCodeQualitydropped because it needs a package-localinstalled.json). psr7 was never in the rootrequire, only a transitive dependency of client, domains, http, span and storage; the root now replaces it and hoistspsr/http-factoryandpsr/http-message. The lock drops onlyutopia-php/psr7.Also in commit 4:
bin/monorepolists packages by theircomposer.jsonrather than by directory. A leftovervendor/from another branch's test run made it generatereplaceentries for packages that were not on the branch, which pulled four packages and their dependencies out of the lock.Merging
Merge with a merge commit, not a squash, so the subtree annotation survives for the split.
Verification
bin/monorepo validate: all packages valid (the hoisting rule fires when a hoisted line is removed)bin/monorepo check psr7clean;bin/monorepo test psr7: 47 tests green on a fresh package vendorvendor/bin/phpunit --testsuite packages: 199 tests, 4 skippedUtopia\\Psr7directly;composer validatevalid;dump-autoloadwithout PSR-4 warnings🤖 Generated with Claude Code