VuMartin opened a new pull request, #6280:
URL: https://github.com/apache/texera/pull/6280
### 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:
1. Added coverImage field to DashboardWorkflow case class
2. Modified baseWorkflowSelect() to left join WORKFLOW_COVER_IMAGE and
select max(WORKFLOW_COVER_IMAGE.IMAGE).as("cover_image")
3. Updated WorkflowSearchQueryBuilder to include coverImage in search results
4. Updated frontend DashboardEntry and DashboardWorkflow interfaces to
include coverImage data and use it directly in card rendering
5. Replaced per-card getCover() calls with direct coverImage usage in
card-item.component.ts
### 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/list responses
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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]