Skip to content

fix: include default region in self-hosted CLI console deployment URLs#1661

Merged
ChiragAgg5k merged 3 commits into
mainfrom
fix-cli-console-deployment-url-region
Jul 10, 2026
Merged

fix: include default region in self-hosted CLI console deployment URLs#1661
ChiragAgg5k merged 3 commits into
mainfrom
fix-cli-console-deployment-url-region

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Summary

  • Self-hosted console routes always use project-{region}-{projectId} (region defaults to default), matching Appwrite console and Builds worker URLs.
  • getConsoleProjectSlug previously omitted the region when it wasn't fetched (common with API-key-only pushes), producing broken links like /console/project-{id}/... instead of /console/project-default-{id}/....
  • Default non-cloud slugs to project-default-{id} when no region is available; keep explicit regions and cloud subdomain behavior unchanged.

Test plan

  • getConsoleProjectSlug("http://localhost/v1", "proj1")project-default-proj1
  • getConsoleProjectSlug("http://localhost/v1", "proj1", "fra")project-fra-proj1
  • Cloud regional/non-regional endpoints unchanged
  • CLI e2e console-slug-region assertion passes

ChiragAgg5k and others added 2 commits July 10, 2026 15:56
Console routes use project-{region}-{id}; without a fetched region the CLI
omitted it and produced broken links like project-{id} instead of
project-default-{id}.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes broken console URLs generated for self-hosted Appwrite deployments when no project region is available. The getConsoleProjectSlug function previously returned project-{id} (skipping the region segment entirely) when region was absent, producing links that don't resolve in the console.

  • getConsoleProjectSlug now returns project-default-{id} for non-cloud hostnames when no region is provided, matching how the Appwrite console and Builds worker construct these paths.
  • The catch block for malformed endpoint URLs is updated with the same defaulting logic.
  • E2E test expectations updated to assert the corrected project-default-{id} format; cloud and explicit-region cases are left unchanged.

Confidence Score: 5/5

Change is minimal, self-contained, and all affected test cases have been updated to match the new behaviour.

The fix is a two-line change that collapses a conditional into a single expression. Cloud and explicit-region paths are untouched, and the e2e assertions cover both the no-region and explicit-region cases for non-cloud hosts.

No files require special attention.

Important Files Changed

Filename Overview
templates/cli/lib/utils.ts Simplified getConsoleProjectSlug to always include a region for non-cloud hostnames, defaulting to "default" when none is provided; catch block updated consistently.
tests/e2e/Base.php Updated expected CLI console URL for the self-hosted case to include the "default" region segment, matching the new slug format.
tests/e2e/languages/cli/test.js Updated console-slug-region assertion: no-region call now expects "project-default-proj1"; explicit-region and cloud cases remain unchanged.

Reviews (2): Last reviewed commit: "(fix): expect default region in self-hos..." | Re-trigger Greptile

@ChiragAgg5k ChiragAgg5k merged commit 1ee226c into main Jul 10, 2026
58 checks passed
@ChiragAgg5k ChiragAgg5k deleted the fix-cli-console-deployment-url-region branch July 10, 2026 10:40
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.

1 participant