feat(gui): warehouse dashboard tab and per-execution warehouse picker - #7536
feat(gui): warehouse dashboard tab and per-execution warehouse picker#7536mengw15 wants to merge 7 commits into
Conversation
Automated Reviewer SuggestionsBased on the
|
There was a problem hiding this comment.
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
ExecuteWorkflowServicestill 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
retrieveLatestWorkflowExecutionrequest active. If workflow A's response arrives after switching to B, this callback applies A's warehouse whilethis.workflowIdalready points to B, so B's next run can write to the wrong warehouse. Cancel older requests withswitchMap, 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.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7536 +/- ##
============================================
+ Coverage 89.65% 90.54% +0.88%
- Complexity 4397 4401 +4
============================================
Files 1177 1185 +8
Lines 46996 47390 +394
Branches 5268 5300 +32
============================================
+ Hits 42136 42910 +774
+ Misses 3094 2807 -287
+ Partials 1766 1673 -93
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Per-user warehouses enabled now means every execution writes to one: the Run button leads to the create-warehouse modal when none is selected, mirroring the computing-unit Connect flow, and the picker stays visible with zero warehouses so the create path is reachable. The picker carries the caller's avatar like the CU picker, warehouse names open a read-only details modal, and the warehouse icon is hdd everywhere (database was already taken by Datasets).
The warehouse name opens a read-only details dialog (name, flavor, created); tooltips show the full display name, and the internal catalog name no longer appears anywhere in the UI. The Run button offers "Create Warehouse" when the feature is on and none is selected, mirroring the Connect state. Deleting keeps the confirm dialog busy until the backend finishes waiting out Lakekeeper's asynchronous purge (apache#7742). The warehouse icon is cloud-server everywhere (hdd was near-identical to the database icon Datasets uses), and the picker mirrors the CU picker's trigger and panel widths.
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):/user/warehouse): list, create, and delete the caller's warehouses, via a newWarehouseService. Deleting warns that the warehouse's data is purged.WorkflowExecuteRequest.warehouseId. Mirroring the CU selector, it preselects the latest execution's warehouse (whId, now onWorkflowExecutionsEntry) and falls back to the user's first warehouse, so a run needs no explicit pick.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, thewarehouseIdpayload, 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)