Skip to content

chore: absorb servers into packages/servers - #13921

Merged
ChiragAgg5k merged 65 commits into
mainfrom
chore/absorb-servers
Sep 27, 2026
Merged

ChiragAgg5k merged 65 commits into
mainfrom
chore/absorb-servers

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Summary

Moves utopia-php/servers into packages/servers so Appwrite loads it directly. Wave 2 of #13828, following the playbook in rfc/monorepo.md.

Commit What
Add 'packages/servers/' from commit '060da7b3…' Subtree import from the mirror with full history. Mirror head is the 0.4.11 tag Appwrite already locks, and its tree matches packages/servers in utopia-php/monorepo, so no version gap
chore(servers): mirror plumbing mirror.yml now calls this repository's mirror-redirect.yml; README banner points here. No banned files to strip
refactor: load servers from packages/ Root autoload + replace entries, utopia-php/servers dropped from require and the lock, step A shape, standalone phpstan.neon / rector.php, baseline, RFC phase 8 line
Merge of main Lock regenerated with composer update --lock

Step A

Change Detail
src/Servers/* → src/ src/ is byte-identical to 0.4.11 apart from the move and Pint formatting (empty {} bodies, fn ( spacing)
tests/Servers/Unit/HookTest.php → tests/HookTest.php Namespace Tests\Servers\Unit → Utopia\Servers\Tests, matching autoload-dev
Removed dead test files tests/Servers/servers/* (queue worker fixtures copied from utopia-php/queue, referencing Utopia\Queue, never run and already excluded from PHPStan) and tests/Servers/Unit/Adapter/Base.php (empty // TODO test under a mismatched Tests\Unit\Base namespace, never collected)
phpunit.xml PHPUnit 12 shape used by the other packages (tests, tests/E2E excluded)
phpstan.neon Standalone, level max over src + tests (previously included the monorepo root at level 5)
rector.php PHP sets + type declarations; skips ClassPropertyAssignToConstructorPromotionRector and ReadOnlyPropertyRector. Rector makes no changes
phpstan-baseline.neon 74 findings: 34 in src (unvalued array types in Hook, mixed offsets in Base::prepare()/validate()), 40 in HookTest (nullable ?Hook fixture). Added to the RFC phase 8 list

Nothing to hoist: the package requires only php, utopia-php/di and utopia-php/validators, both already in packages/. Appwrite has no direct Utopia\Servers uses; the still-vendored cli, http, queue and platform require utopia-php/servers, and replace now satisfies them.

Validation

Check Result
bin/monorepo validate all packages valid
bin/monorepo check servers Rector, Pint, PHPStan level max (with baseline) pass
bin/monorepo test servers 10 tests / 23 assertions
vendor/bin/phpunit --testsuite packages --filter 'Utopia\\Servers' (in appwrite/appwrite:2.3.0) 10 tests / 23 assertions
Autoload Utopia\Servers\Hook resolves to packages/servers/src/Hook.php
composer update --lock lock diff vs main drops only utopia-php/servers (plus content hash)
composer validate --no-check-publish valid (only the existing utopia-php/platform exact-constraint warning)
bin/monorepo split servers --dry-run 0bcfefd7, fast-forwards from mirror head 060da7b3, tree identical to packages/servers
git diff --check clean

Merge and follow-up

Merge with a merge commit. A squash drops the git-subtree-* annotation and orphans the package from its mirror.

utopia-php/servers already has the canonical main ruleset (id 17508351) with the split app (4016286) as an always-bypass actor, so the absorb ran with --skip-ruleset. There is no classic branch protection on main.

After merge
Confirm Split pushes to utopia-php/servers
Retire remove packages/servers from utopia-php/monorepo
Triage none: the mirror has no open PRs or issues, and no open utopia-php/monorepo PR touches packages/servers

🤖 Generated with Claude Code

loks0n and others added 16 commits June 20, 2026 10:45
- 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) <[email protected]>
Hoist PHPStan level 5 to the monorepo root
build: hoist baseline rector + phpstan configs to the root
chore: widen utopia-php/validators to 0.3.*
docs: enforce documentation style with Vale
docs: centralize CODE_OF_CONDUCT and CONTRIBUTING at the monorepo root
…console-http-queue

chore: move servers, console, http and queue onto validators ^1.0
chore: stop committing package lock files
…892e8615'

git-subtree-dir: packages/servers
git-subtree-mainline: ee19d6d
git-subtree-split: 060da7b
@ChiragAgg5k ChiragAgg5k added the absorb History-preserving package absorption; merge commit required label Sep 26, 2026
@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High risk] Moves servers package into monorepo structure.

The PR appears safe to merge, with the two previously reported non-blocking concerns still open.

Fix All in Claude CodeFindings

  1. P2 Tests mirror parameter storage ▶
  2. P2 Documented requirements contradict Composer ▶
Fix with agent prompt
### Issue 1
packages/servers/tests/HookTest.php:80-81
These assertions check the nested `aliases` field returned by `getParams()`, not whether an alias works when a hook is prepared. The repository requires tests of observable behavior rather than assertions that mirror source-code structures. Please test alias resolution through `Base::prepare()` before merging. The enum and injection tests use the same implementation-coupled approach.

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!

### Issue 2
packages/servers/README.md:undefined-33
The README says this package supports PHP 8.2 and is dependency-free, but `packages/servers/composer.json` requires PHP 8.5, `utopia-php/di`, and `utopia-php/validators`. A reader on PHP 8.2–8.4 who follows these requirements cannot install the package. Please align both claims with the manifest.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR moves utopia-php/servers into packages/servers, wires root autoloading and Composer replacement, and adds standalone package tooling. Since the previous review, the only change reorganizes the RFC’s PHPStan baseline list.

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..."

Comment on lines +80 to +81
$params = $this->hook->getParams();
$this->assertSame(['project', 'project_id'], $params['projectId']['aliases']);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Tests mirror parameter storage
These assertions check the nested aliases field returned by getParams(), not whether an alias works when a hook is prepared. The repository requires tests of observable behavior rather than assertions that mirror source-code structures. Please test alias resolution through Base::prepare() before merging. The enum and injection tests use the same implementation-coupled approach.

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/servers/tests/HookTest.php
Line: 80-81

Comment:
**Tests mirror parameter storage**
These assertions check the nested `aliases` field returned by `getParams()`, not whether an alias works when a hook is prepared. The repository requires tests of observable behavior rather than assertions that mirror source-code structures. Please test alias resolution through `Base::prepare()` before merging. The enum and injection tests use the same implementation-coupled approach.

**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!

Fix in Claude Code Fix in Codex


## System requirements

Utopia Servers requires PHP 8.2 or later. We recommend using the latest PHP version whenever possible.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Documented requirements contradict Composer
The README says this package supports PHP 8.2 and is dependency-free, but packages/servers/composer.json requires PHP 8.5, utopia-php/di, and utopia-php/validators. A reader on PHP 8.2–8.4 who follows these requirements cannot install the package. Please align both claims with the manifest.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/servers/README.md
Line: 33

Comment:
**Documented requirements contradict Composer**
The README says this package supports PHP 8.2 and is dependency-free, but `packages/servers/composer.json` requires PHP 8.5, `utopia-php/di`, and `utopia-php/validators`. A reader on PHP 8.2–8.4 who follows these requirements cannot install the package. Please align both claims with the manifest.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → chore/absorb-servers (after).

Metric Before After Change
🚀 Requests/sec 180.13 191.11 🟢 +6.1%
⏱️ Latency P50 97.1 ms 89.56 ms 🟢 -7.8%
⏱️ Latency P95 230.44 ms 210.01 ms 🟢 -8.9%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 89.56 210.01 12,141 191.11 -20.43
Account 174.19 329.78 639 10.59 -12.32
TablesDB 87.13 166.41 6,603 106.5 -9.58
Storage 81.26 179.31 3,195 52.81 -17.03
Functions 131.29 251.99 1,704 28.77 -47.1

Top API waits (after)

API request Max wait (ms)
account.name.update 783.47
functions.variables.update 594.77
tablesdb.rows.create 533.51
account.prefs.update 491.51
functions.variables.get 471.02

@ChiragAgg5k
ChiragAgg5k merged commit e5fc1e5 into main Sep 27, 2026
50 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the chore/absorb-servers branch September 27, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

absorb History-preserving package absorption; merge commit required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants