Skip to content

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Nov 19, 2025

Summary

This PR adds support for configuring image transformations at the bucket level through the settings page. Users can now enable or disable image transformations for individual buckets.

Changes

  • ✨ Added transformations toggle switch in bucket settings UI
  • 🔧 Updated updateBucket function to include transformations parameter
  • 📊 Added BucketUpdateTransformations analytics event for tracking
  • 📝 Added descriptive text explaining image transformation capabilities

Features

The new "Image transformations" section allows users to:

  • Enable/disable on-the-fly image manipulation through the Appwrite API
  • Control image operations like resizing, cropping, and format conversion at the bucket level
  • See clear descriptions of what transformations provide

Implementation Details

  • Located between Compression and Maximum File Size sections for logical flow
  • Follows the same UI pattern as other bucket settings (CardGrid with Selector.Switch)
  • Respects billing read-only mode with grace period override
  • Update button is disabled when no changes are made

Test Plan

  • Verify transformation toggle appears in bucket settings
  • Test enabling transformations and confirm API call succeeds
  • Test disabling transformations and confirm API call succeeds
  • Verify analytics event fires when updating
  • Confirm read-only mode prevents updates (unless grace period override)
  • Check that the setting persists after page reload

Summary by CodeRabbit

  • New Features

    • Image transformations UI in bucket settings with toggle and standalone update action.
  • Improvements

    • Template deployments for functions and sites now use an explicit tag + reference payload for Git-based deployments.
    • CSV import flow updated to a standardized import call.
  • Analytics

    • Added tracking for bucket transformations updates.
  • Chores

    • Updated package source configuration and CI workflow trigger/structure.

This commit adds support for enabling/disabling image transformations
at the bucket level through the settings page.

Changes:
- Added transformations toggle switch in bucket settings UI
- Updated updateBucket function to include transformations parameter
- Added BucketUpdateTransformations analytics event
- Added descriptive text explaining image transformation capabilities

The new setting allows users to control whether the Appwrite API can
perform on-the-fly image manipulations (resizing, cropping, format
conversion) for files in the bucket.
@appwrite
Copy link

appwrite bot commented Nov 19, 2025

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Dynamic API keys are generated automatically for each function execution

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Walkthrough

Updated a package dependency URL in package.json. Extended analytics Submit enum with BucketUpdateTransformations. Added image transformations support in bucket settings (UI, transformations state, updateTransformations handler, and included in updateBucket payload). Renamed CSV migration call from createCsvMigration to createCSVImport. Changed multiple template/site/function deployment calls to send type and reference (using Type.Tag) instead of version, and added Type to imports. Reformatted the GitHub Actions workflow dockerize-profiles.yml and added workflow_dispatch.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify bucket settings: state binding for transformations, updateTransformations submission, updateBucket payload, and corresponding analytics event.
  • Confirm createCSVImport call matches SDK method and parameters (replaces createCsvMigration).
  • Audit deployment payload changes: Type import presence and consistent type/reference fields in functions/sites/templates.
  • Check package.json dependency URL update for correctness.
  • Validate .github/workflows/dockerize-profiles.yml indentation and added workflow_dispatch trigger.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main objective of the PR: adding image transformations configuration to bucket settings UI, which is the primary functional change across the modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-bucket-transformations-settings

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e93999c and 81c4568.

