Skip to content

feat(FR-2888): add BAIRuntimeVariantSelect and remove runtimeVariants block from DeploymentAddRevisionModalQuery#7400

Merged
graphite-app[bot] merged 1 commit into
mainfrom
05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery
May 15, 2026
Merged

feat(FR-2888): add BAIRuntimeVariantSelect and remove runtimeVariants block from DeploymentAddRevisionModalQuery#7400
graphite-app[bot] merged 1 commit into
mainfrom
05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery

Conversation

@agatha197
Copy link
Copy Markdown
Contributor

@agatha197 agatha197 commented May 13, 2026

Resolves #7399 (FR-2888)

Summary

  • Add BAIRuntimeVariantSelect to backend.ai-ui — self-paginated runtime variant select backed by Strawberry V2 runtimeVariants(...) + runtimeVariant(id:) point lookup, mirroring the BAIAvailablePresetSelect / BAIProjectVfolderSelect shape from FR-2886. Exposes an onResolvedNamesChange(map) callback so parents can maintain a tiny id→name map for branching logic without re-querying.
  • Migrate DeploymentAddRevisionCustomContent to consume BAIRuntimeVariantSelect in place of the inline antd <Select>. The "Load current revision" prefill reads the name directly from the fragment via a new runtimeVariant { name } selection on modelRuntimeConfig — no name-map round-trip needed at prefill time.
  • Drop the runtimeVariants { edges { node { id name } } } block from DeploymentAddRevisionModalQuery and the corresponding runtimeVariantsData prop pass from DeploymentAddRevisionModal to the Custom body — no remaining consumer needs the full preload.
  • Add comp:BAIRuntimeVariantSelect.SelectRuntimeVariant to all 21 BAI UI locale files (English + 20 translations).

Test plan

  • Open the Add Revision modal → Custom mode: runtime variant picker paginates and searches server-side; selected value name resolves via the point lookup.
  • Click "Load current revision": form prefills with the saved revision's variant; variantName === 'custom' branching (command/file segmented, runtime parameter section visibility) behaves identically to pre-migration.
  • Switch Preset → Custom: the preset-transfer prefill still applies the variant id and the picker shows the resolved label.
  • bash scripts/verify.sh — Relay / Lint / Format PASS. TypeScript baseline (SessionLauncherPage / StatisticsPage / StorageHostSettingPage / UserCredentialsPage / UserSettingsPage / VFolderNodeListPage) unchanged.

@github-actions github-actions Bot added the size:L 100~500 LoC label May 13, 2026
Copy link
Copy Markdown
Contributor Author

agatha197 commented May 13, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

Coverage Report for backend-ai-ui-coverage (./packages/backend.ai-ui)

Status Category Percentage Covered / Total
🔵 Lines 8.01% 362 / 4518
🔵 Statements 7.16% 411 / 5740
🔵 Functions 8.9% 94 / 1055
🔵 Branches 6.37% 362 / 5682
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/backend.ai-ui/src/components/fragments/BAIRuntimeVariantSelect.tsx 0% 0% 0% 0% 50-194
packages/backend.ai-ui/src/components/fragments/index.ts 100% 100% 100% 100%
Generated in workflow #774 for commit bf658de by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.49% 1783 / 27437
🔵 Statements 5.33% 1978 / 37071
🔵 Functions 5.25% 296 / 5629
🔵 Branches 3.73% 1293 / 34640
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/DeploymentAddRevisionCustomContent.tsx 0% 0% 0% 0% 74-1183
react/src/components/DeploymentAddRevisionModal.tsx 0% 0% 0% 0% 45-366
Generated in workflow #773 for commit bf658de by the Vitest Coverage Report Action

@agatha197 agatha197 force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from 716147f to d6d5243 Compare May 13, 2026 03:29
Copilot AI review requested due to automatic review settings May 13, 2026 03:29
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2886_add_baiavailablepresetselect_and_baiprojectvfolderselect_migrate_deployment_callers branch from 9d7841d to 65dd13d Compare May 13, 2026 03:29
Copy link
Copy Markdown
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 BAIRuntimeVariantSelect component in backend.ai-ui (server-paginated + selected-value point lookup) and migrates the deployment “Add Revision” Custom mode to use it, removing the modal-level preload of the full runtimeVariants list. It also adds the new component-scoped i18n key across UI locales.

