Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: update error message for site size limit#9905

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Julien-prrs wants to merge1 commit intoappwrite:main
base:main
Choose a base branch
Loading
fromJulien-prrs:fix-9904-update-sites-upload-size-limit-error-message

Conversation

Julien-prrs
Copy link

@Julien-prrsJulien-prrs commentedMay 26, 2025
edited by coderabbitaibot
Loading

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

  • 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.

Related PRs and Issues

Checklist

  • Have you read theContributing Guidelines on issues?
  • 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.

@coderabbitaicoderabbitai
Copy link

coderabbitaibot commentedMay 26, 2025
edited
Loading

Walkthrough

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.phpAdded new error entry forException::SITE_INVALID_FILE_SIZE with name, description, and code 400.
src/Appwrite/Extend/Exception.phpIntroduced constantSITE_INVALID_FILE_SIZE in the Exception class.
src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.phpUpdated thrown exception fromSTORAGE_INVALID_FILE_SIZE toSITE_INVALID_FILE_SIZE.

Sequence Diagram(s)

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.

📒 Files selected for processing (3)
  • app/config/errors.php (1 hunks)
  • src/Appwrite/Extend/Exception.php (1 hunks)
  • src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php (1)
src/Appwrite/Extend/Exception.php (1)
  • Exception (7-407)
app/config/errors.php (1)
src/Appwrite/Extend/Exception.php (1)
  • Exception (7-407)
⏰ 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.

src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php (1)

187-187:

✅ Verification successful

Good change to use site-specific error code.

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat withCodeRabbit:

  • 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.
  • @coderabbitai generate docstrings togenerate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add@coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add@coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add@coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit ourDocumentation for detailed information on how to use CodeRabbit.
  • Join ourDiscord Community to get help, request features, and share feedback.
  • Follow us onX/Twitter for updates and announcements.

@github-actionsGitHub Actions
Copy link

Security Scan Results for PR

Docker Image Scan Results

PackageVersionVulnerabilitySeverity
binutils2.42-r0CVE-2025-0840HIGH
libexpat2.6.4-r0CVE-2024-8176HIGH
libxml22.12.7-r0CVE-2024-56171HIGH
libxml22.12.7-r0CVE-2025-24928HIGH
libxml22.12.7-r0CVE-2025-27113HIGH
libxml22.12.7-r0CVE-2025-32414HIGH
libxml22.12.7-r0CVE-2025-32415HIGH
sqlite-libs3.45.3-r1CVE-2025-29087HIGH
xz5.6.2-r0CVE-2025-31115HIGH
xz-libs5.6.2-r0CVE-2025-31115HIGH
golang.org/x/cryptov0.31.0CVE-2025-22869HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@Julien-prrs

[8]ページ先頭

©2009-2025 Movatter.jp