-
Notifications
You must be signed in to change notification settings - Fork 198
feat: add image transformations configuration to bucket settings #2614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Console (appwrite/console)Project ID: Tip Dynamic API keys are generated automatically for each function execution |
WalkthroughUpdated a package dependency URL in package.json. Extended analytics Submit enum with Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
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.
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 defaultingtransformationsif it can be absentDestructuring
transformationsdirectly fromdata.bucketand 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 passingundefinedinto the switch. If the backend guarantees a boolean here, this can be ignored.
220-230: Mirror analytics payload pattern for transformations (optional)
updateTransformationscorrectly reusesupdateBucketand the newSubmit.BucketUpdateTransformationsevent. For richer analytics, you could mirrortoggleBucketand pass the new value intotrackEventData, 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
⛔ Files ignored due to path filters (1)
bun.lockis 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: NewSubmit.BucketUpdateTransformationsevent is consistentThe 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: ForwardingantivirusandtransformationsinupdateBucketpayload looks correctIncluding both
antivirus: values.antivirusandtransformations: values.transformationsin thestorage.updateBucketcall 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 solidThe new “Image transformations” section follows the existing pattern:
Selector.Switchis correctly bound totransformations, theFormcallsupdateTransformations, and the Update button is disabled when nothing changed or when$readOnly && !GRACE_PERIOD_OVERRIDE. This matches surrounding sections and should behave as intended.
There was a problem hiding this 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
📒 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.

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
updateBucketfunction to includetransformationsparameterBucketUpdateTransformationsanalytics event for trackingFeatures
The new "Image transformations" section allows users to:
Implementation Details
Test Plan
Summary by CodeRabbit
New Features
Improvements
Analytics
Chores