Repository navigation
chore: absorb platform into packages/platform - #13953
Conversation
docs: centralize CODE_OF_CONDUCT and CONTRIBUTING at the monorepo root
chore: move dependents onto client 0.3 and queue 0.24
chore(platform): allow utopia-php/queue 1.0
chore(platform): caret constraint for utopia-php/queue 1.x
…rm-f0c8 Add multi-queue jobs with independent coroutine caps
chore: stop committing package lock files
chore(platform): allow queue 2
feat(platform): let a worker spec ask for a batch
feat(queue): unify consumption and recover stranded claims
Allow queue 4 in platform
Batch queue consumption independently of coroutines
chore(platform): allow queue 6 alongside 5
🟢 Tier S · Ready to merge
Moves Utopia Platform into
📂 Walkthrough · 7
Reviewed |
|
| class HelloWorldPlatform extends Platform | ||
| { | ||
| public function __construct() | ||
| { | ||
| $this->addService('helloService', new HelloWorldService()); | ||
| } |
There was a problem hiding this comment.
README example cannot initialize A reader following this example hits an uninitialized
$core property: HelloWorldPlatform overrides the constructor but never calls parent::__construct() with a Module, and addService() uses $core. The action also assigns $httpMethod, while route registration reads the methods set by setHttpMethod(). Update both parts so the example can register its GET route.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/platform/README.md
Line: 65-70
Comment:
**README example cannot initialize** A reader following this example hits an uninitialized `$core` property: `HelloWorldPlatform` overrides the constructor but never calls `parent::__construct()` with a `Module`, and `addService()` uses `$core`. The action also assigns `$httpMethod`, while route registration reads the methods set by `setHttpMethod()`. Update both parts so the example can register its GET route.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
|
||
| ## System requirements | ||
|
|
||
| Utopia Framework requires PHP 8.3 or later. We recommend using the latest PHP version whenever possible. |
There was a problem hiding this comment.
Incorrect PHP minimum The README says PHP 8.3 is supported, but the package manifest requires PHP 8.5 or later. Readers who choose PHP 8.3 based on this guidance cannot install the package.
| Utopia Framework requires PHP 8.3 or later. We recommend using the latest PHP version whenever possible. | |
| Utopia Platform requires PHP 8.5 or later. We recommend using the latest PHP version whenever possible. |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/platform/README.md
Line: 82
Comment:
**Incorrect PHP minimum** The README says PHP 8.3 is supported, but the package manifest requires PHP 8.5 or later. Readers who choose PHP 8.3 based on this guidance cannot install the package.
```suggestion
Utopia Platform requires PHP 8.5 or later. We recommend using the latest PHP version whenever possible.
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| $params = $route->getParams(); | ||
|
|
||
| // Verify all Action::param() fields are forwarded to the Route | ||
| $actionParamKeys = ['default', 'validator', 'description', 'optional', 'injections', 'skipValidation', 'deprecated', 'example', 'aliases']; | ||
|
|
||
| foreach ($params as $name => $param) { | ||
| foreach ($actionParamKeys as $key) { | ||
| $this->assertArrayHasKey($key, $param, "Param '{$name}' is missing '{$key}' on the Route. Platform must forward all Action param fields."); |
There was a problem hiding this comment.
Tests mirror internal representation This test asserts the route parameter key list and stored enum object instead of checking how requests behave. A change to internal storage could fail the test without affecting callers, while a routing or validation regression could pass unnoticed. The repository requires tests of observable behavior rather than assertions that mirror source or configuration; this requirement must be satisfied before merging. The worker tests likewise inspect registered jobs and hooks instead of worker outcomes.
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/platform/tests/HttpServicesTest.php
Line: 159-166
Comment:
**Tests mirror internal representation** This test asserts the route parameter key list and stored enum object instead of checking how requests behave. A change to internal storage could fail the test without affecting callers, while a routing or validation regression could pass unnoticed. The repository requires tests of observable behavior rather than assertions that mirror source or configuration; this requirement must be satisfied before merging. The worker tests likewise inspect registered jobs and hooks instead of worker outcomes.
**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!
Summary
Moves
utopia-php/platformintopackages/platformso Appwrite loads it directly. Wave 4 of #13828, following the playbook inrfc/monorepo.md. Every HTTP action, worker and task in Appwrite extendsUtopia\Platform\Action, so the full e2e matrix in CI is the real gate for this PR.Merge with a merge commit: a squash drops the
git-subtree-*annotation and orphans the package from its mirror.Add 'packages/platform/' from commit 'dc43dd34…'mainwith full historychore(platform): mirror plumbingmirror.ymlcalls this repository'smirror-redirect.yml; README banner points here. No banned files to striprefactor: load platform from packages/replace,utopia-php/platformdropped fromrequireand the lock, step A shape, standalonephpstan.neon/rector.php, baselinedocs(rfc): list the platform baseline for phase 8Version gap
None. Appwrite pinned
1.0.0-rc25(dc43dd34), which is the mirror head, andutopia-php/monorepo'spackages/platformhas the same manifest and history tip.Step A
src/Platform/*→src/1.0.0-rc25apart from the move and Pint formatting (empty{}bodies inEnumandPlatform::initGraphQL(),fn ()spacing inPlatform)tests/tests/Platformfixtures,tests/unitandtests/e2eflattened intotests/; namespacesUtopia\Tests/Utopia\Unit→Utopia\Platform\Tests.HTTPServicesTest.php(declaringHttpServicesTest) →HttpServicesTest.phptests/E2E/tests/e2eneeds no services and starts no Swoole server or process:CLITestruns a task through theGenericadapter,HttpServicesTestruns requests through the FPM adapter with a mock response,WorkerServicesTestonly builds (never starts) the Swoole queue adapter over a lazy Redis connection. Upstream already ran them in its default suite, so they join the unit tierHttpServicesTesttearDown()now restores$_SERVER, the default timezone (new Http(..., 'UTC')sets it) andHttp::reset(), so it leaks no routes or globals into the rootpackagessuitephpunit.xmlunitsuite (testsminusE2E/bench);composer testruns itphpstan.neonsrc+tests(previously the monorepo root's level 5)rector.phphttp). No changesTestsbadge dropped; contribution guide points at appwrite/appwritephpstan-baseline.neonsrc(115 inPlatform,mixedfrom the untyped param/option/label definitions and worker params passed on toHook,Http,CLIand the queueServer), 36 in testsNothing to hoist:
requireisphp,ext-json,ext-redis(both already in the rootrequire) andcli http queue servers, all inpackages/.Validation
bin/monorepo validatebin/monorepo check platformbin/monorepo test platform(registry and--linked)phpunit --testsuite packagesinappwrite/appwrite:2.3.0httptests.--filter 'Utopia\\Platform'11 / 92 pass. 6 errors unrelated toplatform: 5agentsDiffCheckTest(the worktree's.gitfile points outside the mount) and 1clientSwoole connection-reset testtests/unitinappwrite/appwrite:2.3.0CertificatesDomainValidationTest::testAJobWithoutTheFlagStillChecksDns, does a live DNS lookup and does not touchUtopia\Platformapp/http.php,app/worker.php,app/cli.php,app/realtime.php,general.php,Platform/Appwrite.php,Platform/Action.php,Services/Tasks.php,Services/Workers.php, Teams/Users/TablesDB creates, Webhooks list, Tokens files,Compute/Base.php, FunctionsModule/Services/Builds, workersDeletes/Functions/Mails, tasksMaintenance/QueueRetry/DoctorUtopia\Platform\Actionresolves topackages/platform/src/Action.php;vendor/utopia-php/platformis no longer installedcomposer update --lockutopia-php/platform(plus content hash)composer validate --no-check-publishutopia-php/platformexact-version warning is gonebin/monorepo split platform --dry-run43e412ef, fast-forwards from mirror headdc43dd34(2 commits), tree identical topackages/platformgit diff --checkMirror
utopia-php/platformalready has the canonicalmainruleset (id17500067: deletion, non-fast-forward, pull request) with the split app (4016286) as an always-bypass actor, so the absorb ran with--skip-ruleset. It also has classic branch protection onmain(1 required approval, split app in the PR-review bypass list). Left as is.After merge
Splitutopia-php/platformpackages/platformfromutopia-php/monorepoBump utopia-php/http to 2.0.0-RC5(superseded), #32 PHPStan, #31 formatter/linter CI, #13 Travis → Actions, #7 analyzer (all superseded by the QA here). No open issuespackages/platform🤖 Generated with Claude Code