Skip to content

fix(FR-2773): preserve auto-selected resourcePresetId across applyInitialValues#7153

Merged
graphite-app[bot] merged 1 commit into
mainfrom
04-29-fix_fr-2773_preserve_auto-selected_resourcepresetid_across_applyinitialvalues
Apr 30, 2026
Merged

fix(FR-2773): preserve auto-selected resourcePresetId across applyInitialValues#7153
graphite-app[bot] merged 1 commit into
mainfrom
04-29-fix_fr-2773_preserve_auto-selected_resourcepresetid_across_applyinitialvalues

Conversation

@nowgnuesLee
Copy link
Copy Markdown
Contributor

@nowgnuesLee nowgnuesLee commented Apr 29, 2026

Resolves #7150 (FR-2773)

Stacks on top of #7152 (FR-2774).

Summary

The Resource Preset row showed - on the deployment launcher review step even though the user had a preset selected on step 3. Fixed by extending the applyInitialValues omit list so any field whose child component owns an autoSelectDefault flow is left alone when its merged value is empty.

Root cause

  1. On mount, ResourcePresetSelect's autoSelectDefault effect (a child) runs before the parent's applyInitialValues effect.
  2. Auto-select sets resourcePresetId to the first available preset name.
  3. applyInitialValues then runs and called form.setFieldsValue(merged) with merged.resourcePresetId === undefined, clobbering the auto-selected value.
  4. ResourcePresetSelect uses useControllableState_deprecated, whose stateRef retains the auto-selected value when the antd-injected value is undefined. So the step-3 Select kept displaying the preset name (giving the user the impression it was selected), while form.getFieldsValue() returned undefined.
  5. The review summary's values.resourcePresetId ? <ResourcePresetReviewDisplay … /> : '-' fell to the dash branch.

The existing code already handled the same race for resourceGroup via _.omit(merged, 'resourceGroup'). This PR generalizes that omit list to also cover resourcePresetId.

Test plan

  • bash scripts/verify.sh passes.
  • /deployments/create: select a resource group, allow auto-select to pick a preset on step 3, click Next → review step renders the preset name and resource slot icons (no -).
  • Manually change the resource preset on step 3 → review reflects the new preset.
  • Edit mode (/deployments/:id/edit): pre-filled preset still renders on review.
  • Edge: open /deployments/create directly (no URL pre-fill) and skip to review immediately → preset row shows the auto-selected preset, not -.

Copy link
Copy Markdown
Contributor Author

nowgnuesLee commented Apr 29, 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.

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 fixes initial form synchronization in the Deployment Launcher (create mode) so that auto-selected values produced by child selectors (notably resourcePresetId) are not overwritten by the parent applyInitialValues effect.

Changes:

  • Extend the “omit empty auto-selected fields” logic to cover both resourceGroup and resourcePresetId during initial form.setFieldsValue() in create mode.
  • Add clarifying comments describing the parent/child effect ordering and the resulting clobbering behavior.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
8.12% (+0% 🔼)
1859/22905
🔴 Branches 7.35% 1187/16156
🔴 Functions
4.83% (+0.02% 🔼)
297/6154
🔴 Lines
7.89% (+0% 🔼)
1750/22190

Test suite run success

865 tests passing in 40 suites.

Report generated by 🧪jest coverage report action from ab6e4b0

@nowgnuesLee nowgnuesLee force-pushed the 04-29-fix_fr-2773_preserve_auto-selected_resourcepresetid_across_applyinitialvalues branch 2 times, most recently from 66f8e77 to e98a095 Compare April 29, 2026 10:41
@nowgnuesLee nowgnuesLee force-pushed the 04-29-fix_fr-2774_query_runtime_variant_id_and_decode_to_uuid_for_addmodelrevision branch from 0c34019 to 864d385 Compare April 29, 2026 10:41
@nowgnuesLee nowgnuesLee force-pushed the 04-29-fix_fr-2773_preserve_auto-selected_resourcepresetid_across_applyinitialvalues branch from e98a095 to 9fa9038 Compare April 29, 2026 10:48
@nowgnuesLee nowgnuesLee force-pushed the 04-29-fix_fr-2774_query_runtime_variant_id_and_decode_to_uuid_for_addmodelrevision branch from 864d385 to 196024c Compare April 29, 2026 10:48
@nowgnuesLee nowgnuesLee force-pushed the 04-29-fix_fr-2773_preserve_auto-selected_resourcepresetid_across_applyinitialvalues branch from 9fa9038 to 69b4380 Compare April 30, 2026 01:37
@nowgnuesLee nowgnuesLee force-pushed the 04-29-fix_fr-2774_query_runtime_variant_id_and_decode_to_uuid_for_addmodelrevision branch from 196024c to f5f8814 Compare April 30, 2026 01:37
@ironAiken2 ironAiken2 force-pushed the 04-29-fix_fr-2773_preserve_auto-selected_resourcepresetid_across_applyinitialvalues branch from 69b4380 to ecdd93b Compare April 30, 2026 06:51
@ironAiken2 ironAiken2 force-pushed the 04-29-fix_fr-2774_query_runtime_variant_id_and_decode_to_uuid_for_addmodelrevision branch from f5f8814 to b6d3266 Compare April 30, 2026 06:51
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Apr 30, 2026

