Skip to content

feat(dashboard): add custom cover image for workflow cards#5704

Open
Ma77Ball wants to merge 7 commits into
apache:mainfrom
Ma77Ball:feat/workflow-card-cover-image
Open

feat(dashboard): add custom cover image for workflow cards#5704
Ma77Ball wants to merge 7 commits into
apache:mainfrom
Ma77Ball:feat/workflow-card-cover-image

Conversation

@Ma77Ball

@Ma77Ball Ma77Ball commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

  • Add a workflow_cover_image(wid, image) table (cover stored as a downscaled JPEG data URL, FK to workflow with ON DELETE CASCADE) in texera_ddl.sql plus a sql/updates/25.sql migration.
  • Add access-gated GET/PUT/DELETE /workflow/{wid}/cover endpoints on WorkflowResource: read access to fetch (404 when unset), write access to set/delete, with data-URL and size validation on set.
  • Add WorkflowCoverService (frontend) that downscales/re-encodes the chosen file to a small JPEG data URL before upload, fetches the cover, and clears it.
  • Add hover controls on the workflow card (camera to pick an image, rollback to reset), shown only to the owner in private search; previewImage now prefers the stored cover.

Any related issues, documentation, discussions?

Closes: #5703

How was this PR tested?

  • Backend: WorkflowResourceCoverSpec (uses the MockTexeraDB embedded-Postgres harness) covers all three cover endpoints: 404 when unset, set/get round-trip, read by a user with read access, upsert replace, data-URL/blank/null/size validation rejections, read- and write-access gating, no-persist on validation failure, and idempotent delete. Run sbt "WorkflowExecutionService/testOnly *WorkflowResourceCoverSpec".
  • Frontend (service): WorkflowCoverService spec covers GET mapping the image, 404 resolving to undefined, DELETE being issued, and setCoverFromFile PUTting the resized data URL. Run cd frontend && yarn test --include='**/workflow-cover.service.spec.ts' --watch=false.
  • Frontend (component): CardItemComponent spec covers the cover behaviors (owner-in-private-search gating, cover load on init, default-image fallback, upload success / non-image rejection / upload failure, reset success / failure). Run cd frontend && yarn test --include='**/card-item.component.spec.ts' --watch=false.
  • Manual: open the dashboard in private search as a workflow owner, hover a card, click the camera icon, pick an image, expect the card preview to update; reload in another browser and expect the same cover (synced via backend).
  • Manual: click the rollback icon, expect the card to revert to the default background and the cover to be gone after reload.

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

Co-authored with Claude Opus 4.8 in compliance with ASF

@github-actions github-actions Bot added feature engine ddl-change Changes to the TexeraDB DDL frontend Changes related to the frontend GUI labels Jun 14, 2026
@codecov-commenter

codecov-commenter commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.28571% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.91%. Comparing base (dfa0434) to head (b39d019).

Files with missing lines Patch % Lines
...vice/user/workflow-cover/workflow-cover.service.ts 42.42% 19 Missing ⚠️
.../user/list-item/card-item/card-item.component.html 7.14% 13 Missing ⚠️
...nt/user/list-item/card-item/card-item.component.ts 76.66% 4 Missing and 3 partials ⚠️
...rce/dashboard/user/workflow/WorkflowResource.scala 97.14% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5704      +/-   ##
============================================
- Coverage     52.91%   52.91%   -0.01%     
- Complexity     2626     2635       +9     
============================================
  Files          1090     1091       +1     
  Lines         42188    42289     +101     
  Branches       4531     4544      +13     
============================================
+ Hits          22324    22376      +52     
- Misses        18555    18598      +43     
- Partials       1309     1315       +6     
Flag Coverage Δ *Carryforward flag
access-control-service 70.91% <ø> (ø)
agent-service 34.36% <ø> (ø) Carriedforward from fa5fcbb
amber 53.11% <97.14%> (+0.09%) ⬆️
computing-unit-managing-service 1.65% <ø> (ø)
config-service 56.71% <ø> (ø)
file-service 57.06% <ø> (ø)
frontend 47.89% <49.35%> (-0.05%) ⬇️
pyamber 90.71% <ø> (-0.03%) ⬇️ Carriedforward from fa5fcbb
python 90.73% <ø> (ø) Carriedforward from fa5fcbb
workflow-compiling-service 58.69% <ø> (ø)

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

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main dfa0434 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 26,102/33,922/33,922 us 🟢 -15.1% / 🔴 +9.7%
🔴 bs=100 sw=10 sl=64 812 0.496 121,770/139,402/139,402 us 🔴 +12.5% / 🔴 -9.0%
bs=1000 sw=10 sl=64 941 0.574 1,061,990/1,151,310/1,151,310 us ⚪ within ±5% / 🔴 +12.5%
Baseline details

Latest main dfa0434 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 391 tuples/sec 393 tuples/sec 410.82 tuples/sec -0.5% -4.8%
bs=10 sw=10 sl=64 MB/s 0.238 MB/s 0.24 MB/s 0.251 MB/s -0.8% -5.1%
bs=10 sw=10 sl=64 p50 26,102 us 24,248 us 23,785 us +7.6% +9.7%
bs=10 sw=10 sl=64 p95 33,922 us 39,965 us 34,980 us -15.1% -3.0%
bs=10 sw=10 sl=64 p99 33,922 us 39,965 us 34,980 us -15.1% -3.0%
bs=100 sw=10 sl=64 throughput 812 tuples/sec 864 tuples/sec 891.94 tuples/sec -6.0% -9.0%
bs=100 sw=10 sl=64 MB/s 0.496 MB/s 0.527 MB/s 0.544 MB/s -5.9% -8.9%
bs=100 sw=10 sl=64 p50 121,770 us 116,343 us 112,277 us +4.7% +8.5%
bs=100 sw=10 sl=64 p95 139,402 us 123,872 us 139,802 us +12.5% -0.3%
bs=100 sw=10 sl=64 p99 139,402 us 123,872 us 139,802 us +12.5% -0.3%
bs=1000 sw=10 sl=64 throughput 941 tuples/sec 954 tuples/sec 1,041 tuples/sec -1.4% -9.6%
bs=1000 sw=10 sl=64 MB/s 0.574 MB/s 0.582 MB/s 0.635 MB/s -1.4% -9.7%
bs=1000 sw=10 sl=64 p50 1,061,990 us 1,049,812 us 972,714 us +1.2% +9.2%
bs=1000 sw=10 sl=64 p95 1,151,310 us 1,104,869 us 1,023,057 us +4.2% +12.5%
bs=1000 sw=10 sl=64 p99 1,151,310 us 1,104,869 us 1,023,057 us +4.2% +12.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,512.09,200,128000,391,0.238,26102.42,33921.57,33921.57
1,100,10,64,20,2463.21,2000,1280000,812,0.496,121770.19,139402.28,139402.28
2,1000,10,64,20,21258.47,20000,12800000,941,0.574,1061990.33,1151309.76,1151309.76

@Ma77Ball Ma77Ball marked this pull request as ready for review June 14, 2026 12:04
@Ma77Ball

Ma77Ball commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

/request-review @xuang7 @aglinxinyuan

@github-actions github-actions Bot requested a review from xuang7 June 14, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ddl-change Changes to the TexeraDB DDL engine feature frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow setting a custom cover image on workflow dashboard cards

2 participants