chore: replace utopia-php/framework with standalone packages#837
chore: replace utopia-php/framework with standalone packages#837
Conversation
…opia-php/console Remove the heavy framework dependency in favor of the lightweight standalone packages that this library actually uses. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdated dependencies and Console import namespaces; narrowed tenant types to strings and added per-document tenant extraction/propagation and validation in shared-table database flows. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Database
participant Adapter
participant Document
Client->>Database: createDocument(document)
Note right of Database: Shared Tables + Tenant-per-Document
Database->>Document: doc->getTenant()
alt tenant is null and required
Database-->>Client: throw missing tenant error
else tenant present
Database->>Document: set internal '$tenant' = (string)tenant
Database->>Adapter: setTenant(string tenant)
Database->>Adapter: persist document (includes '$tenant')
Adapter-->>Database: persist result
Database-->>Client: return created document
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CLI 0.22 no longer depends on utopia-php/framework, removing it from the dependency tree entirely. Console moved to the standalone utopia-php/console package. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
setTenant() accepts int|string|null but PDO returns tenant as a string after storage. The strict !== comparisons in getCollection() then fail because (int)1 !== "1", causing "Collection not found" errors. The Sequence validator also rejects integer tenant values since $tenant has type VAR_ID which requires strings. Cast tenant to string in Adapter::setTenant(), Document::getTenant(), and the tenantPerDocument document paths. Skip Sequence validation for $tenant since it's a user-provided identifier, not a sequence-generated ID. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ac7da4f to
a0b48ed
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/Database/Document.php`:
- Around line 175-183: Update the docblock for the getTenant method to match its
native signature: change the `@return` annotation from "int|string|null" to
"string|null" so the PHPDoc aligns with the native return type declared on the
getTenant() method.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 128641c6-7a0d-4997-99bb-47a0e483f2e0
📒 Files selected for processing (4)
src/Database/Adapter.phpsrc/Database/Database.phpsrc/Database/Document.phpsrc/Database/Validator/Structure.php
🚧 Files skipped from review as they are similar to previous changes (2)
- src/Database/Adapter.php
- src/Database/Database.php
Summary
utopia-php/frameworkdependency withutopia-php/validators(0.2.) andutopia-php/console(0.1.) — the only parts of the framework this library actually usesUtopia\CLI\Consoleimports toUtopia\Consolein src and testsTest plan
composer installresolves dependencies correctlybin/CLI scripts still work (they useutopia-php/clifrom dev dependencies)🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Bug Fixes
Maintenance