fix(workflow): include coverImage in search and list API responses#6280
fix(workflow): include coverImage in search and list API responses#6280VuMartin wants to merge 7 commits into
Conversation
Automated Reviewer SuggestionsBased on the
|
There was a problem hiding this comment.
Pull request overview
This PR reduces dashboard workflow-card network fan-out by including each workflow’s coverImage payload directly in workflow list/search responses, so the frontend can render card previews without per-card GET /workflow/{wid}/cover calls.
Changes:
- Backend: extend workflow search/list query builders to left-join
WORKFLOW_COVER_IMAGEand aggregate/select the cover image intoDashboardWorkflow.coverImage. - Frontend: extend dashboard workflow typings/entry mapping and switch card rendering to use the bundled
coverImagevalue instead of fetching covers per card. - Tests: add a backend test asserting cover images are present in workflow search results.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/app/dashboard/type/dashboard-workflow.interface.ts | Adds coverImage to the workflow dashboard type. |
| frontend/src/app/dashboard/type/dashboard-entry.ts | Maps backend coverImage onto DashboardEntry.coverImageUrl for card rendering. |
| frontend/src/app/dashboard/component/user/list-item/card-item/card-item.component.ts | Stops per-card cover fetch; uses bundled cover image for workflow cards. |
| amber/src/test/scala/org/apache/texera/web/resource/dashboard/file/WorkflowResourceSpec.scala | Adds regression test for cover image inclusion in search results. |
| amber/src/main/scala/org/apache/texera/web/resource/dashboard/WorkflowSearchQueryBuilder.scala | Includes cover image in workflow search query + mapping. |
| amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala | Includes cover image in workflow list query + DashboardWorkflow model. |
| amber/src/main/scala/org/apache/texera/web/resource/dashboard/UnifiedResourceSchema.scala | Extends unified schema to carry workflow cover image field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6280 +/- ##
============================================
+ Coverage 61.02% 61.05% +0.03%
- Complexity 3375 3380 +5
============================================
Files 1140 1140
Lines 44923 44943 +20
Branches 4942 4946 +4
============================================
+ Hits 27413 27440 +27
+ Misses 16001 15989 -12
- Partials 1509 1514 +5
*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:
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 379 | 0.232 | 26,185/35,578/35,578 us | 🔴 +26.8% / 🔴 +140.5% |
| 🔴 | bs=100 sw=10 sl=64 | 805 | 0.491 | 123,328/146,067/146,067 us | 🔴 +6.3% / 🔴 +41.6% |
| ⚪ | bs=1000 sw=10 sl=64 | 931 | 0.568 | 1,073,434/1,119,847/1,119,847 us | ⚪ within ±5% / 🔴 -13.2% |
Baseline details
Latest main 45c82a5 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 379 tuples/sec | 454 tuples/sec | 814.14 tuples/sec | -16.5% | -53.4% |
| bs=10 sw=10 sl=64 | MB/s | 0.232 MB/s | 0.277 MB/s | 0.497 MB/s | -16.2% | -53.3% |
| bs=10 sw=10 sl=64 | p50 | 26,185 us | 20,645 us | 12,120 us | +26.8% | +116.1% |
| bs=10 sw=10 sl=64 | p95 | 35,578 us | 33,551 us | 14,792 us | +6.0% | +140.5% |
| bs=10 sw=10 sl=64 | p99 | 35,578 us | 33,551 us | 18,232 us | +6.0% | +95.1% |
| bs=100 sw=10 sl=64 | throughput | 805 tuples/sec | 844 tuples/sec | 1,050 tuples/sec | -4.6% | -23.3% |
| bs=100 sw=10 sl=64 | MB/s | 0.491 MB/s | 0.515 MB/s | 0.641 MB/s | -4.7% | -23.4% |
| bs=100 sw=10 sl=64 | p50 | 123,328 us | 116,066 us | 96,227 us | +6.3% | +28.2% |
| bs=100 sw=10 sl=64 | p95 | 146,067 us | 144,462 us | 103,174 us | +1.1% | +41.6% |
| bs=100 sw=10 sl=64 | p99 | 146,067 us | 144,462 us | 111,033 us | +1.1% | +31.6% |
| bs=1000 sw=10 sl=64 | throughput | 931 tuples/sec | 942 tuples/sec | 1,072 tuples/sec | -1.2% | -13.2% |
| bs=1000 sw=10 sl=64 | MB/s | 0.568 MB/s | 0.575 MB/s | 0.655 MB/s | -1.2% | -13.2% |
| bs=1000 sw=10 sl=64 | p50 | 1,073,434 us | 1,055,849 us | 950,645 us | +1.7% | +12.9% |
| bs=1000 sw=10 sl=64 | p95 | 1,119,847 us | 1,174,340 us | 991,936 us | -4.6% | +12.9% |
| bs=1000 sw=10 sl=64 | p99 | 1,119,847 us | 1,174,340 us | 1,022,498 us | -4.6% | +9.5% |
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,527.11,200,128000,379,0.232,26184.67,35578.14,35578.14
1,100,10,64,20,2485.87,2000,1280000,805,0.491,123327.50,146066.71,146066.71
2,1000,10,64,20,21491.34,20000,12800000,931,0.568,1073434.02,1119846.55,1119846.55
xuang7
left a comment
There was a problem hiding this comment.
LGTM. Could you add a test case for the uncovered part?
What changes were proposed in this PR?
Include workflow cover image data in the dashboard search response to prevent the frontend from needing additional requests to fetch cover images.
This PR fixes the N+1 query issue where each workflow card was making a separate GET /workflow/{wid}/cover request to fetch its cover image.
Before:
· The frontend loads the workflow list (1 request)


· Each card calls workflowCoverService.getCover() individually (N requests)
· Total: 1 + N requests for N workflows
After:
· /dashboard/search and workflow responses now include the coverImage field in the response



· Each card uses the bundled data directly
· Total: 1 request
Changes made:
Any related issues, documentation, discussions?
Closes #5920
Follow-up to #5704
How was this PR tested?
Manual Testing:
· Verified coverImage field appears in search responses
· Uploaded a test cover image via API and confirmed it appears in search response
Automated Tests:
· Added a test case to verify workflow cover images are included in search results.
Tested with:
sbt "project WorkflowExecutionService" "testOnly *WorkflowResourceSpec -- -z "include workflow cover image in search results""
Was this PR authored or co-authored using generative AI tooling?
Co-authored with ChatGPT 5.5-mini