fix(sites): block GitHub repo create when site limit reached - #3175
Conversation
Check the plan site limit before calling vcs.createRepository in the template wizard, and disable Create site on the list page when limited, so users are not left with empty GitHub repositories after a failed deploy. Fixes #2175 Co-authored-by: chiragaggarwal5k <chiragaggarwal5k@gmail.com>
Console (appwrite/console)Project ID: Tip Trigger functions via HTTP, SDKs, events, webhooks, or scheduled cron jobs |
Greptile SummaryThe PR prevents site-creation entry points from proceeding after the current plan’s site limit is reached.
Confidence Score: 5/5The PR appears safe to merge, with all identified site-creation entry points consistently enforcing the existing plan-limit policy. The limit calculation follows established billing and sibling-page patterns, all current creation triggers are guarded, self-hosted use remains enabled, and no concrete changed-code failure remains. Important Files Changed
Reviews (1): Last reviewed commit: "fix(sites): block GitHub repo create whe..." | Re-trigger Greptile |
ChiragAgg5k
left a comment
There was a problem hiding this comment.
Looks good — this is the right fix for #2175.
The template wizard was creating a GitHub repo before sites.create ran, so free-plan users at the site cap were left with an empty repo after deploy failed. Guarding vcs.createRepository (button + early return) stops that, and disabling Create site on the list page matches Functions/Storage.
sites.list(limit=1) is enough for total, isServiceLimited already no-ops without a billing plan, and the extra isCloud check matches the functions template pattern. Build, e2e, and Greptile are green.

Summary
vcs.createRepositoryin the Sites template wizard with the existing plan site-limit check, so an empty GitHub repo is not created when deploy would fail for free-plan limits.sites.list(limit=1)on the template page so the wizard has the current total.Fixes #2175
Test plan