Skip to content

feat(amber): expose the warehouse owner in DashboardWarehouse - #7745

Merged
kunwp1 merged 3 commits into
apache:mainfrom
mengw15:feat/7743-warehouse-owner-fields
Aug 19, 2026
Merged

feat(amber): expose the warehouse owner in DashboardWarehouse#7745
kunwp1 merged 3 commits into
apache:mainfrom
mengw15:feat/7743-warehouse-owner-fields

Conversation

@mengw15

@mengw15 mengw15 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

GET /warehouse/status returns DashboardWarehouse(whid, name, warehouseName, flavor, createdAtMillis) with no owner information, so the warehouse dashboard tab and picker (#6933) can only render the owner avatar from the currently signed-in user. That is correct only while warehouses are strictly per-user, and would show the wrong person as soon as warehouses can be shared. Computing units already model this properly: DashboardWorkflowComputingUnit carries ownerName / ownerAvatar resolved per entry.

  • Add ownerName and ownerAvatar to DashboardWarehouse, mirroring the computing-unit semantics: resolved from the user table per entry, null when the user has no name or avatar set.
  • Resolution is batched over the distinct owner uids of a listing (one query per request) — today every entry belongs to the caller, but the shape is ready for shared warehouses, which is the point of the change.
  • Both mapping paths are wired: the status() listing and the create() response.
  • Frontend is deliberately untouched: the tab/picker PR (feat(gui): warehouse dashboard tab and per-execution warehouse picker #7536) is still open and can bind to the new fields directly.

Any related issues, documentation, discussions?

Closes #7743. Part of #6870, follow-up to #6932; mirrors DashboardWorkflowComputingUnit's owner fields.

How was this PR tested?

  • WarehouseResourceSpec (embedded Postgres + stubbed LakekeeperClient, no external infra) asserts the fields on both mapping paths: create returns the caller's ownerName with a null ownerAvatar for the avatar-less fixture user, and status resolves another user's name and avatar per entry.
  • Teeth verified: temporarily breaking the owner resolution turns exactly the two owner assertions red (both mapping paths), confirming the tests catch a regression rather than passing vacuously.
  • Full spec run locally: 11/11 passed; WorkflowExecutionService/scalafmtCheck (main + Test) passes.

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

Generated-by: Claude Code (claude-opus-4-8)

GET /warehouse/status returned DashboardWarehouse without owner
information, so the warehouse dashboard tab and picker could only render
the owner avatar from the currently signed-in user -- correct only while
warehouses are strictly per-user, and wrong as soon as they can be shared.

Mirror how computing units model this: add ownerName / ownerAvatar to
DashboardWarehouse, resolved per entry from the user table (null when the
user has no name or avatar set), batched over the distinct owner uids of a
listing. The UI can then bind each entry to its own owner instead of the
session user.

WarehouseResourceSpec asserts the fields on both mapping paths: create
returns the caller's name with a null avatar for the avatar-less fixture
user, and status resolves another user's name and avatar per entry.

Part of apache#6870, follow-up to apache#6932. Closes apache#7743.
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

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

  • No candidates found from git blame history.

@mengw15
mengw15 requested a balanced review from Copilot August 18, 2026 00:40
@mengw15
mengw15 requested a review from kunwp1 August 18, 2026 00:42

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 per-warehouse owner metadata to dashboard API responses.

Changes:

  • Batches owner name/avatar resolution from the user table.
  • Populates owner fields for warehouse listing and creation responses.
  • Tests populated and null owner metadata.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
WarehouseResource.scala Adds and resolves owner fields.
WarehouseResourceSpec.scala Verifies owner metadata mappings.

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

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 2 better · 🔴 4 worse · ⚪ 9 noise (<±5%) · 0 without baseline

Compared against main 60300e3 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 391 0.238 25,435/30,548/30,548 us 🔴 +20.0% / 🔴 +99.5%
🔴 bs=100 sw=10 sl=64 797 0.486 123,894/144,281/144,281 us 🔴 +6.6% / 🔴 +35.1%
bs=1000 sw=10 sl=64 930 0.567 1,074,475/1,164,261/1,164,261 us ⚪ within ±5% / 🔴 +14.9%
Baseline details

Latest main 60300e3 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 391 tuples/sec 419 tuples/sec 771.02 tuples/sec -6.7% -49.3%
bs=10 sw=10 sl=64 MB/s 0.238 MB/s 0.256 MB/s 0.471 MB/s -7.0% -49.4%
bs=10 sw=10 sl=64 p50 25,435 us 21,200 us 12,749 us +20.0% +99.5%
bs=10 sw=10 sl=64 p95 30,548 us 33,998 us 15,594 us -10.1% +95.9%
bs=10 sw=10 sl=64 p99 30,548 us 33,998 us 19,320 us -10.1% +58.1%
bs=100 sw=10 sl=64 throughput 797 tuples/sec 834 tuples/sec 997.05 tuples/sec -4.4% -20.1%
bs=100 sw=10 sl=64 MB/s 0.486 MB/s 0.509 MB/s 0.609 MB/s -4.5% -20.1%
bs=100 sw=10 sl=64 p50 123,894 us 116,243 us 100,339 us +6.6% +23.5%
bs=100 sw=10 sl=64 p95 144,281 us 151,279 us 106,781 us -4.6% +35.1%
bs=100 sw=10 sl=64 p99 144,281 us 151,279 us 113,101 us -4.6% +27.6%
bs=1000 sw=10 sl=64 throughput 930 tuples/sec 928 tuples/sec 1,037 tuples/sec +0.2% -10.3%
bs=1000 sw=10 sl=64 MB/s 0.567 MB/s 0.566 MB/s 0.633 MB/s +0.2% -10.4%
bs=1000 sw=10 sl=64 p50 1,074,475 us 1,069,727 us 971,388 us +0.4% +10.6%
bs=1000 sw=10 sl=64 p95 1,164,261 us 1,177,814 us 1,013,249 us -1.2% +14.9%
bs=1000 sw=10 sl=64 p99 1,164,261 us 1,177,814 us 1,039,879 us -1.2% +12.0%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,512.14,200,128000,391,0.238,25435.19,30548.27,30548.27
1,100,10,64,20,2509.84,2000,1280000,797,0.486,123893.77,144281.22,144281.22
2,1000,10,64,20,21511.74,20000,12800000,930,0.567,1074475.36,1164260.62,1164260.62

@codecov-commenter

codecov-commenter commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.22%. Comparing base (60300e3) to head (a0a0e29).
⚠️ Report is 8 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7745      +/-   ##
============================================
+ Coverage     91.02%   91.22%   +0.19%     
- Complexity     4454     4468      +14     
============================================
  Files          1174     1171       -3     
  Lines         47146    47124      -22     
  Branches       5287     5286       -1     
============================================
+ Hits          42916    42988      +72     
+ Misses         2550     2458      -92     
+ Partials       1680     1678       -2     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from efa9052
agent-service 98.62% <ø> (ø) Carriedforward from efa9052
amber 87.98% <100.00%> (+0.52%) ⬆️
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from efa9052
config-service 86.73% <ø> (ø) Carriedforward from efa9052
file-service 68.90% <ø> (ø) Carriedforward from efa9052
frontend 92.59% <ø> (ø) Carriedforward from efa9052
notebook-migration-service 83.74% <ø> (ø) Carriedforward from efa9052
pyamber 97.57% <ø> (ø) Carriedforward from efa9052
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from efa9052

*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.

@kunwp1 kunwp1 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.

Left some comments!

Review feedback on the owner fields:

The listing fetched warehouses and then looked their owners up in a
second query. Join instead, so one round trip carries both. `create`
went to the database at all, though the caller is the owner it is
resolving and SessionUser already holds their display info -- it now
reads from there.

What remains of the resolution is turning an unset name or avatar into
null, so that is all `ownerOf` does. The `(null, null)` fallback a
reviewer asked to name is gone rather than named: with the left join
supplying nulls directly and `create` reading the session, nothing is
left that has to invent an absent owner.
@mengw15
mengw15 requested review from kunwp1 and a balanced review from Copilot August 19, 2026 07:14

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/warehouse/WarehouseResource.scala:205

  • The create response takes owner data from the JWT-backed SessionUser, while status() reads the user table. JWT claims can be stale (for example, an admin can update the user's name while their token remains valid), so the POST response can return a different owner than an immediate GET and does not satisfy the per-entry database resolution. Read the owner row here as well; a regression test can mutate the persisted user after constructing the session.
    // The caller owns what they just created, and SessionUser already carries their
    // display info -- no lookup needed.
    toDashboardWarehouse(row, ownerOf(current_user.getUser))

@kunwp1 kunwp1 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.

LGTM! Can you also update the PR description because "batched over the distinct owner uids of a listing (one query per request)" this is no longer valid.

@kunwp1
kunwp1 added this pull request to the merge queue Aug 19, 2026
Merged via the queue into apache:main with commit c927890 Aug 19, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BYO-S3] Expose the warehouse owner in DashboardWarehouse

4 participants