You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
This PR updates the error message returned when a site deployment archive exceeds the allowed file size limit. Previously, the error incorrectly referenced the_APP_STORAGE_LIMIT environment variable. It now correctly points to_APP_COMPUTE_SIZE_LIMIT.
Test Plan
Attempted to deploy a site with an archive exceeding the limit via both CLI and Web UI.
Verified that the updated error message is returned.
If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?
Summary by CodeRabbit
New Features
Introduced a specific error message for invalid or oversized site deployment files, providing clearer feedback when file size limits are exceeded during site deployment.
Bug Fixes
Improved error handling by distinguishing between site-related and generic storage file size errors.
A new site-specific error code for invalid file size was introduced, including its definition in the error configuration and as a constant in the Exception class. The site deployment creation logic now throws this new error when the uploaded file size is invalid, replacing the previously used generic storage error code.
Changes
File(s)
Change Summary
app/config/errors.php
Added new error entry forException::SITE_INVALID_FILE_SIZE with name, description, and code 400.
src/Appwrite/Extend/Exception.php
Introduced constantSITE_INVALID_FILE_SIZE in the Exception class.
sequenceDiagram participant User participant SitesModule participant Exception User->>SitesModule: Upload site deployment file SitesModule->>SitesModule: Validate file size alt File size invalid SitesModule->>Exception: Throw SITE_INVALID_FILE_SIZE Exception-->>User: Return error (400, invalid file size) else File size valid SitesModule->>SitesModule: Proceed with deployment end
Loading
Possibly related PRs
Fix: unlimited deployment size #9866: Modifies file size validation logic for site deployments, allowing unlimited size if the limit is zero; both PRs adjust error handling for file size in site deployments.
Poem
A bunny hopped with files to deploy, But oh! The size brought little joy. Now errors speak in site’s own tongue, No more storage songs are sung. With clearer words, the code’s refined— Hooray for limits, well-defined! 🐇✨
📜 Recent review details
Configuration used: .coderabbit.yaml Review profile: CHILL Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and betweena68d49a and14a4413.
⏰ Context from checks skipped due to timeout of 90000ms (1)
GitHub Check: scan
🔇 Additional comments (3)
src/Appwrite/Extend/Exception.php (1)
160-160:LGTM! New site-specific error constant is properly added.
The newSITE_INVALID_FILE_SIZE constant is correctly placed in the Sites section and follows the established naming convention. This will provide better error categorization for site deployment file size issues.
app/config/errors.php (1)
583-587:Excellent! Error message now correctly references the right environment variable.
This change directly addresses the PR objective by updating the error description to reference_APP_COMPUTE_SIZE_LIMIT instead of the incorrect_APP_STORAGE_LIMIT. The error configuration is properly structured with an appropriate 400 status code for client-side validation errors.
This correctly updates the exception to use the new site-specific error code instead of the generic storage error, which will provide users with the corrected error message referencing_APP_COMPUTE_SIZE_LIMIT.
Let me verify that all site deployment file size validations use the new error code:
🏁 Script executed:
#!/bin/bash# Description: Check for any remaining usage of STORAGE_INVALID_FILE_SIZE in site-related code# Expected: Only non-site related usage should remainecho"=== Searching for STORAGE_INVALID_FILE_SIZE usage ==="rg -A 3 -B 3"STORAGE_INVALID_FILE_SIZE"echo -e"\n=== Searching for site deployment related file size checks ==="rg -A 5 -B 5"siteSizeLimit|site.*size.*limit" --type php
Length of output: 6184
All site deployment file size validations now useSITE_INVALID_FILE_SIZE and no residualSTORAGE_INVALID_FILE_SIZE remains in the Sites module. Approving this change.
✨ Finishing Touches
📝 Generate Docstrings
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.
Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.
Explain this complex logic.
Open a follow-up GitHub issue for this discussion.
Files and specific lines of code (under the "Files changed" tab): Tag@coderabbitai in a new review comment at the desired location with your query. Examples:
@coderabbitai explain this code block.
@coderabbitai modularize this function.
PR comments: Tag@coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
@coderabbitai read src/utils.ts and explain its main purpose.
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
@coderabbitai help me debug CodeRabbit configuration file.
Support
Need help? Create a ticket on oursupport page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pause to pause the reviews on a PR.
@coderabbitai resume to resume the paused reviews.
@coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
@coderabbitai full review to do a full review from scratch and review all the files again.
@coderabbitai summary to regenerate the summary of the PR.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading.Please reload this page.
What does this PR do?
This PR updates the error message returned when a site deployment archive exceeds the allowed file size limit. Previously, the error incorrectly referenced the
_APP_STORAGE_LIMIT
environment variable. It now correctly points to_APP_COMPUTE_SIZE_LIMIT
.Test Plan
Related PRs and Issues
Checklist
Summary by CodeRabbit
New Features
Bug Fixes