Repository navigation
chore: absorb pools into packages/pools - #13845
Conversation
Co-authored-by: Torsten Dittmann <torsten.dittmann@googlemail.com>
Co-authored-by: Christy Jacob <christyjacob4@gmail.com>
Co-authored-by: Christy Jacob <christyjacob4@gmail.com>
Initial PR
- Drop the 17 per-package mirror CI workflows: they were inert in the monorepo and only re-tested, on the mirror, code the monorepo's own matrix already gated pre-merge. absorb now strips all incoming workflows and writes only mirror.yml; the ratchet lint over packages/* (no uses: left to pin) goes too. - Make absorb's mirror ruleset idempotent: update whatever branch ruleset already exists in place instead of skipping on a name clash (the gap that left auth's mirror without the split-app bypass). - Remove the standalone `import` command — unused, and it left a package without mirror.yml/banner/ruleset. import_package() stays as absorb's helper. - Trim absorbing.md/creating.md/README to match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
build: hoist baseline rector + phpstan configs to the root
Reuse mirror redirect workflow
docs: enforce documentation style with Vale
docs: centralize CODE_OF_CONDUCT and CONTRIBUTING at the monorepo root
…ctions fix(pools): recover failed pool connections
fix(pools): release the reserved slot when connection creation fails
feat(pools)!: constructor-only configuration, one acquisition budget
fix(pools): hold the owning pool weakly so dropped pools free their resources
refactor(pools,circuit-breaker,storage): drop the deprecated Instrument::lazy() helpers
…ection fix(nats,pools,queue): stop losing work, dedupe enqueues, end duplicate delivery (CLO-4771/4772/4773)
chore: stop committing package lock files
…ters fix(pools): wake waiters when failed borrowers free capacity
Point mirror.yml and the README banner at appwrite/appwrite so PRs and issues opened on the mirror are redirected here, and drop the Gitpod config the root tooling replaces.
Appwrite now autoloads Utopia\Pools from packages/pools and replaces utopia-php/pools so the vendored copy is no longer installed; the six vendored packages that require it resolve against the root. The mirror head is the 2.1.2 tag the lock already resolved, and its only requirement, utopia-php/telemetry, is already a sibling in packages/. Shape follows rfc/monorepo.md step A: src/Pools and tests/Pools are flattened, tests live under Utopia\Pools\Tests, and phpstan.neon and rector.php no longer reach for the old monorepo root configs. PHPStan keeps scanning the package's Swoole stubs for the generic Channel type. Source changes are Pint formatting only.
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
CI runs check before test on a fresh checkout, so a phpstan.neon that scans the package's own stubs (pools reads swoole/ide-helper for the generic Channel type) failed with a missing vendor directory. The old monorepo's check installed the package first; do the same.
There was a problem hiding this comment.
Implementation-Coupled Creation Counts
This concurrency test requires the initializer to run exactly once per configured pool slot, so it mirrors the pool's current lazy-creation strategy rather than testing only observable capacity, exclusivity, and reuse. The same brittle assertion appears in the high-concurrency and stress tests. This violates the repository directive that tests assert observable behavior instead of implementation details, and that requirement must 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/pools/tests/Adapter/SwooleTest.php
Line: 104-105
Comment:
**Implementation-Coupled Creation Counts**
This concurrency test requires the initializer to run exactly once per configured pool slot, so it mirrors the pool's current lazy-creation strategy rather than testing only observable capacity, exclusivity, and reuse. The same brittle assertion appears in the high-concurrency and stress tests. This violates the repository directive that tests assert observable behavior instead of implementation details, and that requirement must 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!
There was a problem hiding this comment.
Pre-existing in the imported library at mirror commit a45d867 (the 2.1.2 release Appwrite already runs). An absorb PR relocates the package with its history and does not change library behaviour or tests; production changes here are Pint formatting only, matching #13723, #13798, #13804, #13829 and #13731. Tracked for the phase 8 harvest rather than changed in this PR.
There was a problem hiding this comment.
Understood. Since this is unchanged behavior from the imported 2.1.2 library and the absorb PR only relocates it—with production changes limited to formatting—I agree it is out of scope for this PR. Tracking the assertion cleanup for the phase 8 harvest is appropriate; I’m withdrawing this as a merge-blocking finding.

Summary
Move
utopia-php/poolsintopackages/poolsso Appwrite loads it directly, step 3 of the messaging chain in #13828 (smtp→telemetry→pools→client+span→messaging). Three commits, per the playbook inrfc/monorepo.md:Add 'packages/pools/' from commit 'a45d867e…': subtree import from the mirror with full history. The mirror head is the2.1.2tag Appwrite already locks, so nothing else in the dependency graph moves.chore(pools): mirror plumbing:mirror.ymlpointed here, README banner refreshed, the Gitpod config dropped; the mirror ruleset was updated by the sameabsorbrun (split app bypass).refactor: load pools from packages/: root autoload andreplaceentries,utopia-php/poolsdropped fromrequireand from the lock (the six vendored packages that require it,abuse,cache,client,database,messaging,queue, now resolve against the root). Step A of the standard shape:src/Poolsandtests/Poolsflattened, tests underUtopia\Pools\Tests,phpstan.neonandrector.phpmade standalone. PHPStan keepsscanDirectories: vendor/swoole/ide-helper(inside the package, so allowed) because theSwoole\Coroutine\Channelgeneric inAdapter\Swooleonly exists in the stubs. Rector is clean on arrival, so production changes are Pint formatting only.Nothing to hoist: the package's only requirement,
utopia-php/telemetry, is already a sibling inpackages/. Appwrite imports the namespace in 19 files; root PHPStan is clean on all of them.Validation
bin/monorepo validate: all packages validbin/monorepo check pools: Rector, Pint and PHPStan level max, no baselinebin/monorepo test pools: 97 tests; the Stack adapter tests (43) pass, the Swoole adapter and waiter tests segfault on this macOS host (Swoole 6 + PHP 8.5) exactly as the untouched mirror code does fromutopia-php/monorepo, so the Linux runner decides, as it did for lock and telemetryvendor/bin/phpunit --testsuite packages --filter 'Utopia\\Pools\\Tests\\Adapter\\StackTest': 43 tests green under the root autoloader; telemetry's 24 still greencomposer validate --no-check-publish: existing exact-version warnings only;composer dump-autoloadwithout PSR-4 warningsbin/monorepo split pools --dry-run:99a729f7413210ed3e6a45a225ca46a9bc9338f0git diff --checkMerge and follow-up
Merge with a merge commit, not squash, to preserve the subtree annotation the split continues from.
After merge: confirm Appwrite's
Splitpushes toutopia-php/pools, then removepackages/poolsfromutopia-php/monorepoand regenerate its graph in a follow-up PR. One PR is still open on the mirror, utopia-php/pools#30 (stale connection recovery, opened 2026-03-11); the redirect only covers new PRs, so it needs a decision from its owner: re-open here againstpackages/poolsor close.Part of #13828.