Repository navigation
chore: absorb cli into packages/cli - #13928
Merged
Merged
Conversation
chore: remove console
…work chore: remove framework
Adapt to breaking changes in utopia-php/di 0.3 which removes the Dependency class in favor of Container::set(string $id, callable $factory, array $dependencies).
chore: update utopia-php/servers from 0.2 to 0.3
This reverts commit 2cdfc73.
This reverts commit 7a206f1.
feat: allow cli container injection
CLI args arrive as strings via getopt. When a param's validator is `Boolean` (loose mode), strings like "true"/"false"/"1"/"0" pass validation but remain strings. If the action callback declares a `bool` parameter, PHP's implicit string-to-bool cast turns any non-empty string except "0" into `true` -- so `--commit=false` silently becomes `true` and the action runs as if `--commit=true` had been passed. Validators in utopia-php are pure (validate only, never mutate), so the coercion has to happen here at the dispatch boundary in `CLI::getParams()`. After validation, if the param's validator (unwrapping `Nullable`) is `Boolean` and the value is still a string, we run it through `filter_var(..., FILTER_VALIDATE_BOOLEAN)` before handing it to the callback. Bool defaults and non-string inputs pass through untouched, so this is a safe, additive change for existing callers.
Optional params with `--flag=` (or default `''`) bypass `validate()` entirely, so they reach `coerce()` un-validated. The previous version ran them through `filter_var($value, FILTER_VALIDATE_BOOLEAN)`, which silently returns `false` for empty strings -- a behaviour change for callers (e.g. Cloud's `Patch.php`) that use `''` as a three-state "not set" sentinel before resolving to `null`. Now coerce returns early for empty strings, and uses `FILTER_NULL_ON_FAILURE` for everything else so any unrecognised input falls back to the original value rather than getting silently downgraded to `false`. Spotted by Greptile review on PR #52.
Feat: Param aliases
Relax servers patch constraint
One pinned toolchain (pint, phpstan, rector) in the root composer.json, one canonical pint.json for every package, run via bin/monorepo check (--fix to apply) in CI alongside tests. phpstan.neon and rector.php stay per-package as they encode per-library decisions. Applies the canonical style to cli, platform and queue, the Stringable interface rector wants on client's PSR-7 classes, and drops the now-pointless nullsafe operators phpstan flags in http's RouterTest. Co-Authored-By: Claude Fable 5 <[email protected]>
Packages no longer declare pint/phpstan/rector dev dependencies, QA scripts, or QA workflows — bin/monorepo check is the single gate, running before merge. Mirror CI keeps only test workflows. Lock files regenerated to match (and unpinned from stale dependency snapshots). Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
bin/monorepo absorb runs it: import with history, strip hoisted QA, write a mirror.yml that closes mirror PRs with a redirect to the monorepo, banner the README, and create the mirror ruleset (PR-only, split app bypassed). Applied to all five packages; manual steps documented in the README. Co-Authored-By: Claude Fable 5 <[email protected]>
One phpunit (^12) pinned in the root composer.json; packages no longer declare it. Package test scripts call `phpunit`, resolved from the root vendor/bin which bin/monorepo puts on PATH; mirror workflows get it via setup-php's tools input. Migrates the phpunit 9 era leftovers: cli and platform phpunit.xml schemas, cli's @dataProvider annotation to an attribute. cli's mirror test matrix moves to 8.3-8.5 (phpunit 12 needs >=8.3). bin/monorepo absorb now strips phpunit and rewrites test scripts for incoming libraries. Co-authored-by: Claude Fable 5 <[email protected]>
Intra-utopia requires move from X.Y.* pins to ^X.Y across cli, http, platform, queue and servers (client and pools already used carets). For 0.x siblings the range is equivalent today, but the style is uniform and minors flow through automatically once packages reach 1.0. servers' broad 'validators 0.*' narrows to ^0.2, matching the released line. Co-authored-by: Claude Fable 5 <[email protected]>
Every uses: ref is upgraded to its latest major (checkout v6, create-github-app-token v3) and pinned to the tag's commit SHA in ratchet's format. The validate job now runs ratchet lint over root and package workflows, so unpinned refs fail CI. Four leftover QA-only codeql workflows (cli, pools, telemetry, validators) are deleted — they invoke the composer check script that QA hoisting removed. Co-Authored-By: Claude Fable 5 <[email protected]>
- 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
Reuse mirror redirect workflow
docs: enforce documentation style with Vale
docs: centralize CODE_OF_CONDUCT and CONTRIBUTING at the monorepo root
chore: stop committing package lock files
Contributor
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
# Conflicts: # composer.json # composer.lock
# Conflicts: # composer.lock
# Conflicts: # LICENSE.md # composer.lock # packages/cli/LICENSE.md # packages/cli/src/Adapter.php # packages/cli/src/Adapters/Generic.php # packages/cli/src/Adapters/Swoole.php # packages/cli/src/CLI.php # packages/cli/src/Task.php # packages/cli/tests/TaskTest.php # packages/console/LICENSE
# Conflicts: # composer.lock
# Conflicts: # composer.lock
Tests for packages/cli run in appwrite/appwrite's CI now, so the utopia-php/monorepo badge no longer reflects them; other absorbed packages keep only the downloads and Discord badges.
TorstenDittmann
approved these changes
Sep 28, 2026
# Conflicts: # composer.lock
This was referenced Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves
utopia-php/cliintopackages/cliso Appwrite loads it directly. Wave 3 of #13828, following the playbook inrfc/monorepo.md.Stacked on #13921 (
servers, whichclirequires). Merge #13921 first; GitHub then retargets this PR tomain. Ifchore/absorb-serversmoves, it is merged in (never rebased).Add 'packages/cli/' from commit '39d590ff…'0.24.4tag Appwrite already locks, and its tree matchespackages/cliinutopia-php/monorepo, so no version gapchore(cli): mirror plumbingmirror.ymlcalls this repository'smirror-redirect.yml; README banner points here;psalm.xmlandphpcs.xmlremovedrefactor: load cli from packages/replaceentries,utopia-php/clidropped fromrequireand the lock, step A shape, standalonephpstan.neon/rector.php, baseline, RFC phase 8 lineStep A
src/CLI/*→src/src/is byte-identical to0.24.4apart from the move and Pint formatting (fn (spacing, two lines)tests/CLI/*→tests/Utopia\Tests→Utopia\CLI\Tests, matching the newautoload-devtests/input.txttestscript; no test reads stdin any more. Script is now plainphpunitrequire-devutopia-php/console0.0.*(unused);swoole/ide-helper4.8.8→6.*, matching the root, for theSwooleadapter's analysisphpunit.xmltests,tests/E2Eexcluded). No test needs Swoole or coroutines, so there is notests/E2Ephpstan.neonsrc+tests(the mirror had only Psalm)rector.phpClassPropertyAssignToConstructorPromotionRectorandReadOnlyPropertyRector. Rector makes no changesphpstan-baseline.neonsrc(unvaluedarraytypes andmixedoffsets inCLI, untyped adapter callbacks), 32 in tests (nullable?Taskfixture inTaskTest). Added to the RFC phase 8 listNothing to hoist: the package requires only
phpandutopia-php/servers(inpackages/via #13921).app/cli.phpis the only directUtopia\CLIuser, but every task andbin/*script runs through it; the still-vendoredplatformrequiresutopia-php/cli, andreplacenow satisfies it.Validation
bin/monorepo validatebin/monorepo check clibin/monorepo test clivendor/bin/phpunit packages/cli/testspackagessuite with--filterneedsigbinary, missing on the host)Utopia\CLI\CLIresolves topackages/cli/src/CLI.php;vendor/utopia-php/cligoneapp/cli.phpandTasks/{Doctor,Maintenance,Migrate,Schedule,Interval}.php: no errorscomposer update --lockchore/absorb-serversdrops onlyutopia-php/cli(plus content hash)composer validate --no-check-publishutopia-php/platformexact-constraint warning)bin/monorepo split cli --dry-runfdd3f77b, fast-forwards from mirror head39d590ff, tree identical topackages/clicomposer lint,git diff --checkMerge and follow-up
Merge after #13921, with a merge commit. A squash drops the
git-subtree-*annotation and orphans the package from its mirror.utopia-php/clialready has themainruleset (id17499608: deletion, non-fast-forward, pull request) with the split app (4016286) as an always-bypass actor, so the absorb ran with--skip-ruleset. There is no classic branch protection onmain.Splitutopia-php/clipackages/clifromutopia-php/monorepo(no open PR there touches it)🤖 Generated with Claude Code