Skip to content

chore: absorb queue into packages/queue - #13931

Merged
ChiragAgg5k merged 391 commits into
mainfrom
chore/absorb-queue
Sep 28, 2026
Merged

ChiragAgg5k merged 391 commits into
mainfrom
chore/absorb-queue

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Summary

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

Stacked on #13921 (servers, which queue requires). Merge after #13921, with a merge commit; GitHub retargets this PR to main once #13921 lands.

Commit What
Add 'packages/queue/' from commit '445087c3…' Subtree import of the mirror's main with full history
chore(queue): mirror plumbing mirror.yml calls this repository's mirror-redirect.yml; README banner points here. No banned files to strip
refactor: load queue from packages/ Root autoload + replace, utopia-php/queue dropped from require and the lock, step A shape, standalone phpstan.neon / rector.php, baseline, RFC phase 8 line, validate accepts Dockerfiles under tests/E2E/
test(queue): skip NATS broker tests when utopia-php/nats is absent #[RequiresMethod] on the two unit tests that build Broker\Nats, so the root packages suite skips them (Appwrite does not install utopia-php/nats)

Version gap

Appwrite locked 6.0.0 (723f758f). The mirror head 445087c3 is 6.1.0 plus one unreleased merge (#354, releaseDelay for NATS). All three commits touch only Broker/Nats.php, its e2e tests and the README. Appwrite does not use the NATS broker, so nothing changes at runtime.

Step A

Change Detail
src/Queue/* → src/ Identical to the mirror head apart from the move and Pint formatting (empty {} bodies expanded in 9 files)
tests/Queue/Unit/* → tests/ Namespace Tests\Unit → Utopia\Queue\Tests
7 service-free tests in tests/Queue/E2E/Adapter → tests/ ConsumerResilience, KubernetesJobAdapter, Background, Locking, RedisReconnectCallback, ServerTelemetry, SwooleConcurrency plus MemoryConsumer. Upstream already ran them in its unit suite
Rest of tests/Queue/E2E/Adapter → tests/E2E/ Namespace Utopia\Queue\Tests\E2E
tests/Queue/servers → tests/E2E/servers Worker, proxy and KEDA fixtures; paths updated in e2e.sh, keda-*.sh, the KEDA Dockerfile and two tests
phpunit.xml PHPUnit 12 shape: unit = tests minus E2E/bench, e2e = tests/E2E
phpstan.neon Standalone, level max over src + tests (previously included the monorepo root at level 5)
rector.php PHP sets + type declarations; skips ClassPropertyAssignToConstructorPromotionRector, ReadOnlyPropertyRector and tests/bench. No changes
phpstan-baseline.neon 296 findings: 162 in src, 134 in tests. Added to the RFC phase 8 list
bin/monorepo validate Dockerfiles under tests/E2E/ are e2e fixtures (keda-lib.sh builds the KEDA worker image from one); RFC rule 5 updated to match

Nothing to hoist: require is php plus di lock pools servers telemetry validators, all in packages/. require-dev (utopia-php/nats, workerman/workerman, swoole/ide-helper) stays package-local.

Validation

Check Result
bin/monorepo validate all packages valid
bin/monorepo check queue Rector, Pint, PHPStan level max (with baseline) pass
Package unit tier (phpunit --testsuite unit, appwrite/appwrite:2.3.0) 153 tests / 341 assertions, same as the mirror's unit suite
Package e2e tier (tests/e2e.sh against the package compose, project absorb-queue, torn down) 161 tests / 783 assertions, 2 skipped (KEDA not provisioned locally)
Root phpunit --testsuite packages --filter 'Utopia\\Queue' 153 tests, 20 skipped (NATS)
Appwrite tests/unit/Platform/Workers, tests/unit/Event, tests/unit/Bus 55 / 23 / 3 tests pass
Host PHPStan on app/worker.php, src/Appwrite/Platform/Workers, src/Appwrite/Event no errors
composer update --lock lock diff vs chore/absorb-servers drops only utopia-php/queue (plus content hash)
composer validate --no-check-publish valid (only the existing utopia-php/platform exact-constraint warning)
bin/monorepo split queue --dry-run 70d17cfe, fast-forwards from mirror head 445087c3 (3 commits), tree identical to packages/queue
git diff --check clean

The unit tier segfaults under macOS host Swoole (BackgroundTest::testStartRequiresCoroutineRuntime) on the mirror's own checkout too, so it was run in the Linux image.

Merge and follow-up

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

utopia-php/queue already has the canonical main ruleset (id 17500068) with the split app (4016286) as an always-bypass actor, so the absorb ran with --skip-ruleset. The mirror also has classic branch protection on main (1 required approval, split app in the PR-review bypass list). Left as is.

After merge
Confirm Split pushes to utopia-php/queue
Retire remove packages/queue from utopia-php/monorepo
Triage monorepo utopia-php/monorepo#339 (middleware hooks that end a message without failing it) touches packages/queue: re-open here or close
Triage mirror utopia-php/queue#29 (auth with password, 2025-01) and utopia-php/queue#24 (concurrency manager, 2024-11), both stale PRs; no open issues

🤖 Generated with Claude Code

byawitz and others added 30 commits July 4, 2024 14:02
feat: add redis cluster adapter
Co-authored-by: Christy Jacob <[email protected]>
Inject workerId as resource, record received timestamp
feat(amqp): allow configuration of queue arguments
feat(amqp): allow configuration of connection and channel
fix(amqp): use channel callable, reconnect on error
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

✨ Benchmark results

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

Metric Before After Change
🚀 Requests/sec 182.07 167.83 🔴 -7.8%
⏱️ Latency P50 93.92 ms 102.43 ms 🔴 +9.1%
⏱️ Latency P95 225.72 ms 244.76 ms 🔴 +8.4%
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 102.43 244.76 10,545 167.83 +19.04
Account 206.86 396.53 555 9.16 +60.87
TablesDB 98.72 183.23 5,735 93.19 +1.26
Storage 92.84 198.48 2,775 46.79 +18.45
Functions 151.04 289.27 1,480 25.75 +15.15

Top API waits (after)

API request Max wait (ms)
account.prefs.update 489.07
tablesdb.rows.create 484.04
account.name.update 482.92
functions.variables.update 472.09
tablesdb.rows.increment 431.94

@ChiragAgg5k
ChiragAgg5k changed the base branch from chore/absorb-servers to main September 27, 2026 12:19
Comment thread packages/queue/tests/ServerJobsTest.php Resolved
Comment thread packages/queue/tests/bench/consume.php Resolved
@ghost

ghost commented Sep 28, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The incremental runtime/template and SDK-tracking changes appear consistent with their consumers and tests, and no concrete regression was found.

Absorbs utopia-php/queue into packages/queue, wires its source, tests, package QA, and mirror workflow into the monorepo, and updates the E2E fixtures and validation rules. The new commits also update function-template runtime/provider settings and normalize API-key SDK tracking, including Terraform integrations. The changes reviewed here introduce no issue requiring a finding.

Latest changes: The newest commits exclude outdated runtimes from function templates, bump template providers to 1.2.0, add Node 22 to the default function runtime list, and record lowercased SDK display names plus Terraform integrations on API keys.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 8
File Change
composer.json, composer.lock Autoloads the absorbed queue package directly and replaces/removes its external Composer dependency.
packages/queue/** Adds the queue package source, reorganized unit and E2E tests, fixtures, standalone QA configuration, documentation, and mirror plumbing.
bin/monorepo, rfc/monorepo.md Allows E2E fixture Dockerfiles during package validation and records the queue package in the monorepo plan.
app/config/templates/function.php, app/config/variables.php Updates function-template provider versions, filters runtimes that do not support the current template SDKs, and adds Node 22 to the default runtime list.
app/controllers/shared/api.php, app/init/constants.php, app/init/resources.php Normalizes SDK names before API-key tracking and includes Terraform in the accepted server-side integrations.
tests/e2e/Services/Projects/ProjectsConsoleClientTest.php Covers tracking display-case SDK names and the Terraform integration on API keys.
composer.json Registers the queue source and tests for direct monorepo autoloading, replaces the package, and removes it as a Composer dependency.
bin/monorepo Allows Dockerfiles within package E2E fixtures during package validation.

Reviewed the commits since 9d9e128 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Tier S · Looks good to merge. Summary

Comment thread packages/queue/tests/LockingTest.php Resolved
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.