Changes:

  • Added BAIRuntimeVariantSelect (paginated runtimeVariants(...) + runtimeVariant(id:) lookup) and exported it from the fragments barrel.
  • Migrated DeploymentAddRevisionCustomContent to use BAIRuntimeVariantSelect, and updated the fragment to read modelRuntimeConfig.runtimeVariant { name } for “Load current revision” prefill.
  • Removed the now-unused runtimeVariants { ... } block from DeploymentAddRevisionModalQuery and dropped the related prop wiring; added locale keys for the new select placeholder.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
react/src/components/DeploymentAddRevisionModal.tsx Removes runtimeVariants preload from the modal query and stops passing runtimeVariantsData into Custom content.
react/src/components/DeploymentAddRevisionCustomContent.tsx Replaces inline antd Select with BAIRuntimeVariantSelect, adds runtimeVariant { name } for prefill, and uses an id→name map for branching/submit logic.
packages/backend.ai-ui/src/components/fragments/index.ts Exports the new BAIRuntimeVariantSelect component + types.
packages/backend.ai-ui/src/components/fragments/BAIRuntimeVariantSelect.tsx Adds the new self-paginated runtime variant select with selected-value name resolution and onResolvedNamesChange.
packages/backend.ai-ui/src/locale/en.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/ko.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/ja.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/zh-CN.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/zh-TW.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/de.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/fr.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/es.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/it.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/fi.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/el.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/pt.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/pt-BR.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/pl.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/ru.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/tr.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/th.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/vi.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/id.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/ms.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
packages/backend.ai-ui/src/locale/mn.json Adds comp:BAIRuntimeVariantSelect.SelectRuntimeVariant.
Comments suppressed due to low confidence (1)

react/src/components/DeploymentAddRevisionCustomContent.tsx:696

  • handleFinish derives variantName solely from runtimeVariantNameMap. If the map hasn’t been populated yet (e.g., user clicks “Load current revision” then submits before the select’s lookup resolves, or lookup fails), variantName becomes empty and the submission logic will branch as non-custom and may serialize runtime params using an invalid/empty variant name. It would be safer to block submission (field error) until the selected variant name is resolved, or provide a synchronous fallback for the currently selected id.
    const variantName = runtimeVariantNameMap[values.runtimeVariantId] ?? '';
    const isCustom = variantName === 'custom';
    const isCommandMode = values.customDefinitionMode === 'command';

    // Build environ. The `EnvVarFormList` (`values.environ`) is the

Comment thread react/src/components/DeploymentAddRevisionCustomContent.tsx
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from d6d5243 to a69a531 Compare May 13, 2026 03:42
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2886_add_baiavailablepresetselect_and_baiprojectvfolderselect_migrate_deployment_callers branch 2 times, most recently from 03d8a84 to 1ecec40 Compare May 13, 2026 03:46
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from a69a531 to 8592026 Compare May 13, 2026 03:46
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2886_add_baiavailablepresetselect_and_baiprojectvfolderselect_migrate_deployment_callers branch from 1ecec40 to 0884d13 Compare May 13, 2026 03:50
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from 8592026 to ab4a457 Compare May 13, 2026 03:50
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from ab4a457 to ee90cf4 Compare May 13, 2026 04:53
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2886_add_baiavailablepresetselect_and_baiprojectvfolderselect_migrate_deployment_callers branch from 0884d13 to c568585 Compare May 13, 2026 04:53
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from ee90cf4 to b724b5d Compare May 14, 2026 05:21
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2886_add_baiavailablepresetselect_and_baiprojectvfolderselect_migrate_deployment_callers branch from c568585 to 07e0b94 Compare May 14, 2026 05:22
@agatha197 agatha197 changed the base branch from 05-13-feat_fr-2886_add_baiavailablepresetselect_and_baiprojectvfolderselect_migrate_deployment_callers to graphite-base/7400 May 14, 2026 07:12
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from b724b5d to a9174f0 Compare May 14, 2026 07:13
@agatha197 agatha197 force-pushed the graphite-base/7400 branch from 07e0b94 to 4d23a05 Compare May 14, 2026 07:13
@agatha197 agatha197 changed the base branch from graphite-base/7400 to 05-13-feat_fr-2886_add_baiavailablepresetselect_and_baiprojectvfolderselect_migrate_deployment_callers May 14, 2026 07:14
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2886_add_baiavailablepresetselect_and_baiprojectvfolderselect_migrate_deployment_callers branch from 4d23a05 to d37b8be Compare May 14, 2026 07:32
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch 2 times, most recently from 90e3240 to ed69612 Compare May 14, 2026 10:00
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2886_add_baiavailablepresetselect_and_baiprojectvfolderselect_migrate_deployment_callers branch from d37b8be to a96ed3c Compare May 14, 2026 10:00
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2886_add_baiavailablepresetselect_and_baiprojectvfolderselect_migrate_deployment_callers branch from a96ed3c to 8d60089 Compare May 15, 2026 07:45
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from ed69612 to bf658de Compare May 15, 2026 07:45
Copy link
Copy Markdown
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
Copy Markdown

