Skip to content

Conversation

@ahmetskilinc
Copy link
Collaborator

@ahmetskilinc ahmetskilinc commented Jul 26, 2025

Summary by CodeRabbit

  • New Features

    • Added support for accessing project pages using provider, organization, and repository identifiers, enabling direct linking to repositories not yet in the database.
    • Introduced fallback UI for repositories missing from the database, displaying limited information and suppressing certain features.
    • Added a new API endpoint to fetch projects by provider, organization, and repository.
  • Bug Fixes

    • Improved error handling and conditional UI rendering for projects not found in the database.
  • Chores

    • Removed debug logging from backend drivers for cleaner output.
    • Updated internal routing and data fetching to support the new project identification method.
    • Updated project card and launch sidebar links to use dynamic repository-based URLs for better navigation.

- Updated the project card link to dynamically generate based on the git host (GitHub or GitLab).
- Removed unused markdown content, project description, and project page components to streamline the codebase.
- Added a new API endpoint to fetch project details by repository for better integration.
@vercel
Copy link

vercel bot commented Jul 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ossdotnow ❌ Failed (Inspect) Jul 26, 2025 1:20am

@coderabbitai
Copy link

coderabbitai bot commented Jul 26, 2025

"""

Walkthrough

This change refactors project page routing and data fetching to use provider, organization, and repository identifiers instead of a single project ID. It introduces a fallback mechanism for projects not present in the database by synthesizing a virtual project object, updates UI components and queries accordingly, and adds a new API endpoint for fetching projects by repo details. Additionally, debug logging is removed from GitHub and GitLab drivers, and project link URLs are updated to use provider/org/repo paths.

Changes

File(s) Change Summary
.../(projects)/[provider]/[org]/[repo]/page.tsx Added new async page component accepting provider, org, and repo params; renders ProjectPage with these props.
.../(projects)/[provider]/[org]/[repo]/project-page.tsx Refactored ProjectPage and hooks to use provider/org/repo; added virtual project fallback and updated queries.
.../(projects)/[provider]/[org]/[repo]/project-description.tsx Added isNotInDatabase prop; conditionally suppresses rendering of badges and social links.
.../(projects)/projects/[id]/page.tsx Deleted old page component that used project ID.
.../(projects)/projects/project-card.tsx Updated project link URLs to use provider/org/repo; minor JSX formatting changes.
packages/api/src/routers/projects.ts Added getProjectByRepo procedure to fetch project by provider/org/repo.
packages/api/src/driver/github.ts
packages/api/src/driver/gitlab.ts
Removed debug console logs; replaced some with console.error and TODOs for error handling.
.../launches/[id]/components/launch-sidebar.tsx Changed "View Project" button link to use dynamic provider/org/repo URL instead of static project ID path.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant WebApp
    participant API
    participant Database

    User->>WebApp: Navigate to /projects/{provider}/{org}/{repo}
    WebApp->>API: getProjectByRepo(provider, org, repo)
    API->>Database: Query project by provider/org/repo
    Database-->>API: Project or null
    API-->>WebApp: Project data or null
    alt Project not in database
        WebApp->>WebApp: Construct virtual project object from repo data
    end
    WebApp->>API: Fetch additional repo data (issues, PRs, readme, etc.)
    API-->>WebApp: Repo data
    WebApp->>User: Render ProjectPage with real or virtual project data
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Possibly related PRs

  • Feat/project page #51: Refactors ProjectPage component and routing to use provider/org/repo parameters, closely related to this PR’s changes in props and data fetching.
  • adds contributors tab #133: Extends ProjectPage with contributors tab and uses provider/org/repo parameters, sharing component-level modifications.
  • feat: private repos #83: Implements provider/org/repo-based project fetching and normalization, overlapping with routing and data fetching changes here.

Poem

🐇 Hop along the code’s new trail,
Provider, org, and repo sail.
When projects hide, don’t feel dismay—
A virtual friend will light the way.
Links now dance with fresh new grace,
This rabbit’s thrilled to join the race! 🌿✨
"""

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/web/app/(public)/(projects)/[provider]/[org]/[repo]/project-description.tsx

Oops! Something went wrong! :(

ESLint: 9.32.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

apps/web/app/(public)/launches/[id]/components/launch-sidebar.tsx

Oops! Something went wrong! :(

ESLint: 9.32.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch allow-any-project-url

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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

Documentation and Community

  • 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

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bugbot free trial expires on July 29, 2025
Learn more in the Cursor dashboard.

Copy link

@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: 4

🧹 Nitpick comments (1)
packages/api/src/driver/github.ts (1)

857-859: Remove unnecessary TODO comment

The error is already being properly handled by logging and re-throwing as a TRPCError. The TODO comment should be removed.

         } catch (error) {
-          // TODO: handle error
           console.error('Error fetching GitHub contributors:', error);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd68795 and 1365735.

📒 Files selected for processing (8)
  • apps/web/app/(public)/(projects)/[provider]/[org]/[repo]/page.tsx (1 hunks)
  • apps/web/app/(public)/(projects)/[provider]/[org]/[repo]/project-description.tsx (4 hunks)
  • apps/web/app/(public)/(projects)/[provider]/[org]/[repo]/project-page.tsx (19 hunks)
  • apps/web/app/(public)/(projects)/projects/[id]/page.tsx (0 hunks)
  • apps/web/app/(public)/(projects)/projects/project-card.tsx (2 hunks)
  • packages/api/src/driver/github.ts (3 hunks)
  • packages/api/src/driver/gitlab.ts (1 hunks)
  • packages/api/src/routers/projects.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/web/app/(public)/(projects)/projects/[id]/page.tsx
🧰 Additional context used
🧬 Code Graph Analysis (2)
apps/web/app/(public)/(projects)/projects/project-card.tsx (2)
packages/db/src/schema/projects.ts (1)
  • project (16-64)
packages/ui/src/components/link.tsx (1)
  • Link (17-44)
apps/web/app/(public)/(projects)/[provider]/[org]/[repo]/page.tsx (1)
apps/web/app/(public)/(projects)/[provider]/[org]/[repo]/project-page.tsx (1)
  • ProjectPage (172-1094)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (10)
packages/api/src/routers/projects.ts (1)

486-513: LGTM! Well-implemented new endpoint for provider-based project lookup.

The getProjectByRepo procedure correctly handles the new routing structure by:

  • Properly normalizing provider shorthand (ghgithub, glgitlab)
  • Querying by gitHost and concatenated repository path format
  • Including all necessary relations for the frontend
  • Returning null for non-existent projects to support fallback logic
apps/web/app/(public)/(projects)/[provider]/[org]/[repo]/page.tsx (1)

3-11: LGTM! Clean implementation following Next.js App Router conventions.

The component correctly:

  • Handles Promise-based params for App Router
  • Extracts route parameters and maps them appropriately
  • Maintains clear separation of concerns by delegating to ProjectPage
packages/api/src/driver/gitlab.ts (1)

658-664: Good improvement to error logging consistency.

The changes appropriately:

  • Replace console.log with console.error for error scenarios
  • Add TODO comments indicating future error handling improvements
  • Maintain existing functionality while improving error visibility
apps/web/app/(public)/(projects)/projects/project-card.tsx (2)

59-76: Minor JSX reformatting looks fine.

The reordering of CSS classes and structure maintains the same functionality while slightly improving readability.


30-33: URL construction & data format confirmed

Verified that all sample gitRepoUrl values in packages/db/src/seed/fixtures/projects.ts use the expected org/repo format (e.g. “facebook/react”, “vuejs/vue”, etc.). The provider normalization (github → gh, gitlab → gl) combined with

const href = `/${normalizedProvider}/${project.gitRepoUrl}`;

correctly aligns with the [provider]/[org]/[repo] routing. No changes required.

apps/web/app/(public)/(projects)/[provider]/[org]/[repo]/project-description.tsx (1)

16-21: Good implementation of conditional rendering for virtual projects.

The isNotInDatabase prop is properly integrated to hide database-specific elements (status badges, project ticks, social links) when displaying repositories that aren't yet persisted. This aligns well with the fallback mechanism for projects not in the database.

Also applies to: 51-53, 127-129

apps/web/app/(public)/(projects)/[provider]/[org]/[repo]/project-page.tsx (4)

24-24: Good refactoring of import path

Moving ProjectErrorPage to a shared location improves code reusability.


158-170: Well-implemented hook refactoring

The hook properly handles the new parameter structure and introduces the isNotInDatabase flag for distinguishing between errors and non-existent projects.


381-383: Excellent error handling logic

The conditional error display based on isNotInDatabase properly supports the virtual project feature while still catching real errors.


429-440: Well-structured conditional rendering

The UI properly adapts based on database presence, showing appropriate messages and hiding database-dependent features for virtual projects.

Also applies to: 1021-1038

const pullRequestsCount = repoStats?.pullRequestsCount || 0;

const provider = project.gitHost === 'github' ? 'gh' : 'gl';
const href = `/${provider}/${repoData?.owner.login}/${repoData?.name}`;
Copy link

Choose a reason for hiding this comment

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

Bug: Malformed Project Links in Sidebar

The project link in launch-sidebar.tsx is malformed due to two issues: inconsistent provider normalization that defaults to 'gl' for non-GitHub hosts (even if null/undefined), and the use of potentially undefined repoData?.owner.login and repoData?.name before repoQuery has loaded, leading to URLs like /gh/undefined/undefined.

Locations (1)

Fix in CursorFix in Web

const normalizedProvider =
project.gitHost === 'github' ? 'gh' : project.gitHost === 'gitlab' ? 'gl' : project.gitHost;

const href = `/${normalizedProvider}/${project.gitRepoUrl}`;
Copy link

Choose a reason for hiding this comment

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

Bug: Git URL Handling Causes Frontend and Backend Issues

The project.gitRepoUrl field is incorrectly assumed to contain only the 'owner/repo' portion of a repository identifier, while it actually stores full URLs. This leads to two issues:

  1. Frontend: Project card links are malformed due to direct concatenation of the full URL.
  2. Backend: The new getProjectByRepo API's database query compares the full gitRepoUrl with an 'org/repo' string, causing it to always fail and return no results.
Locations (2)

Fix in CursorFix in Web

Copy link

@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

📥 Commits

Reviewing files that changed from the base of the PR and between 6bca733 and b1ad719.

📒 Files selected for processing (2)
  • apps/web/app/(public)/(projects)/[provider]/[org]/[repo]/project-description.tsx (3 hunks)
  • apps/web/app/(public)/launches/[id]/components/launch-sidebar.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/app/(public)/(projects)/[provider]/[org]/[repo]/project-description.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
apps/web/app/(public)/launches/[id]/components/launch-sidebar.tsx (2)
packages/db/src/schema/projects.ts (1)
  • project (16-64)
packages/ui/src/components/link.tsx (1)
  • Link (17-44)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (2)
apps/web/app/(public)/launches/[id]/components/launch-sidebar.tsx (2)

13-13: LGTM: Import reordering looks good.

The import order changes are cosmetic and don't affect functionality.

Also applies to: 16-16


222-222: Dynamic provider/org/repo route is supported

The dynamic route for /projects/[provider]/[org]/[repo] exists at
• apps/web/app/(public)/(projects)/[provider]/[org]/[repo]/page.tsx

Since the corresponding page component is in place, the <Link href={href}> will resolve correctly. No further changes needed.

Comment on lines +105 to +106
const provider = project.gitHost === 'github' ? 'gh' : 'gl';
const href = `/${provider}/${repoData?.owner.login}/${repoData?.name}`;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add null safety checks for URL construction.

The URL construction logic could fail if repoData or its nested properties are undefined, potentially creating invalid hrefs or causing runtime errors.

Apply this diff to add proper null safety:

-  const provider = project.gitHost === 'github' ? 'gh' : 'gl';
-  const href = `/${provider}/${repoData?.owner.login}/${repoData?.name}`;
+  const provider = project.gitHost === 'github' ? 'gh' : 'gl';
+  const href = repoData?.owner?.login && repoData?.name 
+    ? `/${provider}/${repoData.owner.login}/${repoData.name}`
+    : `/projects/${projectId}`; // fallback to old URL format

This ensures the Link component always receives a valid href, falling back to the project ID-based URL if repository data is unavailable.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const provider = project.gitHost === 'github' ? 'gh' : 'gl';
const href = `/${provider}/${repoData?.owner.login}/${repoData?.name}`;
const provider = project.gitHost === 'github' ? 'gh' : 'gl';
const href = repoData?.owner?.login && repoData?.name
? `/${provider}/${repoData.owner.login}/${repoData.name}`
: `/projects/${projectId}`; // fallback to old URL format
🤖 Prompt for AI Agents
In apps/web/app/(public)/launches/[id]/components/launch-sidebar.tsx around
lines 105 to 106, the URL construction uses repoData and its nested properties
without null checks, risking runtime errors if repoData is undefined. Fix this
by adding null safety checks to verify repoData and its nested properties exist
before accessing them; if they do not, fall back to a safe default URL using the
project ID. This ensures the href is always valid and prevents errors.

@ahmetskilinc ahmetskilinc marked this pull request as draft July 27, 2025 00:16
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.

2 participants