Skip to content

Conversation

@agatha197
Copy link
Contributor

@agatha197 agatha197 commented Jun 20, 2025

Resolves #3791 (FR-1093)

Migrate filebrowser caller to react component

This PR adds a new configuration option defaultFileBrowserImage to specify a default file browser image, and refactors the file browser functionality to improve user experience.

Key changes:

  • Added defaultFileBrowserImage configuration option in config.toml.sample : Now you can specify architecture of filebrowser image
  • Created a new FileBrowserButton component that handles file browser session creation
  • Updated GraphQL schema with new types and fields for service configuration and utilization metrics
  • Fixed field types in AuditLogNode to better match actual data
  • Added installed field to ImageNode to check if an image is installed on any agent
  • Improved session creation logic to handle architecture parameter properly
  • Added copy button for image name in session details

How to test

  1. change version control of installed
    compare v4, v5
    image.png
  2. (option) you can specify defaultFileBrowserImage to config.toml.
  3. (option) If you don't install filebrowser image, install from environment or use 10.82.230.49.

Checklist:

  • Documentation
  • Minium required manager version: 25.11.0
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

@github-actions github-actions bot added the size:M 30~100 LoC label Jun 20, 2025
Copy link
Contributor Author


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.

@agatha197 agatha197 force-pushed the feat_FR-1093_/migrate-filebrowser-and-sftp-server-caller-function-to-react branch from 32d09f8 to 5cf3876 Compare June 25, 2025 05:00
@github-actions github-actions bot added area:lib Library and SDK related issue. size:XL 500~ LoC and removed size:M 30~100 LoC labels Jun 25, 2025
@github-actions
Copy link

github-actions bot commented Jun 25, 2025

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
4.56% (-0.03% 🔻)
492/10784
🔴 Branches
4.03% (-0.02% 🔻)
306/7588
🔴 Functions
2.66% (-0.01% 🔻)
91/3419
🔴 Lines
4.52% (-0.02% 🔻)
477/10545
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / FileBrowserButton.tsx
0% 0% 0% 0%

Test suite run success

159 tests passing in 15 suites.

Report generated by 🧪jest coverage report action from 135cae8

@agatha197 agatha197 force-pushed the feat_FR-1093_/migrate-filebrowser-and-sftp-server-caller-function-to-react branch 4 times, most recently from c0f23ea to 173aaf8 Compare June 25, 2025 08:09
@agatha197 agatha197 marked this pull request as ready for review June 25, 2025 08:11
@agatha197 agatha197 requested review from Copilot, ironAiken2, lizable, nowgnuesLee, ragingwind and yomybaby and removed request for Copilot June 25, 2025 08:11
@agatha197 agatha197 changed the title feat(FR-1093): migrate filebrowser and sftp server caller function to react feat(FR-1093): migrate filebrowser caller function to react Jun 25, 2025
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 introduces a new defaultFileBrowserImage configuration, refactors file browser session creation into a React FileBrowserButton component, and updates the GraphQL schema and client methods to handle an architecture field in session resources.

  • Add defaultFileBrowserImage config and propagate it through login component
  • Remove legacy architecture parameter from client calls and embed it in resource objects
  • Introduce FileBrowserButton React component with copyable image name and replace old button in folder explorer
  • Extend GraphQL schema with service configuration types and correct several field definitions

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/lib/backend.ai-client-esm.ts Moved architecture into SessionResources defaults and removed extra parameter in createIfNotExists calls
src/components/backend-ai-login.ts Added defaultFileBrowserImage property and config wiring
src/components/backend-ai-import-view.ts Removed explicit architecture argument from import calls
src/components/backend-ai-folder-explorer.ts Dropped unused undefined architecture argument in SFTP calls
react/src/pages/SessionLauncherPage.tsx Updated SessionResources interface, removed standalone architecture prop from session creation
react/src/hooks/useBackendAIAppLauncher.tsx Corrected arguments type to match showLauncher API
react/src/hooks/index.tsx Added defaultFileBrowserImage to backend config type
react/src/components/SessionDetailContent.tsx Added a copyable text field for the image name
react/src/components/FolderExplorerHeader.tsx Swapped manual filebrowser button for the new FileBrowserButton
react/src/components/FileBrowserButton.tsx New component to handle filebrowser sessions in React
data/schema.graphql & merged_schema.graphql Extended schema for services, metrics, and resource-clearing mutations
config.toml.sample Documented the new defaultFileBrowserImage setting
Comments suppressed due to low confidence (3)

react/src/components/FileBrowserButton.tsx:154

  • When defaultFileBrowserImage is set without an @architecture suffix, the architecture variable will be undefined. Consider falling back to installedFilebrowserImage.architecture when no suffix is present to ensure correct session creation.
      architecture,

react/src/components/FileBrowserButton.tsx:1

  • The new FileBrowserButton component contains nontrivial session setup logic but lacks associated tests. Please add unit or integration tests covering default image selection, architecture parsing, and fallback behaviors.
import {

config.toml.sample:35

  • Clarify the expected format of defaultFileBrowserImage (e.g., name:tag@architecture) so users know how to specify an explicit architecture.
defaultFileBrowserImage = ""            # Default file browser image. If not specified, a random installed file browser image will be used.

@agatha197 agatha197 force-pushed the feat_FR-1093_/migrate-filebrowser-and-sftp-server-caller-function-to-react branch from 173aaf8 to ce36a93 Compare June 25, 2025 08:35
@agatha197 agatha197 marked this pull request as draft June 25, 2025 08:43
@agatha197 agatha197 force-pushed the feat_FR-1093_/migrate-filebrowser-and-sftp-server-caller-function-to-react branch from ce36a93 to 135cae8 Compare June 25, 2025 09:57
@github-actions github-actions bot added area:ux UI / UX issue. area:i18n Localization labels Jul 4, 2025
@agatha197 agatha197 force-pushed the feat_FR-1093_/migrate-filebrowser-and-sftp-server-caller-function-to-react branch from ffbcd43 to 391ed44 Compare July 4, 2025 09:30
@agatha197 agatha197 force-pushed the feat_FR-1093_/migrate-filebrowser-and-sftp-server-caller-function-to-react branch from 391ed44 to 0419d55 Compare July 4, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n Localization area:lib Library and SDK related issue. area:ux UI / UX issue. size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

migrate filebrowser caller function to react.

2 participants