chore: mark Row response model's param with readonly#10409
Conversation
📝 WalkthroughWalkthroughThe change updates the Row model constructor (src/Appwrite/Utopia/Response/Model/Row.php) by adding readOnly => true to three field rules: $sequence (auto-incrementing ID), $tableId (Table ID), and $databaseId (Database ID). No other logic or files are modified. Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.1.17)Note: Using configuration file /phpstan.neon. If the excluded path can sometimes exist, append (?) parameters: Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/Appwrite/Utopia/Response/Model/Row.php (2)
60-71: Consider marking timestamps as read-only for consistency$createdAt and $updatedAt are server-managed; marking them read-only matches typical Document behavior and avoids client-side confusion.
->addRule('$createdAt', [ 'type' => self::TYPE_DATETIME, 'description' => 'Row creation date in ISO 8601 format.', 'default' => '', 'example' => self::TYPE_DATETIME_EXAMPLE, + 'readOnly' => true, ]) ->addRule('$updatedAt', [ 'type' => self::TYPE_DATETIME, 'description' => 'Row update date in ISO 8601 format.', 'default' => '', 'example' => self::TYPE_DATETIME_EXAMPLE, + 'readOnly' => true, ])
33-38: Confirm intent for $id mutabilityDocument allows client-provided $id on create; should Row behave the same? If not, consider marking $id as read-only for parity with server-generated IDs here.
Happy to follow up with a small patch once you confirm the intended behavior.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (12)
app/config/specs/open-api3-1.8.x-client.jsonis excluded by!app/config/specs/**app/config/specs/open-api3-1.8.x-console.jsonis excluded by!app/config/specs/**app/config/specs/open-api3-1.8.x-server.jsonis excluded by!app/config/specs/**app/config/specs/open-api3-latest-client.jsonis excluded by!app/config/specs/**app/config/specs/open-api3-latest-console.jsonis excluded by!app/config/specs/**app/config/specs/open-api3-latest-server.jsonis excluded by!app/config/specs/**app/config/specs/swagger2-1.8.x-client.jsonis excluded by!app/config/specs/**app/config/specs/swagger2-1.8.x-console.jsonis excluded by!app/config/specs/**app/config/specs/swagger2-1.8.x-server.jsonis excluded by!app/config/specs/**app/config/specs/swagger2-latest-client.jsonis excluded by!app/config/specs/**app/config/specs/swagger2-latest-console.jsonis excluded by!app/config/specs/**app/config/specs/swagger2-latest-server.jsonis excluded by!app/config/specs/**
📒 Files selected for processing (1)
src/Appwrite/Utopia/Response/Model/Row.php(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/Appwrite/Utopia/Response/Model/Row.php (1)
src/Appwrite/Utopia/Response/Model.php (1)
addRule(87-99)
🔇 Additional comments (3)
src/Appwrite/Utopia/Response/Model/Row.php (3)
44-45: Good: $sequence marked read-onlyCorrect for an auto-incremented field; prevents client writes and matches filter() casting.
Please regenerate the API spec/SDKs to ensure $sequence is excluded from create/update inputs.
51-52: Good: $tableId marked read-onlyConsistent with path-param semantics and Document model behavior.
58-59: Good: $databaseId marked read-onlyAlso aligns with path-param semantics and Document model behavior.
Security Scan Results for PRDocker Image Scan Results
Source Code Scan Results🎉 No vulnerabilities found! |
commit: |
✨ Benchmark results
⚡ Benchmark Comparison
|
What does this PR do?
same behaviour as Document
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)
Related PRs and Issues
Checklist