Add missing bucket and function migration properties#164
Add missing bucket and function migration properties#164premtsd-code wants to merge 1 commit intomainfrom
Conversation
Add transformations property to Bucket migration and commands, logging, scopes, specification properties to Function migration for both source export and destination import.
WalkthroughThis PR extends the Appwrite migration tool to support additional resource attributes for storage buckets and functions. It adds a Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/Migration/Destinations/Appwrite.php (1)
1466-1470: Parameter order is correct; recommend applying null-handling toscopesfor consistency.The
Functions::createcall matches the SDK v19 signature correctly. The suggestion to apply?: nullfor emptyscopesis valid—the parameter accepts?array = nulland converting empty arrays to null will omit the parameter from the API call, consistent with howspecificationis already handled.♻️ Suggested change for scopes handling
$this->functions->create( $resource->getId(), $resource->getFunctionName(), $runtime, $resource->getExecute(), $resource->getEvents(), $resource->getSchedule(), $resource->getTimeout(), $resource->getEnabled(), $resource->getLogging(), $resource->getEntrypoint(), $resource->getCommands(), - $resource->getScopes(), + $resource->getScopes() ?: null, specification: $resource->getSpecification() ?: null, );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Migration/Destinations/Appwrite.php` around lines 1466 - 1470, In the Functions::create call ensure empty scopes are converted to null for consistency with specification handling: replace the $resource->getScopes() argument with a null-coalescing fallback (e.g., $resource->getScopes() ?: null) so the SDK receives null instead of an empty array and the parameter is omitted from the API request.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/Migration/Destinations/Appwrite.php`:
- Around line 1466-1470: In the Functions::create call ensure empty scopes are
converted to null for consistency with specification handling: replace the
$resource->getScopes() argument with a null-coalescing fallback (e.g.,
$resource->getScopes() ?: null) so the SDK receives null instead of an empty
array and the parameter is omitted from the API request.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bcd66ba0-1ce3-4840-8735-e72c11353c24
📒 Files selected for processing (4)
src/Migration/Destinations/Appwrite.phpsrc/Migration/Resources/Functions/Func.phpsrc/Migration/Resources/Storage/Bucket.phpsrc/Migration/Sources/Appwrite.php
Summary
transformationsproperty to Bucket resource (source export + destination import)commands,logging,scopes,specificationproperties to Function resource (source export + destination import)Summary by CodeRabbit