fix(cli): link Cloud console pages to the new console - #1908
Conversation
On Cloud, deployment, project settings and onboarding links now point at
appwrite.io (staging.appwrite.io) with root routes such as
/projects/{projectId}/functions/{functionId}/deployments/{deploymentId},
so no region is needed and the region-less project slug is gone.
Self-hosted links keep the /console/project-{region}-{projectId} shape.
The onboarding link there becomes /console, since /console/onboarding
has no route in the new console.
|
| func TestMissingGitHubInstallationOffersConsoleLinkAndLocalFallback(t *testing.T) { | ||
| setupURL := githubInstallationSetupURL( | ||
| "https://sgp.cloud.appwrite.io/v1", "project-id") | ||
| wantURL := "https://cloud.appwrite.io/console/project-sgp-project-id/settings" | ||
| wantURL := "https://appwrite.io/projects/project-id/settings" | ||
| if setupURL != wantURL { | ||
| t.Fatalf("setup URL = %q, want %q", setupURL, wantURL) | ||
| } | ||
| baseURL := githubInstallationSetupURL( | ||
| "https://cloud.appwrite.io/v1", "project-id") | ||
| if baseURL != "https://cloud.appwrite.io/console/project-project-id/settings" { | ||
| if baseURL != wantURL { | ||
| t.Fatalf("base Cloud setup URL = %q", baseURL) | ||
| } |
There was a problem hiding this comment.
This test covers only the production Cloud GitHub settings URL. The new Cloud deployment routes, self-hosted deployment fallback, staging origin, and Cloud and self-hosted no-organization links have no behavioral coverage. Add cases for the final user-visible Function, Site, organization, staging, and self-hosted URLs so malformed routes cannot ship while the suite remains green.
Knowledge Base Used: Command-line templates
Prompt To Fix With AI
This is a comment left during a code review.
Path: templates/cli/internal/cmd/initfunction_test.go
Line: 22-33
Comment:
**Changed routes lack coverage**
This test covers only the production Cloud GitHub settings URL. The new Cloud deployment routes, self-hosted deployment fallback, staging origin, and Cloud and self-hosted no-organization links have no behavioral coverage. Add cases for the final user-visible Function, Site, organization, staging, and self-hosted URLs so malformed routes cannot ship while the suite remains green.
**Knowledge Base Used:** [Command-line templates](https://app.greptile.com/appwrite/-/custom-context/knowledge-base/appwrite/sdk-generator/-/docs/command-line-templates.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Self-hosted deployment, project settings and onboarding links now use the
same root routes as Cloud, built on the instance root:
/projects/{projectId}/functions/{functionId}/deployments/{deploymentId},
/projects/{projectId}/sites/{siteId}/deployments/{deploymentId},
/projects/{projectId}/settings and /.
The /console/project-{region}-{projectId} slug is gone, and with it the
console project lookup that only existed to resolve its region.
consoleBaseURL now picks the Cloud console origin itself, so every link
is built from one base.
CLI_CONSOLE_URL_RESPONSES only listed /console/project-{region}-{projectId}
URLs, and nothing has read it since the TypeScript CLI tests were removed.
All CLI console links, Cloud and self-hosted, now use the new console's root routes:
/projects/{projectId}/functions/{functionId}/deployments/{deploymentId}and/projects/{projectId}/sites/{siteId}/deployments/{deploymentId}/projects/{projectId}/settings/The base is appwrite.io (staging.appwrite.io) on Cloud and the instance root on self-hosted. The legacy
/console/project-{region}-{projectId}slug is gone, along with the project lookup that only resolved its region, and the unused legacy console URL fixtures intests/e2e/Base.php.