Skip to content

add github source - #381

Merged
severo merged 12 commits into
masterfrom
github-sources
Mar 18, 2026
Merged

add github source#381
severo merged 12 commits into
masterfrom
github-sources

Conversation

@severo

@severosevero commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

see #327

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new GitHub-backed Source implementation so the app can parse GitHub URLs and navigate repositories (directories/files) similarly to existing Hugging Face / HTTP sources.

Changes:

  • Introduces src/lib/sources/gitHubSource.ts with URL parsing, breadcrumb/sourceParts generation, directory listing via GitHub Contents API, and branch listing via GitHub Branches API.
  • Wires GitHub source detection into the app’s source resolution chain.
  • Adds a Vitest suite covering parseGitHubUrl and getGitHubSource().sourceParts.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

FileDescription
src/lib/sources/gitHubSource.tsImplements GitHub URL parsing + Source behaviors (list files, resolve URL, versions).
src/lib/sources/index.tsExports getGitHubSource from the sources module.
src/components/App/App.tsxAdds GitHub to the source detection chain.
test/lib/sources/gitHubSource.test.tsAdds tests for parsing and breadcrumb/sourceParts generation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment threadsrc/lib/sources/gitHubSource.ts Outdated
Comment threadsrc/lib/sources/gitHubSource.ts Outdated
Comment threadsrc/lib/sources/gitHubSource.ts Outdated
Comment threadsrc/lib/sources/gitHubSource.ts Outdated
Comment threadsrc/lib/sources/gitHubSource.ts Outdated
severoand others added 4 commits March 17, 2026 12:19
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class GitHub URL support to the app’s “sources” system, enabling parsing GitHub repo/tree/blob/raw URLs, listing directory contents via the GitHub API, and integrating this new source type into the main source-resolution flow (per #327).

Changes:

  • Introduce gitHubSource with URL parsing, directory listing (GitHub Contents API), and branch listing.
  • Wire getGitHubSource into the app’s source selection chain and export it from the sources index.
  • Add unit tests for GitHub URL parsing and breadcrumb/source-part generation.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

FileDescription
src/lib/sources/gitHubSource.tsNew GitHub source implementation (parse URLs, list files, list branches, build breadcrumbs).
src/components/App/App.tsxUses getGitHubSource() during source detection.
src/lib/sources/index.tsExports getGitHubSource from the sources module.
test/lib/sources/gitHubSource.test.tsAdds coverage for GitHub URL parsing and getGitHubSource().sourceParts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment threadsrc/lib/sources/gitHubSource.ts
Comment threadtest/lib/sources/gitHubSource.test.ts
Comment threadsrc/lib/sources/gitHubSource.ts

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds GitHub as a first-class data source option (URL parsing, breadcrumb generation, and directory listing via the GitHub API) and removes the prefix field from DirSource, updating UI/test code accordingly.

Changes:

  • Introduces getGitHubSource() + parseGitHubUrl() (including breadcrumb/sourceParts behavior) and adds unit tests for URL parsing/sourceParts.
  • Removes DirSource.prefix and updates existing sources/components/tests to rely on sourceId/sourceParts instead.
  • Updates the Folder UI navigation to route using file.sourceId (via routes config) rather than joining with a directory prefix.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
FileDescription
test/lib/sources/gitHubSource.test.tsAdds tests for GitHub URL parsing and sourceParts generation.
src/lib/sources/types.tsRemoves prefix from DirSource interface.
src/lib/sources/index.tsExports getGitHubSource.
src/lib/sources/hyperparamSource.tsDrops prefix from returned DirSource object.
src/lib/sources/huggingFaceSource.tsRemoves now-unused prefix logic from HF directory source.
src/lib/sources/httpSource.tsDrops prefix from returned DirSource object.
src/lib/sources/gitHubSource.tsAdds GitHub source implementation (parsing, listFiles via API, branches/versions).
src/components/Folder/Folder.tsxSwitches folder navigation logic from prefix-join to file.sourceId routing.
src/components/Folder/Folder.test.tsxUpdates tests to match DirSource interface change (no prefix).
src/components/App/App.tsxWires GitHub source into source detection chain.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment threadsrc/lib/sources/gitHubSource.ts
Comment threadsrc/lib/sources/gitHubSource.ts Outdated
Comment threadsrc/lib/sources/gitHubSource.ts Outdated
Comment threadtest/lib/sources/gitHubSource.test.ts
Comment threadsrc/lib/sources/gitHubSource.ts
@severo
severo requested a review from platypiiMarch 18, 2026 14:24

@platypiiplatypii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cool!

@severo
severo merged commit 417545d into masterMar 18, 2026
4 checks passed
@severo
severo deleted the github-sources branch March 18, 2026 18:22
Sign up for freeto 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.

3 participants

@severo@platypii