Skip to content

Conversation

AryanBagade
Copy link

@AryanBagade AryanBagade commented Sep 2, 2025

What does this PR do?

This PR fixes a broken "Docs" button in the Sites creation flow. The button in the "Missing a repository?" section had href="#" which created a broken link that didn't navigate anywhere.

Changes made:

This specifically addresses the scenario described in the tooltip - helping users configure GitHub App permissions when repositories are missing.

Test Plan

Manual Testing:

  1. Navigate to Sites → Create Site → Connect a repository
  2. Look at the right sidebar "Missing a repository?" section
  3. Click the "Docs" button - now opens the correct documentation in a new tab
  4. Click the "Go to GitHub" button - also opens in new tab with proper security attributes

Automated Testing:

  • ✅ All tests pass: 211/211 tests successful
  • ✅ No linting errors: 0 errors, 0 warnings
  • ✅ Code formatting: Applied with pnpm run format
  • ✅ Diagnostics: Passed pnpm run check with no issues

Code Quality:

  • Follows existing code conventions
  • Added proper external prop for security (target="_blank" + rel="noopener noreferrer")
  • Maintains consistent styling and structure

Related PRs and Issues

This is a cross-repo fix - the issue was originally reported in the main appwrite repo but the fix belongs in the console frontend repo.

Have you read the Contributing Guidelines on issues?

Yes, I have read and followed the Contributing Guidelines:

  • ✅ Followed proper branch naming convention: fix-docs-button-create-sites
  • ✅ Ran all required checks: format, tests, and diagnostics
  • ✅ Used proper commit message format with issue references
  • ✅ Created corresponding issue in console repo before submitting PR
  • ✅ Followed code quality standards and existing patterns
  • ✅ Added proper security attributes for external links

Closes appwrite/appwrite#2300

Summary by CodeRabbit

  • New Features
    • Docs and Go to GitHub buttons now open externally, improving navigation and preventing context loss during site setup.
  • Documentation
    • Updated the Docs button to link directly to the self-hosting Sites configuration guide, replacing the placeholder link for clearer guidance.
    • Ensures users can quickly access the correct external resources without leaving the wizard unintentionally.

- Replace broken '#' link with correct GitHub App configuration docs
- Add external prop to both docs and GitHub buttons for security
- Links to specific section about updating repository permissions

Fixes #10402
- Replace broken '#' link with correct GitHub App configuration docs
- Add external prop to both docs and GitHub buttons for security
- Links to specific section about updating repository permissions

Fixes appwrite#2300
References appwrite/appwrite#10402
Copy link

appwrite bot commented Sep 2, 2025

Console

Project ID: 688b7bf400350cbd60e9

Sites (2)
Site Status Logs Preview QR
 console-qa
688b7cf6003b1842c9dc
Failed Failed Authorize Preview URL QR Code
 console-cloud
688b7c18002b9b871a8f
Failed Failed Authorize Preview URL QR Code

Note

You can use Avatars API to generate QR code for any text or URLs.

Copy link
Contributor

coderabbitai bot commented Sep 2, 2025

Walkthrough

The change updates the Docs button in src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/+page.svelte to use a specific external documentation URL (https://appwrite.io/docs/advanced/self-hosting/sites#configure-github-app) instead of "#", and sets the button as external. Additionally, the "Go to GitHub" button is marked as external; its href remains the dynamic GitHub organization URL. No logic or exported/public API changes were made.

Assessment against linked issues

Objective Addressed Explanation
Fix Docs button to navigate to relevant documentation instead of "#" [#2300]

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Add external prop to "Go to GitHub" button in aside (src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/+page.svelte, approx. L60–L90) The linked issue only targets fixing the Docs button href; modifying the GitHub button behavior isn’t specified.
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ccca8e9 and c576715.

📒 Files selected for processing (1)
  • src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/+page.svelte (1 hunks)
🔇 Additional comments (2)
src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/+page.svelte (2)

69-72: Docs button fix LGTM.

Correct URL and external target improve UX and security. Nice, focused fix.


75-75: Marking “Go to GitHub” as external is correct.

Prevents reverse tabnabbing when paired with rel=noopener,noreferrer in the Button component. Confirm the Button’s external prop sets both attributes.

Comment on lines +69 to +72
<Button
href="https://appwrite.io/docs/advanced/self-hosting/sites#configure-github-app"
external
secondary>Docs</Button>
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Optional: add tracking/UTM and guard against doc anchor drift.

  • Consider UTM params for attribution and a central constant for the docs URL.
  • Verify the anchor still exists; fail-safe if docs restructure.

Apply UTM (query must precede hash):

-                            href="https://appwrite.io/docs/advanced/self-hosting/sites#configure-github-app"
+                            href="https://appwrite.io/docs/advanced/self-hosting/sites?utm_source=console&utm_medium=button&utm_campaign=sites-missing-repo#configure-github-app"

Verification script:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
base='https://appwrite.io/docs/advanced/self-hosting/sites'
code=$(curl -sL -o /dev/null -w '%{http_code}' "$base")
echo "HTTP $code for $base"
html=$(curl -sL "$base")
if grep -q 'configure-github-app' <<<"$html"; then
  echo "Anchor 'configure-github-app' found"
else
  echo "Anchor 'configure-github-app' NOT found"; exit 1
fi

Length of output: 157427


Fix broken docs anchor and centralize URL

  • In src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/+page.svelte (lines 69–72), change the fragment from #configure-github-app to #git to match the current docs anchor.
  • Extract the docs base URL into a shared constant and append UTM parameters there for consistency.
🤖 Prompt for AI Agents
In
src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/+page.svelte
around lines 69–72, update the docs link fragment from #configure-github-app to
#git and replace the hardcoded full URL by importing a shared docs base constant
(e.g. from src/lib/constants/docs.ts) that already includes the UTM parameters,
then construct the final href by appending the #git fragment to that base
constant; add or update the shared constant file to export the canonical docs
base URL with UTM params so all components reuse it.

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.

Help developers by writing 'Appwrites Teams service' blog post 🗞
1 participant