Skip to content

Absorb database, mongo and migration into packages/ (wave 6) #14255

Open

Description

@ChiragAgg5k

Wave 6 of #13828: move the last vendored Utopia libraries into packages/, so that composer.lock has no utopia-php/* packages left. Deferred to next week.

1. mongo + database (one PR)

The work is done on branch chore/absorb-database (head 9f26684), from #14242. That PR is closed for now, not abandoned. Reopen it, or open a new PR from the same branch, then merge main in and re-run CI. It passed all 260 checks and was approved by hansi and tenki on 2026-10-08.

What it does:

  • Subtree imports of utopia-php/mongo (1.5.4, the locked version) and utopia-php/database (mirror main: 7.4.1 plus the unreleased Postgres-only fix fix(postgres): let distanceLessThan use the spatial index utopia-php/database#1001), with full history.
  • Library source: src/ is byte-identical to the imported code. Rector is skipped for both packages until phase 8.
  • Root composer.json: ramsey/uuid: 4.9.* and ext-mongodb: * are hoisted into require. The lock only drops utopia-php/database 7.4.1 and utopia-php/mongo 1.5.4.
  • Package tests:
    • Moved from PHPUnit 9 to 12, editing tests only.
    • Four cache test doubles now accept cache 5.1's $ttl.
    • E2E runs inside the compose network via tests/e2e.sh on appwrite/base:2.1.0.
  • Swoole: mongo requires ext-swoole, and database suggests it.
  • PHPStan baselines: database 4,865 findings, mongo 420. mongo's tests/ClientTest.php is excluded from analysis. Both are listed for phase 8.
  • CI: the widened E2E matrix now fires on PRs that touch packages/database/ or packages/mongo/, not on lock changes.

Before merging:

  • Merge main into chore/absorb-database and resolve composer.json / composer.lock. Re-check that the lock diff drops only the two packages.
  • Re-run CI (all jobs). Two E2E tests were flaky on the last run: MariaDB (shared) testUpdateAccountEmailSearch and MongoDB (shared) Realtime testIndexesTablesAPI.
  • If utopia-php/database or utopia-php/mongo released or merged anything since 2026-10-08, re-import the new head (bin/monorepo absorb from the mirror) instead of carrying a stale copy.
  • Merge with a merge commit (absorb label). A squash drops the git-subtree-* annotation and orphans both packages from their mirrors.

After merging:

2. migration

  • Absorb utopia-php/migration (2.0.8 locked) with the same playbook. Set utopia-php/dsn to ^1.0. Hoist halaxa/json-machine and appwrite/appwrite (the PHP SDK). Triage its ~20 open PRs.
  • Merge with a merge commit, then confirm Split.
  • Cloud drops its own utopia-php/migration requirement (its last direct utopia-php/* one) and takes it through server-ce.

Exit: jq '.packages[] | select(.name|startswith("utopia-php/"))' composer.lock returns nothing.

Activity

  1. added
    backlog
    absorb
    on Oct 8, 2026
  2. added
    product / databases
    product / messaging
    product / migrations
    product / vcs
    on Oct 8, 2026
  3. removed
    product / messaging
    product / vcs
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    absorbbacklogproduct / databasesproduct / migrations

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions