Skip to content

Conversation

@yomybaby
Copy link
Member

@yomybaby yomybaby commented Nov 7, 2025

Resolves #4278 (FR-1471)

This PR migrates the GitHub and GitLab repository import functionality from the legacy web components to the React UI. The implementation includes:

  • Added a new useGetAvailableFolderName hook to generate unique folder names for imported repositories
  • Created ImportRepoForm component to handle GitHub and GitLab repository imports
  • Enhanced the import page UI with separate cards for notebook, GitHub, and GitLab imports
  • Added badge generation functionality that creates HTML/Markdown code for notebooks
  • Improved the CopyButton component to support translations and proper disabled states
  • Updated translations for all import-related features across multiple languages

The implementation ensures repositories are properly downloaded, extracted, and made available as folders that can be mounted in sessions.

Copy link
Member Author

yomybaby commented Nov 7, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Coverage report for ./packages/backend.ai-ui

St.
Category Percentage Covered / Total
🔴 Statements 49.62% 132/266
🔴 Branches 29.96% 80/267
🔴 Functions 33.33% 20/60
🔴 Lines 51.95% 120/231

Test suite run success

55 tests passing in 3 suites.

Report generated by 🧪jest coverage report action from 42aaf48

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements 4.74% 547/11529
🔴 Branches 3.86% 314/8133
🔴 Functions 2.93% 104/3548
🔴 Lines 4.69% 529/11271

Test suite run success

125 tests passing in 14 suites.

Report generated by 🧪jest coverage report action from 42aaf48

@yomybaby yomybaby force-pushed the feature/migrate-github-gitlab-import branch from 27fa091 to 492e90e Compare November 7, 2025 04:10
@yomybaby yomybaby force-pushed the feautre/migrate-to-all-import-feature-to-react branch from 7b4c0c3 to d6ecc7a Compare November 7, 2025 04:10
@yomybaby yomybaby force-pushed the feautre/migrate-to-all-import-feature-to-react branch from d6ecc7a to 83b6f17 Compare November 10, 2025 01:45
@yomybaby yomybaby force-pushed the feature/migrate-github-gitlab-import branch from 492e90e to b076bde Compare November 10, 2025 01:45
@yomybaby yomybaby force-pushed the feature/migrate-github-gitlab-import branch from b076bde to a500584 Compare November 10, 2025 08:53
@yomybaby yomybaby marked this pull request as ready for review November 10, 2025 08:53
@graphite-app graphite-app bot changed the base branch from feautre/migrate-to-all-import-feature-to-react to graphite-base/4600 November 10, 2025 11:43
@yomybaby yomybaby force-pushed the feature/migrate-github-gitlab-import branch from a500584 to 4589c0c Compare November 11, 2025 03:04
@yomybaby yomybaby changed the base branch from graphite-base/4600 to main November 11, 2025 03:04
Copilot AI review requested due to automatic review settings November 11, 2025 03:35
@yomybaby yomybaby force-pushed the feature/migrate-github-gitlab-import branch from 4589c0c to 215abba Compare November 11, 2025 03:35
Copilot finished reviewing on behalf of yomybaby November 11, 2025 03:39
Copy link
Contributor

Copilot AI left a comment

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 migrates the GitHub and GitLab repository import functionality from the legacy web component (backend-ai-import-view.ts) to a modern React-based implementation. The feature enables users to import entire repositories from GitHub and GitLab into Backend.AI virtual folders, expanding beyond the previous notebook-only import capability.

  • Removed legacy web component code for GitHub/GitLab importing (~400 lines)
  • Created new React components (ImportRepoForm) with separate UI cards for notebook, GitHub, and GitLab imports
  • Added useGetAvailableFolderName hook to generate unique folder names and prevent collisions
  • Added translation keys across 18 language files for new UI elements

Reviewed Changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 22 comments.

Show a summary per file
File Description
src/components/backend-ai-import-view.ts Removed legacy GitHub/GitLab import functionality and unused imports
react/src/pages/ImportAndRunPage.tsx Added separate cards for notebook, GitHub, and GitLab imports with updated layout
react/src/components/ImportRepoForm.tsx New component handling repository imports with URL parsing, validation, and batch session creation
react/src/components/ImportNotebook.tsx Updated form layout from inline to vertical and improved navigation logic
react/src/hooks/index.tsx Added vfolder.create method signature to BackendAIClient type
packages/backend.ai-ui/src/hooks/useGetAvailableFolderName.ts New hook to check folder name availability and generate unique names with hash suffixes
packages/backend.ai-ui/src/hooks/index.ts Exported new useGetAvailableFolderName hook
resources/i18n/*.json Added NewVFolderName and NewVFolderNameHelp translation keys across 18 language files

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

@yomybaby yomybaby force-pushed the feature/migrate-github-gitlab-import branch from 215abba to 1d4b0c8 Compare November 11, 2025 11:55
@yomybaby yomybaby requested a review from Copilot November 11, 2025 12:37
@yomybaby yomybaby force-pushed the feature/migrate-github-gitlab-import branch from 0cb900c to 7ecf347 Compare November 11, 2025 12:38
@yomybaby yomybaby requested review from ironAiken2 and nowgnuesLee and removed request for Copilot November 11, 2025 12:39
Copilot finished reviewing on behalf of yomybaby November 11, 2025 12:39
@yomybaby yomybaby force-pushed the feature/migrate-github-gitlab-import branch 2 times, most recently from 30c6e69 to 987cc03 Compare November 12, 2025 02:31
@yomybaby yomybaby changed the title feature(FR-1471): migrate the GitHub/GitLab importing feature to React feature(FR-1471): migrate the GitHub/GitLab importing feature to React with VFolder usage mode option Nov 12, 2025
@yomybaby yomybaby force-pushed the feature/migrate-github-gitlab-import branch 2 times, most recently from 2e961aa to 998cd9f Compare November 12, 2025 03:02
@yomybaby yomybaby force-pushed the feature/migrate-github-gitlab-import branch from 998cd9f to adc4754 Compare November 12, 2025 08:11
@yomybaby yomybaby force-pushed the feature/migrate-github-gitlab-import branch from adc4754 to 16ef141 Compare November 12, 2025 08:50
Copy link
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

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

LGTM

@graphite-app
Copy link

graphite-app bot commented Nov 13, 2025

Merge activity

…t with VFolder usage mode option (#4600)

Resolves #4278 ([FR-1471](https://lablup.atlassian.net/browse/FR-1471))

This PR migrates the GitHub and GitLab repository import functionality from the legacy web components to the React UI. The implementation includes:

- Added a new `useGetAvailableFolderName` hook to generate unique folder names for imported repositories
- Created `ImportRepoForm` component to handle GitHub and GitLab repository imports
- Enhanced the import page UI with separate cards for notebook, GitHub, and GitLab imports
- Added badge generation functionality that creates HTML/Markdown code for notebooks
- Improved the `CopyButton` component to support translations and proper disabled states
- Updated translations for all import-related features across multiple languages

The implementation ensures repositories are properly downloaded, extracted, and made available as folders that can be mounted in sessions.

[FR-1471]: https://lablup.atlassian.net/browse/FR-1471?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
@graphite-app graphite-app bot force-pushed the feature/migrate-github-gitlab-import branch from 95898aa to 42aaf48 Compare November 13, 2025 02:27
@graphite-app graphite-app bot merged commit 42aaf48 into main Nov 13, 2025
11 checks passed
@graphite-app graphite-app bot deleted the feature/migrate-github-gitlab-import branch November 13, 2025 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n Localization area:ux UI / UX issue. size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change Import & Run Page to Use Neo Session Launcher

4 participants