Skip to content

fix(sites): block GitHub repo create when site limit reached - #3175

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix-2175-site-limit-before-repo-create
Aug 20, 2026
Merged

fix(sites): block GitHub repo create when site limit reached#3175
ChiragAgg5k merged 1 commit into
mainfrom
fix-2175-site-limit-before-repo-create

Conversation

@cursor

@cursor cursor Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Guard vcs.createRepository in 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.
  • Disable the Sites list Create site button (and empty-state create) when the limit is reached, matching Functions/Storage.
  • Load a lightweight sites.list(limit=1) on the template page so the wizard has the current total.

Fixes #2175

Test plan

  • On a free-plan project already at the sites limit, open Sites — Create site is disabled with a plan-limit tooltip.
  • Deep-link into a template wizard with "new repository": Create is disabled and does not call GitHub.
  • Under the limit, create-repo and list Create site still work as before.
  • Self-hosted (no billing plan): Create site remains available.
Open in Web View Automation 

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>
@cursor
cursor Bot marked this pull request as ready for review August 20, 2026 03:35
@cursor
cursor Bot requested a review from ChiragAgg5k August 20, 2026 03:35
@appwrite

appwrite Bot commented Aug 20, 2026

Copy link
Copy Markdown

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Trigger functions via HTTP, SDKs, events, webhooks, or scheduled cron jobs

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR prevents site-creation entry points from proceeding after the current plan’s site limit is reached.

  • Disables list-page create controls and provides a plan-limit tooltip.
  • Loads the project’s site total in the template route.
  • Blocks GitHub repository creation before invoking the VCS API when the site limit is reached.

Confidence Score: 5/5

The 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

Filename Overview
src/routes/(console)/project-[region]-[project]/sites/+page.svelte Consistently applies the existing site-limit check to command-center, button, and empty-state creation triggers.
src/routes/(console)/project-[region]-[project]/sites/create-site/templates/template-[template]/+page.svelte Uses the loaded site total to disable and defensively guard GitHub repository creation while preserving self-hosted behavior.
src/routes/(console)/project-[region]-[project]/sites/create-site/templates/template-[template]/+page.ts Loads a limit-one site list alongside template data so the client can evaluate the plan limit.

Reviews (1): Last reviewed commit: "fix(sites): block GitHub repo create whe..." | Re-trigger Greptile

@ChiragAgg5k ChiragAgg5k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ChiragAgg5k
ChiragAgg5k merged commit e2e2419 into main Aug 20, 2026
4 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix-2175-site-limit-before-repo-create branch August 20, 2026 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: Empty GitHub repo created even when site limit is exceeded

2 participants