Skip to content

feat(gui): warehouse dashboard tab and per-execution warehouse picker - #7536

Draft
mengw15 wants to merge 4 commits into
apache:mainfrom
mengw15:feat/6933-warehouse-frontend
Draft

feat(gui): warehouse dashboard tab and per-execution warehouse picker#7536
mengw15 wants to merge 4 commits into
apache:mainfrom
mengw15:feat/6933-warehouse-frontend

Conversation

@mengw15

@mengw15 mengw15 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Adds the user-facing UI for per-user warehouses (#6870), shown only when the backend reports the feature enabled (GET /warehouse/status):

  • Warehouses dashboard tab (/user/warehouse): list, create, and delete the caller's warehouses, via a new WarehouseService. Deleting warns that the warehouse's data is purged.
  • On-canvas picker in the computing-unit selection control: chooses which warehouse the next run writes to; the pick rides WorkflowExecuteRequest.warehouseId. Mirroring the CU selector, it preselects the latest execution's warehouse (whId, now on WorkflowExecutionsEntry) and falls back to the user's first warehouse, so a run needs no explicit pick.
  • Gating: the sidebar tab and the picker stay hidden while the flag is off; the UI is unchanged in that state.

Any related issues, documentation, discussions?

Closes #6933. Backend counterpart: #7473.

How was this PR tested?

New Vitest specs for WarehouseService (HTTP + pick state) and the warehouse tab (disabled/empty/list, create, delete); new cases in the CU-selection, execute-workflow, and dashboard specs covering preselection, the warehouseId payload, and tab gating. All touched spec files pass locally (117 tests).

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (claude-fable-5)

@github-actions github-actions Bot added feature frontend Changes related to the frontend GUI labels Aug 11, 2026
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @Neilk1021, @kunwp1, @xuang7
    You can notify them by mentioning @Neilk1021, @kunwp1, @xuang7 in a comment.

@mengw15
mengw15 requested a balanced review from Copilot August 11, 2026 05:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds feature-gated warehouse management and per-execution warehouse selection to the frontend.

Changes:

  • Adds warehouse API types, service, dashboard page, and routing.
  • Adds warehouse selection and execution payload integration.
  • Adds feature gating and Vitest coverage.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
execute-workflow.service.ts Sends the selected warehouse ID.
execute-workflow.service.spec.ts Tests execution payload handling.
computing-unit-selection.component.ts Implements warehouse selection.
computing-unit-selection.component.spec.ts Tests picker behavior.
computing-unit-selection.component.scss Styles the picker.
computing-unit-selection.component.html Renders the picker.
workflow-executions-entry.ts Adds execution warehouse metadata.
workflow-execution-history.component.spec.ts Updates execution fixtures.
user-warehouse.component.ts Implements warehouse management.
user-warehouse.component.spec.ts Tests management flows.
user-warehouse.component.scss Styles the warehouse page.
user-warehouse.component.html Renders warehouse management UI.
dashboard.component.ts Loads warehouse feature status.
dashboard.component.spec.ts Tests tab gating.
dashboard.component.html Adds the Warehouses tab.
warehouse.ts Defines warehouse API types.
warehouse.service.ts Implements warehouse API and selection state.
warehouse.service.spec.ts Tests API calls and selection state.
app-routing.module.ts Registers the warehouse route.
app-routing.constant.ts Defines the warehouse route constant.
Suppressed comments (4)

frontend/src/app/workspace/component/power-button/computing-unit-selection.component.ts:323

  • On a reused workspace component, this error path retains the previous workflow's lastExecutionWhid. If workflow A used warehouse 2 and workflow B has no executions, B therefore selects warehouse 2 instead of the documented first-warehouse fallback. Clear the cached execution warehouse before applying the fallback.
                  // No execution history: still preselect a warehouse (the first one).
                  this.applyWarehousePreselect();

frontend/src/app/workspace/component/power-button/computing-unit-selection.component.ts:347

  • Returning here leaves the root-scoped service's prior warehouse ID intact. After the feature is disabled or the current user has no warehouses, the picker is hidden but ExecuteWorkflowService still sends that stale explicit ID; the backend then rejects the run instead of using shared storage. Clear the service selection in this branch.
  private applyWarehousePreselect(): void {
    if (!this.warehouseEnabled || this.warehouses.length === 0) {
      return;

frontend/src/app/workspace/component/power-button/computing-unit-selection.component.ts:315

  • Every workflow change leaves its retrieveLatestWorkflowExecution request active. If workflow A's response arrives after switching to B, this callback applies A's warehouse while this.workflowId already points to B, so B's next run can write to the wrong warehouse. Cancel older requests with switchMap, or capture the requested workflow ID and ignore responses that no longer match.
                  this.lastExecutionWhid = latestWorkflowExecution.whId ?? undefined;
                  this.applyWarehousePreselect();

frontend/src/app/workspace/component/power-button/computing-unit-selection.component.ts:350

  • This preselection can overwrite an explicit user choice. Once the status response renders the picker, a user can select a warehouse before the concurrent latest-execution request finishes; its later callback calls this method and silently changes the selection. Track whether the user has selected a value for the current workflow and do not preselect after that point.
    const lastUsed = this.warehouses.find(warehouse => warehouse.whid === this.lastExecutionWhid);
    this.warehouseService.selectWarehouse((lastUsed ?? this.warehouses[0]).whid);

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

eId: number;
vId: number;
cuId: number;
whId: number;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right — whId is Integer on the wire and is null for shared-storage runs and after ON DELETE SET NULL. Typed as number | null in 44e65a4; the cast in the picker spec is gone.

Comment on lines +253 to +255
error: (err: unknown) => {
console.error("Failed to fetch warehouse status", err);
},

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, this was a real leak: the pick lives in the root-scoped WarehouseService, so hiding the picker left a previous workflow's id in place and the next execution would have carried it. Fixed in 44e65a4 — the status-failure path and the nothing-selectable path both clear the selection now, pinned by two spec cases (verified red without the fix).

Comment on lines +68 to +77
<i
nz-icon
nzType="delete"
class="warehouse-delete-icon"
nz-tooltip
nzTooltipTitle="Delete warehouse and all data stored in it"
(click)="confirmDelete(warehouse)"
role="button"
aria-label="Delete warehouse">
</i>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This follows the established pattern for row actions in this codebase — the computing-unit list's delete/rename/share icons are all <i nz-icon (click)> with role="button". Making just this one a real button would be inconsistent; fixing them together is a separate accessibility pass worth its own issue.

@codecov-commenter

codecov-commenter commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.77124% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.68%. Comparing base (12169c2) to head (320aadd).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../user/user-warehouse/user-warehouse.component.html 89.79% 5 Missing ⚠️
...nt/user/user-warehouse/user-warehouse.component.ts 97.43% 1 Missing ⚠️
...wer-button/computing-unit-selection.component.html 87.50% 1 Missing ⚠️
...power-button/computing-unit-selection.component.ts 95.23% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7536      +/-   ##
============================================
+ Coverage     89.65%   89.68%   +0.02%     
- Complexity     4397     4401       +4     
============================================
  Files          1177     1180       +3     
  Lines         46996    47140     +144     
  Branches       5268     5277       +9     
============================================
+ Hits          42136    42278     +142     
- Misses         3094     3102       +8     
+ Partials       1766     1760       -6     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from a09260a
agent-service 98.62% <ø> (-0.01%) ⬇️ Carriedforward from a09260a
amber 86.38% <ø> (+0.02%) ⬆️ Carriedforward from a09260a
computing-unit-managing-service 72.46% <ø> (ø) Carriedforward from a09260a
config-service 77.31% <ø> (ø) Carriedforward from a09260a
file-service 68.90% <ø> (ø) Carriedforward from a09260a
frontend 90.70% <94.77%> (+0.03%) ⬆️
notebook-migration-service 78.89% <ø> (ø) Carriedforward from a09260a
pyamber 97.57% <ø> (ø) Carriedforward from a09260a
workflow-compiling-service 57.89% <ø> (ø) Carriedforward from a09260a

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BYO-S3] Frontend: warehouse tab + on-canvas per-execution picker

3 participants