chore: absorb smtp into packages/smtp by ChiragAgg5k · Pull Request #13829 · appwrite/appwrite · GitHub
Skip to content

chore: absorb smtp into packages/smtp - #13829

Merged
ChiragAgg5k merged 9 commits into
mainfrom
feat/absorb-smtp
Sep 22, 2026
Merged

ChiragAgg5k merged 9 commits into
mainfrom
feat/absorb-smtp

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Move utopia-php/smtp into packages/smtp so Appwrite loads it directly, the first step of the messaging chain in #13828 (smtp → telemetry → pools → client + span → messaging). Three commits, per the playbook in rfc/monorepo.md:

  1. Add 'packages/smtp/' from commit '7115e54d…': subtree import from the mirror with full history. The mirror head is byte-identical to the 0.2.0 tag Appwrite already locks, so nothing in the dependency graph moves.
  2. chore(smtp): mirror plumbing: mirror.yml pointed here, README banner refreshed.
  3. refactor: load smtp from packages/: root autoload and replace entries, utopia-php/smtp dropped from the lock (it was only ever transitive, through messaging). Step A of the standard shape: tests/Unit flattened to tests/ under Utopia\SMTP\Tests, the Mailpit e2e tier kept in tests/E2E with its compose file and test:e2e script, phpstan.neon made standalone (it used to include the old monorepo's root config, which validate rejects), rector.php made standalone with the same prepared sets it had minus phpunitCodeQuality (needs a package-local installed.json) and rectorPreset (annotated source classes with their test class names on chore: absorb telemetry, system, psr7 and smtp into packages/ #13721). Rector is clean on arrival, so production changes are Pint formatting only.

Nothing to hoist: the package requires only PHP. Appwrite reaches it in one file directly (Project/Http/Project/SMTP/Update.php), which root PHPStan is clean on.

Validation

  • bin/monorepo validate: all packages valid
  • bin/monorepo check smtp: Rector, Pint and PHPStan level max on src and tests, no baseline
  • bin/monorepo test smtp: unit 194 tests / 858 assertions, e2e 28 tests / 606 assertions against Mailpit
  • vendor/bin/phpunit --testsuite packages --filter 'Utopia\\SMTP\\Tests': 194 tests green under the root autoloader
  • composer validate --no-check-publish: existing exact-version warnings only; composer dump-autoload without PSR-4 warnings
  • bin/monorepo split smtp --dry-run: 18cf7983c21be42c4a6681387bdefb49fd6ae723
  • git diff --check

The full --testsuite packages run segfaults on this macOS host (Swoole 6 + PHP 8.5) right after packages/lock's coroutine test, with and without smtp present, so it is not introduced here; the Linux runner decides.

Merge and follow-up

Merge with a merge commit, not squash, to preserve the subtree annotation the split continues from.

The utopia-php/smtp mirror already carries the canonical main ruleset (id 20795955) with the split app as an always-bypass actor, verified after the fact with an owner role; no ruleset change was needed.

After merge: confirm Appwrite's Split pushes to utopia-php/smtp, then remove packages/smtp from utopia-php/monorepo and regenerate its graph in a follow-up PR. No open PRs on the smtp mirror.

Part of #13828.

eldadfux and others added 9 commits May 21, 2026 21:11
smtp: absorb the library and stub the package
smtp: implement the client, the message builder and both transports
smtp: give failures a hierarchy, and waits their own budgets
chore: stop committing package lock files
…stale-session

fix(smtp): let a holder reuse a connection the server may have closed
…d68d6'

git-subtree-dir: packages/smtp
git-subtree-mainline: e87177f
git-subtree-split: 7115e54
Point mirror.yml and the README banner at appwrite/appwrite so PRs and issues opened on the mirror are redirected here.
Appwrite now autoloads Utopia\SMTP from packages/smtp and replaces
utopia-php/smtp so the vendored copy is no longer installed. The
package needs no third-party requirements hoisted and no version bump:
the mirror head is the 0.2.0 tag the lock already resolved.

Shape follows rfc/monorepo.md step A: the unit tier moves from
tests/Unit to tests/ under Utopia\SMTP\Tests, the Mailpit e2e tier
stays in tests/E2E, and phpstan.neon and rector.php no longer reach for
the old monorepo root configs. Source changes are Pint formatting only.
@ChiragAgg5k ChiragAgg5k added the absorb History-preserving package absorption; merge commit required label Sep 22, 2026
@greptile-apps

greptile-apps Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Comment thread packages/smtp/src/Address.php
Comment thread packages/smtp/tests/E2E/ClientTest.php
@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → feat/absorb-smtp (after).

Metric Before After Change
🚀 Requests/sec 202.74 203.43 ⚪ +0.3%
⏱️ Latency P50 86.14 ms 86.13 ms ⚪ 0%
⏱️ Latency P95 199.28 ms 195.24 ms ⚪ -2%
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 86.13 195.24 12,597 203.43 -4.04
Account 162.28 285 663 11.2 -10.86
TablesDB 84.15 154.18 6,851 112.23 -3.62
Storage 78.05 164.87 3,315 56.48 -8.84
Functions 122.4 232.93 1,768 30.77 -5.66

Top API waits (after)

API request Max wait (ms)
account.prefs.update 499.45
account.name.update 380.5
tablesdb.rows.increment 354.93
functions.create 338.97
functions.variables.update 338.9

@loks0n

loks0n commented Sep 22, 2026

Copy link
Copy Markdown
Member

@ChiragAgg5k
ChiragAgg5k merged commit 32ea8b5 into main Sep 22, 2026
67 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the feat/absorb-smtp branch September 22, 2026 11:14
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.

3 participants