Merge activity

…tialValues (#7153)

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

> Stacks on top of #7152 (FR-2774).

## Summary

The Resource Preset row showed `-` on the deployment launcher review step even though the user had a preset selected on step 3. Fixed by extending the `applyInitialValues` omit list so any field whose child component owns an `autoSelectDefault` flow is left alone when its merged value is empty.

## Root cause

1. On mount, `ResourcePresetSelect`'s `autoSelectDefault` effect (a child) runs **before** the parent's `applyInitialValues` effect.
2. Auto-select sets `resourcePresetId` to the first available preset name.
3. `applyInitialValues` then runs and called `form.setFieldsValue(merged)` with `merged.resourcePresetId === undefined`, clobbering the auto-selected value.
4. `ResourcePresetSelect` uses `useControllableState_deprecated`, whose `stateRef` retains the auto-selected value when the antd-injected `value` is `undefined`. So the step-3 Select **kept displaying** the preset name (giving the user the impression it was selected), while `form.getFieldsValue()` returned `undefined`.
5. The review summary's `values.resourcePresetId ? <ResourcePresetReviewDisplay … /> : '-'` fell to the dash branch.

The existing code already handled the same race for `resourceGroup` via `_.omit(merged, 'resourceGroup')`. This PR generalizes that omit list to also cover `resourcePresetId`.

## Test plan

- [ ] `bash scripts/verify.sh` passes.
- [ ] `/deployments/create`: select a resource group, allow auto-select to pick a preset on step 3, click Next → review step renders the preset name and resource slot icons (no `-`).
- [ ] Manually change the resource preset on step 3 → review reflects the new preset.
- [ ] Edit mode (`/deployments/:id/edit`): pre-filled preset still renders on review.
- [ ] Edge: open `/deployments/create` directly (no URL pre-fill) and skip to review immediately → preset row shows the auto-selected preset, not `-`.

[FR-2773]: https://lablup.atlassian.net/browse/FR-2773?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
@graphite-app graphite-app Bot force-pushed the 04-29-fix_fr-2774_query_runtime_variant_id_and_decode_to_uuid_for_addmodelrevision branch from b6d3266 to d033937 Compare April 30, 2026 07:05
@graphite-app graphite-app Bot force-pushed the 04-29-fix_fr-2773_preserve_auto-selected_resourcepresetid_across_applyinitialvalues branch from ecdd93b to ab6e4b0 Compare April 30, 2026 07:06
graphite-app Bot pushed a commit that referenced this pull request Apr 30, 2026
Resolves #7157 ([FR-2776](https://lablup.atlassian.net/browse/FR-2776))

> Stacks on top of #7153 (FR-2773) → #7152 (FR-2774).

## Symptom

Relay compile errors after a schema sync:

```
✖︎ Unknown argument 'options'.
  react/src/components/DeploymentAddRevisionModal.tsx:172:41
  react/src/pages/DeploymentLauncherPage.tsx:259:41
```

## Schema change

`addModelRevision` no longer takes `options` as a top-level mutation argument. The `AddRevisionOptions` payload is now a field on `AddRevisionInput`:

```graphql
# Before
addModelRevision(input: AddRevisionInput!, options: AddRevisionOptions): AddRevisionPayload!

# After
addModelRevision(input: AddRevisionInput!): AddRevisionPayload!

# AddRevisionInput now has:
options: AddRevisionOptions = null
```

## Changes

### `react/src/pages/DeploymentLauncherPage.tsx`

- `DeploymentLauncherPageEditMutation`: drop the `$options: AddRevisionOptions` variable and the `, options: $options` argument from the `addModelRevision` selection.
- `handleAddRevision`: move `options: { autoActivate: true }` from `variables` (top level) into `variables.input`.

### `react/src/components/DeploymentAddRevisionModal.tsx`

- `DeploymentAddRevisionModalAddMutation`: drop the inline `options: { autoActivate: true }` argument from the `addModelRevision` selection.
- `commitAdd`: pass `options: { autoActivate: true }` inside the `input` payload.

### `data/schema.graphql`

- Sync to the new server schema (drives Relay compiler against the latest definition).

## Test plan

- [x] `pnpm run relay` compiles without errors.
- [x] `bash scripts/verify.sh` passes (Relay / Lint / Format / TypeScript).
- [ ] `/deployments/create`: create-then-add-revision flow still produces an active revision (auto-activated).
- [ ] Standalone Add Revision modal: clicking "Add Revision" creates a new revision and auto-activates it.

[FR-2776]: https://lablup.atlassian.net/browse/FR-2776?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Base automatically changed from 04-29-fix_fr-2774_query_runtime_variant_id_and_decode_to_uuid_for_addmodelrevision to main April 30, 2026 07:19
@graphite-app graphite-app Bot merged commit ab6e4b0 into main Apr 30, 2026
8 checks passed
@graphite-app graphite-app Bot deleted the 04-29-fix_fr-2773_preserve_auto-selected_resourcepresetid_across_applyinitialvalues branch April 30, 2026 07:20
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:S 10~30 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(FR-2773): resource preset shows '-' in deployment launcher review step despite being selected

2 participants