graphite-app Bot commented May 15, 2026

Merge activity

… block from DeploymentAddRevisionModalQuery (#7400)

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

## Summary

- Add `BAIRuntimeVariantSelect` to `backend.ai-ui` — self-paginated runtime variant select backed by Strawberry V2 `runtimeVariants(...)` + `runtimeVariant(id:)` point lookup, mirroring the `BAIAvailablePresetSelect` / `BAIProjectVfolderSelect` shape from FR-2886. Exposes an `onResolvedNamesChange(map)` callback so parents can maintain a tiny id→name map for branching logic without re-querying.
- Migrate `DeploymentAddRevisionCustomContent` to consume `BAIRuntimeVariantSelect` in place of the inline antd `<Select>`. The "Load current revision" prefill reads the name directly from the fragment via a new `runtimeVariant { name }` selection on `modelRuntimeConfig` — no name-map round-trip needed at prefill time.
- Drop the `runtimeVariants { edges { node { id name } } }` block from `DeploymentAddRevisionModalQuery` and the corresponding `runtimeVariantsData` prop pass from `DeploymentAddRevisionModal` to the Custom body — no remaining consumer needs the full preload.
- Add `comp:BAIRuntimeVariantSelect.SelectRuntimeVariant` to all 21 BAI UI locale files (English + 20 translations).

## Test plan

- [ ] Open the Add Revision modal → Custom mode: runtime variant picker paginates and searches server-side; selected value name resolves via the point lookup.
- [ ] Click "Load current revision": form prefills with the saved revision's variant; `variantName === 'custom'` branching (command/file segmented, runtime parameter section visibility) behaves identically to pre-migration.
- [ ] Switch Preset → Custom: the preset-transfer prefill still applies the variant id and the picker shows the resolved label.
- [ ] `bash scripts/verify.sh` — Relay / Lint / Format PASS. TypeScript baseline (SessionLauncherPage / StatisticsPage / StorageHostSettingPage / UserCredentialsPage / UserSettingsPage / VFolderNodeListPage) unchanged.

[FR-2888]: https://lablup.atlassian.net/browse/FR-2888?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
@graphite-app graphite-app Bot force-pushed the 05-13-feat_fr-2886_add_baiavailablepresetselect_and_baiprojectvfolderselect_migrate_deployment_callers branch from 8d60089 to f6d3792 Compare May 15, 2026 07:58
@graphite-app graphite-app Bot force-pushed the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch from bf658de to 91322cc Compare May 15, 2026 07:58
Base automatically changed from 05-13-feat_fr-2886_add_baiavailablepresetselect_and_baiprojectvfolderselect_migrate_deployment_callers to main May 15, 2026 08:05
@graphite-app graphite-app Bot merged commit 91322cc into main May 15, 2026
3 of 5 checks passed
@graphite-app graphite-app Bot deleted the 05-13-feat_fr-2888_add_bairuntimevariantselect_and_remove_runtimevariants_block_from_deploymentaddrevisionmodalquery branch May 15, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add BAIRuntimeVariantSelect and remove runtimeVariants block from DeploymentAddRevisionModalQuery

3 participants