Repository navigation
Conversation
|
@greptile-apps review |
|
@greptileai review the current head 394aa7f. The September 4 request using the older bot handle did not start a review; this uses the currently documented trigger. |
|
@greptileai review |
|
The schema assertions pinned attribute counts, array positions, column types, sizes, filters, index types and index column ordering straight off the adapter's getAttributes()/getIndexes(). That mirrors the source rather than testing it: the repository requires observable behaviour, and these lines only ever compared the schema definition against a second copy of itself. Every deleted property is already covered through the public API, proven by breaking each one and watching a behavioural test go red: dropping the json filter on data, dropping the datetime filter on time, making idx_userId_event unique and making userId required each fail the existing write/read tests. Index column ordering is the one property with no observable behaviour at all -- swapping it reaches the real DDL and every test still passes -- so no assertion can guard it. userId's size was the only property not otherwise reachable, so it is replaced rather than dropped: testUserIdAcceptsFullKeyLength writes a key-length user id and reads it back, which fails once the column shrinks. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@greptileai review |
d7bd655 to
4e53dd5
Compare
|
Both findings addressed at Finding 1 — tests mirror schema internals: fixed.
That last row is the interesting one. The swap reaches the real DDL ( One property was not otherwise reachable, so it is replaced rather than dropped: The ClickHouse geo flags are fully subsumed by the existing Finding 2 — The premise is right (nothing under // vendor/utopia-php/database/src/Database/Database.php:1442
private function getEventContext(): int
{
$context = Coroutine::getCid();
I pushed the removal first and CI proved it: The real fix belongs upstream (guard line 1442 like 2848, or declare Verified at |
|
@greptileai review |
Picks up the Validators ^1.0 requirement from main so packages/audit no longer drifts from the sibling constraint. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ride CLAUDE.md requires packages to depend on siblings through Packagist constraints. Packagist already serves every branch of utopia-php/database, including feat-query-lib, so the repository override bought nothing and pinned resolution to whatever commit the last lock captured. Without it composer resolves the branch head directly. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Utopia\Audit\Query re-declared its 25 legacy TYPE_* method names as string literals, duplicating values that utopia-php/query's Method enum owns (review finding 10.11). They match today, but nothing tied the two together: if query changed a case's value, the constants would keep the old string with no error anywhere. A query built from one would then throw in Method::from(), and a comparison with getMethod()->value would quietly turn false. Each constant is now Method::X->value, so a changed value carries over on its own, and a renamed or removed case fails PHPStan at the constant and throws on the first Query instantiation. The values and the public API are unchanged; the constants stay untyped, so a subclass that redeclares one still compiles. QueryTest gains a parity test asserting that every TYPE_* constant is a Method value. It passes before and after this change because the values match; it fails as soon as a literal falls out of step with the enum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🔍 OpenCodeReview found 2 issue(s) in this PR.
|
|
Audit now lives in |
utopia-php/monorepo#206 prepared audit 5.0.0 for utopia-php/database 8: the adapters read attributes and indexes as typed Attribute and Index models, and the legacy TYPE_* constants come from Method. Main absorbed audit into packages/audit (#13955) and the monorepo closed #206 in favour of a change here, so this applies #206's candidate (mirror head f8422f9cbf) to the package, line for line, with its tests. Main's utopia-php/client transport stays; the train only touched the schema code around it. getAttribute() now declares ?Attribute, so its not-found branch returns null explicitly, and two baseline entries go with the errors the port removes. The package requires database ^8.0 with dev stability until 8.0.0 is tagged, because bin/monorepo check and test resolve it from Packagist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Canonical continuation of utopia-php/audit#133 in
packages/audit, following the approved move to the monorepo. audit#133 is closed in favour of this.dev-feat-query-libbranch from Packagist, with no VCS repository override and no inline alias; declare PDO MySQL and Swoole test extensions.Dependency shape
CLAUDE.mdrequires packages to depend on siblings through Packagist constraints rather than repository overrides. The branch originally carried arepositoriesentry pointing atgithub.com/utopia-php/database.git; that is removed. Packagist already publishes every branch ofutopia-php/database,dev-feat-query-libincluded, so"utopia-php/database": "dev-feat-query-lib"resolves on its own — and resolves to the branch head rather than to whatever commit an override happened to capture.utopia-php/validatorsis^1.0here, matchingmainsince #251.Blocked on
utopia-php/databaseis still a branch requirement, which is the one thing here that is not a released constraint. It becomes^8.0(or whatever utopia-php/database#823 tags as) the moment that PR is merged and tagged, and this PR should not land before then. Nothing else in this branch is waiting on anything.Verification
Both registry and linked modes passed:
Pint, PHPStan, Rector, Composer validation and monorepo validation passed.
composer update --dry-runinpackages/auditwith the override removed resolvesutopia-php/database (dev-feat-query-lib 11f8380)plusquery 0.6.1,validators 1.0.1andasync 0.1.1, all from Packagist.No package split, release, tag or merge has been performed.
Fixes from the 2026-09-23 review
The audit
Queryconstants now come from the query library (10.11).Utopia\Audit\Queryre-declared its 25 legacyTYPE_*constants (TYPE_EQUAL…TYPE_CURSOR_BEFORE) as string literals that copiedUtopia\Query\Method's values.Each one is now
Method::X->value:Querythrows the first time it is used.QueryTest::testConstantMatchesMethodchecks that everyTYPE_*constant is aMethodvalue.Commits
🤖 Generated with Claude Code