chore: absorb abuse into packages/abuse - #13954
Conversation
chore: upgrade database version
According to the [Appwrite usage of Abuse](https://github.com/appwrite/appwrite/blob/181741d7a2082f5c9d3ca727384601f3cf75e5bf/app/controllers/shared/api.php#LL164C22-L164C22), exception should be thrown when check returns true
Update database
Bump database version
bump update database
Doc: Wrong comparison
bump db version
Update database
Feat: Upgrade DB version
chore bump db update
# Conflicts: # composer.lock
Chore update database
Feat isolation modes
…logs Stopping each master's unordered scan at offset+limit and then sorting/slicing the partial candidate set returned a biased page and could omit keys in range. Scan all masters completely, then sort and slice.
Strategy/token bucket
Strategy/sliding window
🟢 Tier S · Ready to merge
Absorbs the abuse, platform, audit, and usage libraries into Latest changes: The newest commits wire
📂 Walkthrough · 7
Reviewed the commits since |
|
# Conflicts: # composer.lock
✨ 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 # rfc/monorepo.md
# Conflicts: # composer.lock
utopia-php/abuse#124 moved the TimeLimit database adapter onto utopia-php/database 8 (typed Attribute and Index models behind attributes() and indexes()) and made the TablesDB fixture clean up a failed setup. Main absorbed abuse into packages/abuse (#13954), so this applies #124's head (cf0ed5d129) to the package with its tests, adapted to the package layout: main's test namespaces and TablesDBTest name, the schema test in the unit tier, and the discovery test running the PHPUnit that runs it, since the monorepo hoists PHPUnit out of the package. The package requires database ^8.0 with dev stability until 8.0.0 is tagged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Moves
utopia-php/abuseintopackages/abuseso Appwrite loads it directly. Wave 4 of #13828, following the playbook inrfc/monorepo.md.abuseis a standalone repository, so it gets the full playbook. The mirror head (821a188) is the2.0.1release Appwrite already locks, so there is no version gap and Appwrite runs the same code.Caution
The mirror's
mainstill has classic branch protection that will reject the post-mergeSplitpush.utopia-php/abusemainrequires 1 approving review and restricts pushes to theownersteam and@abnegate; the split app is not an allowed actor and classic protection has no bypass for it (admins are not enforced, but the app is not an admin). The new ruleset already lets the app bypass, so an org owner must delete the classic protection onutopia-php/abusemainbefore this PR merges. Not changed by this PR.Merge with a merge commit, not a squash.
Commits
Add 'packages/abuse/' from commit '821a188…'mainwith full historychore(abuse): mirror plumbingmirror.ymlreplacestests.yml,linter.yml,codeql-analysis.yml,bench.yml; issue templates,pint.json,composer.lock,Dockerfile.php-8.4andDockerfile.php-8.5removed; hoisted QA stripped fromcomposer.json; README banner added and the dead Travis badge droppedrefactor: load abuse from packages/What changed
composer.jsonreplaceentries added;utopia-php/abuse: 2.0.*removed fromrequireappwrite/appwrite: ^27.1(the PHP SDK theTablesDBadapter uses, already locked at 27.1.0) added to rootrequire.ext-pdo,ext-curl,ext-rediswere already there;utopia-php/databasestays vendored andutopia-php/poolsis inpackages/composer.lockutopia-php/abuseremoved (+1/−54, content hash)src/src/Abuse/*moved up tosrc/. Byte-identical to2.0.1otherwise (Pint made no changes)tests/Utopia\Tests\…→Utopia\Abuse\Tests\….NoneTestis the unit tier; every Redis, Redis Cluster, Redis pool, MySQL and Appwrite suite moved totests/E2E/. Hosts now come fromtests/E2E/Services.php(offset host ports) instead of compose service names.AppwriteTablesDBTestrenamed toTablesDBTestto match its file, and it skips unlessAPPWRITE_ENDPOINTpoints at a disposable project, so automated runs never call a hosted Appwritetests/bench/tests/Abuse/Bench, excluded from both tiers and from PHPStandocker-compose.ymlutopia-abuse:mysql:8on 13308,redis:7-alpineon 16386,grokzen/redis-clusteron 17010–17015, all with healthchecks. The in-composetestscontainer, the Dockerfiles it built andredis-insightare gonephpunit.xmlunitovertests(excludingE2Eandbench) ande2eovertests/E2Ephpstan.neonsrcandtests, withphpstan-baseline.neonholding 44 findings: 35 insrc(theRedisClusterandRedisPoollog readers of all three strategies, plus onecurl_setopt()argument inReCaptcha), 9 in the e2e tests. Added to the RFC phase 8 list. One unmatched@phpstan-ignore-next-lineremoved fromRedisPoolClusterTestrector.phpAddArrayFunctionClosureParamTypeRector,AddArrowFunctionReturnTypeRector,AddClosureVoidReturnTypeWhereNoReturnRector,ClassPropertyAssignToConstructorPromotionRector,ClosureReturnTypeRector,ClosureToArrowFunctionRector,NullCoalescingOperatorRectorandRemoveUnusedVariableInCatchRectorforsrc, and skipsTimeLimit/Database.phpandTimeLimit/Appwrite/TablesDB.phpentirely because Rector's PHP 8.4 printer drops the parentheses in(new \DateTime())->whenever it reprints themCONTRIBUTING.mdremoved; README's pointer to the nonexistentdata/schema.sqlreplaced withsetup()Validation
bin/monorepo validatebin/monorepo check abusebin/monorepo test abuseTablesDBTest, no endpoint). Compose stack torn down afterwardsvendor/bin/phpunit --testsuite packagesinappwrite/appwrite:2.3.0Utopia\Abuse3 / 6 OK. Unrelated: 5agentsDiffCheckTesterrors (gitcannot resolve a worktree's.gitinside the container) and 1clientSwoole reconnect test that passes on rerunapp/realtime.php,app/init/resources.php,app/controllers/shared/api.php,Workers/Deletes.php,Functions/Http/Functions/Create.php,Mqtt/Handler.phpUtopia\Abuse\Adapters\TimeLimit\Redisresolves topackages/abuse/src/Adapters/TimeLimit/Redis.php; novendor/utopia-php/abusecomposer validate --no-check-publishutopia-php/platformexact-version warning)composer lintbin/monorepo split abuse --dry-run8b93c40, fast-forward of the mirror head821a188(+2 commits)git diff --checkMirror state
absorbcreated the canonicalmainruleset (id24125972) with the split app as always-bypassmainownersand@abnegate, admins not enforced. BlocksSplit; must be removed before merge (see the caution above)After merge
utopia-php/abusemainSplitrun forabuseis green and the mirror fast-forwards from821a188TimeLimitschema to the query library'sAttributeandIndexvalue objects. Port here againstpackages/abuse(andpackages/query), then close with a pointerRedisPool. Port here if still wanted, then close with a pointer^27.1. Closeabuseinutopia-php/monorepo🤖 Generated with Claude Code