Skip to content

fix(FR-2810): batch-load image canonical names on admin deployment preset list#7242

Merged
graphite-app[bot] merged 1 commit into
mainfrom
05-05-fix_fr-2810_batch-load_image_canonical_names_on_deployment_preset_list_page
May 5, 2026
Merged

fix(FR-2810): batch-load image canonical names on admin deployment preset list#7242
graphite-app[bot] merged 1 commit into
mainfrom
05-05-fix_fr-2810_batch-load_image_canonical_names_on_deployment_preset_list_page

Conversation

@agatha197
Copy link
Copy Markdown
Contributor

@agatha197 agatha197 commented May 5, 2026

Resolves #7241 (FR-2810)

Summary

  • Replace N per-row useLazyLoadQuery calls for image canonical names with a single batch query using adminImagesV2(filter: { id: { in: \$ids } }).
  • Remove the ImageCanonicalName sub-component that was causing the N+1 query problem.
  • Add ImagesBatchQuery component that fetches all unique image UUIDs in one request and builds a Record<uuid, canonicalName> lookup map.
  • Suspension propagates to the page-level Suspense boundary, so the table renders once images are resolved (no inner Suspense, no remount mid-load).
  • Rename DeploymentPresetNodesAdminDeploymentPresetNodes to reflect that it queries the admin-only adminImagesV2 API. The Relay fragment and query are renamed accordingly.

Root Cause

DeploymentPresetNodes rendered an ImageCanonicalName component per row, each calling useLazyLoadQuery<DeploymentPresetNodesImageQuery>. With N rows, this fired N separate GraphQL requests — one per row.

Fix

The new ImagesBatchQuery component collects all unique imageId values from the preset list, fetches them all with one adminImagesV2 query, converts Relay global IDs back to UUIDs via toLocalId, and passes the resulting name map to the table column renderer. Empty imageIds short-circuits before the query runs.

Copilot AI review requested due to automatic review settings May 5, 2026 00:24
@github-actions github-actions Bot added the size:L 100~500 LoC label May 5, 2026
Copy link
Copy Markdown
Contributor Author

agatha197 commented May 5, 2026


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 changes, fast-track this PR to the front of the merge queue

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
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.55% 1783 / 27198
🔵 Statements 5.42% 1978 / 36433
🔵 Functions 5.21% 296 / 5676
🔵 Branches 3.82% 1293 / 33813
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/pages/AdminDeploymentPresetListPage.tsx 0% 0% 0% 0% 39-67
Generated in workflow #279 for commit c0ac584 by the Vitest Coverage Report Action

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 updates the admin deployment preset list table to avoid an N+1 query pattern when displaying image canonical names, by batch-loading image metadata once and rendering the table with a resolved imageId -> canonicalName map.

Changes:

  • Replaced per-row image lookup queries with a single batched adminImagesV2 query for all image UUIDs on the page.
  • Added logic to collect unique execution.imageId values from presets and map query results back to those IDs.
  • Updated table rendering to use the resolved canonical name (falling back to the raw imageId).

Comment thread react/src/components/DeploymentPresetNodes.tsx Outdated
@agatha197 agatha197 force-pushed the 05-05-fix_fr-2810_batch-load_image_canonical_names_on_deployment_preset_list_page branch from e0d75aa to 1a0d778 Compare May 5, 2026 00:43
@github-actions github-actions Bot added size:XL 500~ LoC and removed size:L 100~500 LoC labels May 5, 2026
@agatha197 agatha197 changed the title fix(FR-2810): batch-load image canonical names on deployment preset list page fix(FR-2810): batch-load image canonical names on admin deployment preset list May 5, 2026
@github-actions github-actions Bot added size:L 100~500 LoC and removed size:XL 500~ LoC labels May 5, 2026
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented May 5, 2026

Merge activity

…eset list (#7242)

Resolves #7241 (FR-2810)

## Summary

- Replace N per-row `useLazyLoadQuery` calls for image canonical names with a single batch query using `adminImagesV2(filter: { id: { in: \$ids } })`.
- Remove the `ImageCanonicalName` sub-component that was causing the N+1 query problem.
- Add `ImagesBatchQuery` component that fetches all unique image UUIDs in one request and builds a `Record<uuid, canonicalName>` lookup map.
- Suspension propagates to the page-level Suspense boundary, so the table renders once images are resolved (no inner Suspense, no remount mid-load).
- Rename `DeploymentPresetNodes` → `AdminDeploymentPresetNodes` to reflect that it queries the admin-only `adminImagesV2` API. The Relay fragment and query are renamed accordingly.

## Root Cause

`DeploymentPresetNodes` rendered an `ImageCanonicalName` component per row, each calling `useLazyLoadQuery<DeploymentPresetNodesImageQuery>`. With N rows, this fired N separate GraphQL requests — one per row.

## Fix

The new `ImagesBatchQuery` component collects all unique `imageId` values from the preset list, fetches them all with one `adminImagesV2` query, converts Relay global IDs back to UUIDs via `toLocalId`, and passes the resulting name map to the table column renderer. Empty `imageIds` short-circuits before the query runs.
@graphite-app graphite-app Bot force-pushed the 05-05-fix_fr-2810_batch-load_image_canonical_names_on_deployment_preset_list_page branch from 3ecfd8a to c0ac584 Compare May 5, 2026 23:10
@graphite-app graphite-app Bot merged commit c0ac584 into main May 5, 2026
12 checks passed
@graphite-app graphite-app Bot deleted the 05-05-fix_fr-2810_batch-load_image_canonical_names_on_deployment_preset_list_page branch May 5, 2026 23:12
@github-pages github-pages Bot temporarily deployed to github-pages May 5, 2026 23:12 Inactive
agatha197 pushed a commit that referenced this pull request May 18, 2026
Part of the recent main-branch docs catch-up plan (Work Item 11).

New page documenting the Deployment Preset feature introduced over Q1–Q2 2026:

- FR-2750 (#7091) feature spec
- FR-2761 (#7125) admin create / edit / delete UI
- FR-2762 (#7127) preset detail view in VFolderDeployModal
- FR-2801 (#7224) pre-populate launcher fields from preset
- FR-2805 (#7233) URLSearchParams in preset navigation
- FR-2827 (#7274) clickable deployment tags filter the list
- FR-2810 (#7242) batch image canonical names on admin preset list
- FR-2773 (#7153) preserve auto-selected resourcePresetId

New sections:
1. What is a Deployment Preset?
2. (Admin) Manage Deployment Presets — list, filter, create, edit, delete (typed-confirm)
3. Using a Preset when Deploying a Model — preset detail, auto/manual deploy paths
4. Pre-populated Launcher Fields
5. Filtering by Tags

Also adds book.config.yaml navigation entries under the Model Serving category in all 4 languages.

Updated in all 4 languages (en/ko/ja/th). Screenshots flagged with TODO markers for separate capture. Linked from model_serving.md (PR B) so PR B's cross-references now resolve.
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.

Deployment preset page fires DeploymentPresetNodesImageQuery once per row instead of batching

2 participants