📒 Files selected for processing (1)
  • src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/+page.svelte (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/+page.svelte
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: e2e
  • GitHub Check: build

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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/+page.svelte (2)

105-107: Consider defaulting transformations if it can be absent

Destructuring transformations directly from data.bucket and binding it to a switch assumes it's always a boolean. If older buckets or partial payloads can omit this field, you might want to default it (e.g. transformations = data.bucket.transformations ?? false) to avoid passing undefined into the switch. If the backend guarantees a boolean here, this can be ignored.


220-230: Mirror analytics payload pattern for transformations (optional)

updateTransformations correctly reuses updateBucket and the new Submit.BucketUpdateTransformations event. For richer analytics, you could mirror toggleBucket and pass the new value into trackEventData, e.g.:

-    function updateTransformations() {
-        updateBucket(
-            data.bucket,
-            {
-                transformations
-            },
-            {
-                trackEventName: Submit.BucketUpdateTransformations
-            }
-        );
-    }
+    function updateTransformations() {
+        updateBucket(
+            data.bucket,
+            { transformations },
+            {
+                trackEventName: Submit.BucketUpdateTransformations,
+                trackEventData: { value: transformations }
+            }
+        );
+    }

This is consistent with how the enabled toggle is tracked, but not strictly required.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f91d97 and 25a1432.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • package.json (1 hunks)
  • src/lib/actions/analytics.ts (1 hunks)
  • src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/+page.svelte (4 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-10-07T14:16:31.893Z
Learnt from: ItzNotABug
Repo: appwrite/console PR: 2413
File: src/routes/(console)/project-[region]-[project]/databases/database-[database]/(entity)/helpers/analytics.ts:17-18
Timestamp: 2025-10-07T14:16:31.893Z
Learning: In the console codebase analytics helpers at `src/routes/(console)/project-[region]-[project]/databases/database-[database]/(entity)/helpers/analytics.ts`, the dynamically constructed enum lookups (like `Submit[enumKey as keyof typeof Submit]`) are designed to return `undefined` safely when a terminology entry doesn't exist, because the corresponding views won't be rendered in those scenarios (e.g., DocumentsDB columns/attributes have no view), so the analytics code paths won't be reached.

Applied to files:

  • src/lib/actions/analytics.ts
📚 Learning: 2025-09-08T13:20:47.308Z
Learnt from: ItzNotABug
Repo: appwrite/console PR: 2316
File: src/routes/(console)/project-[region]-[project]/functions/create-function/deploy/+page.svelte:29-29
Timestamp: 2025-09-08T13:20:47.308Z
Learning: The Form.svelte component in the Appwrite console creates a FormContext with isSubmitting as writable(false) and expects consumers to work with Svelte writable stores, not plain booleans.

Applied to files:

  • src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/+page.svelte
📚 Learning: 2025-09-26T06:48:57.938Z
Learnt from: ItzNotABug
Repo: appwrite/console PR: 2373
File: src/routes/(console)/project-[region]-[project]/databases/database-[database]/(suggestions)/empty.svelte:629-631
Timestamp: 2025-09-26T06:48:57.938Z
Learning: In the Appwrite console codebase using appwrite.io/pink-svelte, the Icon component automatically handles CSS variable names passed to its color prop by internally wrapping them with var(). Therefore, passing '--some-css-variable' as a string to the Icon color prop works correctly without needing to manually wrap it with var().

Applied to files:

  • package.json
🪛 GitHub Actions: E2E
package.json

[error] 1-1: Lockfile and manifest mismatch: specifiers in the lockfile don't match package.json (1 dependency mismatched: @appwrite.io/console).

🔇 Additional comments (3)
src/lib/actions/analytics.ts (1)

360-360: New Submit.BucketUpdateTransformations event is consistent

The added enum member name and value align with the existing BucketUpdate* submit events and cleanly support the new transformations update flow. No issues here.

src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/+page.svelte (2)

35-37: Forwarding antivirus and transformations in updateBucket payload looks correct

Including both antivirus: values.antivirus and transformations: values.transformations in the storage.updateBucket call keeps these flags in sync for every bucket update and ensures the security and transformations toggles actually affect the backend state. This aligns the API payload with the UI helpers below.


382-405: Image transformations section wiring and guards look solid

The new “Image transformations” section follows the existing pattern: Selector.Switch is correctly bound to transformations, the Form calls updateTransformations, and the Update button is disabled when nothing changed or when $readOnly && !GRACE_PERIOD_OVERRIDE. This matches surrounding sections and should behave as intended.

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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7bd46f4 and e93999c.

📒 Files selected for processing (1)
  • .github/workflows/dockerize-profiles.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.8)
.github/workflows/dockerize-profiles.yml

17-17: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


19-19: the runner of "docker/setup-qemu-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


21-21: the runner of "docker/setup-buildx-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: e2e
🔇 Additional comments (2)
.github/workflows/dockerize-profiles.yml (2)

1-49: This workflow file appears unrelated to PR objectives.

The PR objectives focus on adding image transformations configuration to bucket settings (UI, API, analytics). This workflow file change is for the profiles Docker build pipeline and seems orthogonal to the stated PR scope. Clarify whether this change is intentional or should be moved to a separate PR for better change isolation and review clarity.


9-9: Addition of workflow_dispatch trigger.

The addition of workflow_dispatch (Line 9) allows manual triggering of this workflow from the GitHub UI, which is a useful operational improvement. No issues identified.

@ItzNotABug ItzNotABug merged commit e662265 into main Nov 19, 2025
4 checks passed
@ItzNotABug ItzNotABug deleted the feat-bucket-transformations-settings branch November 19, 2025 08:33
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.

3 participants