-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add configurable deployment and build size #9863
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
WalkthroughA new Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Server
participant CreateFunctionDeployment
participant PlanResource
Client->>Server: Initiate deployment
Server->>CreateFunctionDeployment: Call action(..., plan)
CreateFunctionDeployment->>PlanResource: Access plan['deploymentSize']
alt plan['deploymentSize'] present
CreateFunctionDeployment->>CreateFunctionDeployment: Override size limit
else
CreateFunctionDeployment->>CreateFunctionDeployment: Use default size limit
end
CreateFunctionDeployment->>Server: Return deployment result
Server->>Client: Respond
sequenceDiagram
participant Worker
participant BuildsWorker
participant PlanResource
Worker->>BuildsWorker: Call action(..., plan)
BuildsWorker->>PlanResource: Access plan['deploymentSize'], plan['buildSize']
alt plan values present
BuildsWorker->>BuildsWorker: Override size limits
else
BuildsWorker->>BuildsWorker: Use default size limits
end
BuildsWorker->>Worker: Return build result
Suggested reviewers
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 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 (20)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support 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)
Other keywords and placeholders
Documentation and Community
|
Security Scan Results for PRDocker Image Scan Results
Source Code Scan Results🎉 No vulnerabilities found! |
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/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php (1)
141-145
: Configurable deployment size limit implementation.The site deployment size limit is now dynamically configurable based on the plan parameter, which allows for more flexible deployment sizes based on different plan tiers.
Consider adding a comment documenting the unit conversion (MB to bytes) to make the code more maintainable for future developers.
src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php (1)
140-144
: Configurable deployment size limit implementation.The function deployment size limit is now dynamically configurable based on the plan parameter, which allows for more flexible deployment sizes based on different plan tiers.
For consistency across the codebase, consider using the same variable naming convention. In this file it's
$functionSizeLimit
while in other files it's$sizeLimit
or$siteSizeLimit
. A more generic name like$deploymentSizeLimit
might be more maintainable.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
app/worker.php
(1 hunks)src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php
(3 hunks)src/Appwrite/Platform/Modules/Functions/Workers/Builds.php
(8 hunks)src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Setup & Build Appwrite Image
- GitHub Check: Setup & Build Appwrite Image
- GitHub Check: scan
🔇 Additional comments (12)
src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php (3)
88-88
: LGTM: New plan parameter injected.The plan resource is now injected into the constructor.
107-108
: LGTM: Action method signature updated.The
action
method signature now includes the injected plan parameter.
147-148
: LGTM: FileSize validator uses the configurable limit.The FileSize validator now uses the dynamically configured size limit.
src/Appwrite/Platform/Modules/Functions/Workers/Builds.php (6)
76-76
: LGTM: New plan parameter injected.The plan resource is now injected into the constructor.
116-117
: LGTM: Action method signature updated.The
action
method signature now includes the injected plan parameter.
485-487
: Configurable deployment size limit implementation.The function deployment size limit is now dynamically configurable based on the plan parameter.
489-491
: Improved error message with human-readable size format.The error message now displays the size limit in a more user-friendly format (decimal megabytes).
816-818
: Configurable build size limit implementation.The build size limit is now dynamically configurable based on the plan parameter.
820-821
: Improved error message with human-readable size format.The error message now displays the size limit in a more user-friendly format (decimal megabytes).
src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php (3)
89-89
: LGTM: New plan parameter injected.The plan resource is now injected into the constructor.
106-107
: LGTM: Action method signature updated.The
action
method signature now includes the injected plan parameter.
147-147
: LGTM: FileSize validator uses the configurable limit.The FileSize validator now uses the dynamically configured size limit.
✨ Benchmark results
⚡ Benchmark Comparison
|
What does this PR do?
Add configurable deployment and build size
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)
Related PRs and Issues
Checklist
Summary by CodeRabbit
New Features
Enhancements