Skip to content

Add missing bucket and function migration properties#164

Open
premtsd-code wants to merge 1 commit intomainfrom
add-bucket-func-properties
Open

Add missing bucket and function migration properties#164
premtsd-code wants to merge 1 commit intomainfrom
add-bucket-func-properties

Conversation

@premtsd-code
Copy link
Contributor

@premtsd-code premtsd-code commented Mar 13, 2026

Summary

  • Add transformations property to Bucket resource (source export + destination import)
  • Add commands, logging, scopes, specification properties to Function resource (source export + destination import)

Summary by CodeRabbit

  • New Features
    • Storage buckets now support transformations configuration for enhanced image and file processing capabilities.
    • Functions now support extended configuration including logging, commands, scopes, specification, and entrypoint parameters for improved deployment flexibility and control.

Add transformations property to Bucket migration and commands, logging, scopes, specification properties to Function migration for both source export and destination import.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2026

Walkthrough

This PR extends the Appwrite migration tool to support additional resource attributes for storage buckets and functions. It adds a transformations boolean field to the Bucket resource and introduces four new properties to the Func resource (commands, logging, scopes, specification). These additions are propagated through resource constructors, serialization/deserialization methods, getter accessors, and the corresponding export/import call sites in the Appwrite source and destination handlers.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding missing properties (transformations for buckets, and commands/logging/scopes/specification for functions) to migration resources.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-bucket-func-properties
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/Migration/Destinations/Appwrite.php (1)

1466-1470: Parameter order is correct; recommend applying null-handling to scopes for consistency.

The Functions::create call matches the SDK v19 signature correctly. The suggestion to apply ?: null for empty scopes is valid—the parameter accepts ?array = null and converting empty arrays to null will omit the parameter from the API call, consistent with how specification is 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

📥 Commits

Reviewing files that changed from the base of the PR and between 95dcbb9 and 73c464a.

📒 Files selected for processing (4)
  • src/Migration/Destinations/Appwrite.php
  • src/Migration/Resources/Functions/Func.php
  • src/Migration/Resources/Storage/Bucket.php
  • src/Migration/Sources/Appwrite.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants