Skip to content

fix GitHub import endpoint#504

Draft
saurabhhhcodes wants to merge 1 commit into
piyushdotcomm:mainfrom
saurabhhhcodes:fix/github-import-json-response
Draft

fix GitHub import endpoint#504
saurabhhhcodes wants to merge 1 commit into
piyushdotcomm:mainfrom
saurabhhhcodes:fix/github-import-json-response

Conversation

@saurabhhhcodes

@saurabhhhcodes saurabhhhcodes commented Jun 20, 2026

Copy link
Copy Markdown

What changed

  • Added a real POST /api/github/import endpoint that imports public GitHub repos into a new playground.
  • Handles monorepos by returning selectable subdirectories when multiple project roots are detected.
  • Hardened the client so it no longer throws the raw Unexpected token < JSON parse error when the endpoint returns HTML or another non-JSON response.

Why

The import dialog was calling /api/github/import, but no route existed, so the browser was trying to parse the HTML 404 page as JSON.

Closes #223

Validation

  • npx vitest run app/api/github/import/utils.test.ts
  • npx eslint app/api/github/import/route.ts app/api/github/import/utils.ts modules/dashboard/components/github-import-dialog.tsx
  • git diff --check

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 97b5a0cd-3197-491c-a31e-76e1fc6d7d03

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

👋 Thanks for opening a PR, @saurabhhhcodes!

Your PR has entered the 🚦 PR Review Pipeline.

Standard PR detected — your PR will follow the standard review pipeline.


What happens next

Stage Reviewer Checks
Stage 1 — Automated Validation 🤖 Bot DCO · Format · AI/Slop · Duplicate
Stage 2 — Human Review 👥 Maintainer Code + Quality Review
Stage 3 — PA / Maintainer Review 🔑 Project Admin Final Merge Decision

A pipeline status comment will appear below and update automatically as your PR progresses.


While you wait

  • Sign all commits (git commit -s)
  • Link your issue (Closes #123)
  • Use a feature branch (not main)
  • Avoid unrelated changes

This comment is posted only once.

@github-actions github-actions Bot added the bug Something isn't working label Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]

1 participant