Repository navigation
chore: bump utopia-php/audit to 4.0.0 and utopia-php/usage to 0.15.0 - #13361
Merged
Merged
Conversation
Reapplies #13332, which was reverted in #13356. Same change, rebased onto current main; the lock needed no further resolution. Both libraries moved to utopia-php/query 0.6, which replaces the `Query::TYPE_*` string constants with the `Utopia\Query\Method` enum. They have to be bumped together: audit 4.0 and usage 0.15 both require `utopia-php/query: 0.6.*`, while the locked audit 3.0.2 and usage 0.14.0 both require `0.1.*`, so pinning either alone leaves the tree unresolvable. (`"utopia-php/usage": "^0.14.0"` also excludes 0.15.0 on its own — Composer's caret on a 0.x version only allows the patch range.) Lock diff is exactly three packages: audit 3.0.2 -> 4.0.0, usage 0.14.0 -> 0.15.0, query 0.1.1 -> 0.6.0. The usage endpoints follow the enum: `VALID_FILTER_METHODS` holds `Method` cases, and `parseFilterQueries()` compares against them directly. The old `in_array($query->getMethod(), $allowedMethods, true)` compared an enum to strings, which is always false, so every filter query would have been rejected.
Contributor
Greptile SummaryThe PR upgrades
Confidence Score: 5/5The PR appears safe to merge because no concrete changed-code failure remains. The dependency constraints move together as required, and the usage filter paths consistently compare Query 0.6 Method enum cases while rendering their backed string values in errors. Important Files Changed
Reviews (1): Last reviewed commit: "chore: bump utopia-php/audit to 4.0.0 an..." | Re-trigger Greptile |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
ChiragAgg5k
approved these changes
Aug 26, 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.
What does this PR do?
Reapplies #13332, which was reverted in #13356. Same change, rebased onto current main — the lock needed no further resolution (
composer updateon the three packages reported "Nothing to modify in lock file").Bumps
utopia-php/auditto 4.0.0 andutopia-php/usageto 0.15.0.They have to move together. Both moved to
utopia-php/query0.6; audit 4.0 and usage 0.15 each requireutopia-php/query: 0.6.*, while the currently locked audit 3.0.2 and usage 0.14.0 both require0.1.*. Bumping either alone leaves the tree unresolvable:(Note
"utopia-php/usage": "^0.14.0"excludes 0.15.0 on its own — Composer's caret on a0.xversion only allows the patch range.)The lock diff is exactly three packages —
audit 3.0.2 → 4.0.0,usage 0.14.0 → 0.15.0,query 0.1.1 → 0.6.0. Nothing else moves.Code changes
The audit surface needed no changes — CE only calls
new Audit(new AdapterDatabase($db))and->setup(), and both signatures are identical between 3.0.2 and 4.0.0.The usage endpoints did need adapting, in
src/Appwrite/Platform/Modules/Usage/Http/:VALID_FILTER_METHODSinEvents/XList.phpandGauges/XList.phpreferencedQuery::TYPE_EQUALand friends. Those constants no longer exist in query 0.6, so accessing them throwsError: Undefined constant. They now holdMethodenum cases.Action.php::parseFilterQueries()compared$query->getMethod()— now aMethodenum — against that list of strings within_array(..., true). That comparison is always false, so once the constants existed again every filter query on/usage/eventsand/usage/gaugeswould have been rejected withGENERAL_QUERY_INVALID. It now compares enum to enum, and the error messages render$method->value(interpolating the enum itself would have been aTypeError).Test Plan
Run on this branch against current main, with vendor installed from the updated lock:
composer validate— passes; lock is in sync withcomposer.json.composer check(phpstan, full config) — No errors. It reported 13 before the code changes, which is how both issues above were found.composer lint(pint) on the three changed files — passes.vendor/bin/phpunit tests/unit/Platform— 254 tests, 832 assertions, all pass.Every CE call site into both libraries was checked against the released tags:
Audit::__construct,Audit::setup,Adapter\Database::__construct, andUsageQuery::{parse,aggregate,groupBy,groupByInterval}are unchanged.UsageQuery::parse()is inherited from the baseQuery, and its new$allowRawargument is defaulted, so the existing call still resolves. The nineUsageQuerystatics removed in 0.15.0 (extractGroupBy,isAggregate,removeGroupBy, …) have no callers in CE.Worth a reviewer's eye on the filter-method change specifically, since that path is only covered by e2e tests, which need a running stack.
Related PRs and Issues
Checklist