Repository navigation
fix: Clean up annotations and remove redundant request IDs - #9275
Conversation
Previously the execution IDs and workflows had to be supplied separately, but there's no reason for this. The execution can be simply resolved from the workflow and user.
There are some missing annotations on some resources, this patch simply adds them to avoid any confusion.
Automated Reviewer SuggestionsBased on the
|
Backport auto-label reportThis
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 404 | 0.247 | 24,204/30,790/30,790 us | 🔴 +10.3% / 🔴 +134.6% |
| 🔴 | bs=100 sw=10 sl=64 | 794 | 0.485 | 123,182/154,669/154,669 us | 🔴 +12.5% / 🔴 +69.8% |
| ⚪ | bs=1000 sw=10 sl=64 | 976 | 0.595 | 1,016,817/1,072,707/1,072,707 us | ⚪ within ±5% / 🔴 -21.4% |
Baseline details
Latest main 8f0fe35 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 404 tuples/sec | 448 tuples/sec | 931.98 tuples/sec | -9.8% | -56.7% |
| bs=10 sw=10 sl=64 | MB/s | 0.247 MB/s | 0.273 MB/s | 0.569 MB/s | -9.5% | -56.6% |
| bs=10 sw=10 sl=64 | p50 | 24,204 us | 21,942 us | 10,818 us | +10.3% | +123.7% |
| bs=10 sw=10 sl=64 | p95 | 30,790 us | 27,919 us | 13,127 us | +10.3% | +134.6% |
| bs=10 sw=10 sl=64 | p99 | 30,790 us | 27,919 us | 16,504 us | +10.3% | +86.6% |
| bs=100 sw=10 sl=64 | throughput | 794 tuples/sec | 880 tuples/sec | 1,210 tuples/sec | -9.8% | -34.4% |
| bs=100 sw=10 sl=64 | MB/s | 0.485 MB/s | 0.537 MB/s | 0.739 MB/s | -9.7% | -34.3% |
| bs=100 sw=10 sl=64 | p50 | 123,182 us | 112,352 us | 85,326 us | +9.6% | +44.4% |
| bs=100 sw=10 sl=64 | p95 | 154,669 us | 137,534 us | 91,092 us | +12.5% | +69.8% |
| bs=100 sw=10 sl=64 | p99 | 154,669 us | 137,534 us | 102,379 us | +12.5% | +51.1% |
| bs=1000 sw=10 sl=64 | throughput | 976 tuples/sec | 971 tuples/sec | 1,240 tuples/sec | +0.5% | -21.3% |
| bs=1000 sw=10 sl=64 | MB/s | 0.595 MB/s | 0.593 MB/s | 0.757 MB/s | +0.3% | -21.4% |
| bs=1000 sw=10 sl=64 | p50 | 1,016,817 us | 1,028,769 us | 840,622 us | -1.2% | +21.0% |
| bs=1000 sw=10 sl=64 | p95 | 1,072,707 us | 1,098,847 us | 889,172 us | -2.4% | +20.6% |
| bs=1000 sw=10 sl=64 | p99 | 1,072,707 us | 1,098,847 us | 931,615 us | -2.4% | +15.1% |
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,494.91,200,128000,404,0.247,24203.97,30789.79,30789.79
1,100,10,64,20,2519.10,2000,1280000,794,0.485,123181.68,154668.93,154668.93
2,1000,10,64,20,20500.67,20000,12800000,976,0.595,1016816.52,1072706.66,1072706.66
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9275 +/- ##
============================================
- Coverage 92.16% 92.15% -0.01%
Complexity 4967 4967
============================================
Files 1267 1267
Lines 55507 55493 -14
Branches 7126 7129 +3
============================================
- Hits 51156 51141 -15
Misses 2584 2584
- Partials 1767 1768 +1
*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:
|
There was a problem hiding this comment.
🟡 Changes recommended
The batch bookmark/delete authorization path performs roughly 2N database round trips without bounding the input, creating a scalability bottleneck, and the affected test name is misleading.
2 open issues
What changed in this PR
This PR strengthens execution-level authorization by resolving each execution’s owning workflow, adds role annotations to quota endpoints, and expands authorization tests.
Changes:
- Adds read/write access validation for execution history, bookmarking, deletion, renaming, and quota cleanup.
- Protects
UserQuotaResourcewithREGULAR/ADMINrole annotations. - Adds tests for authorized, unauthorized, read-only, and cross-workflow execution access.
| File | Review |
|---|---|
amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowExecutionsResource.scala |
Moderate: Batch authorization performs roughly two database round trips per execution without an array-size bound; resolve ownership and privileges with set-based queries. Moderate: Add endpoint-level negative tests ensuring bookmark, delete, and rename reject execution IDs belonging to a different workflow. |
amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/quota/UserQuotaResource.scala |
Moderate: Add a test for a READ-only caller attempting deleteCollection, verifying that the request is rejected and the row remains. |
amber/src/test/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowExecutionsResourceSpec.scala |
Tests execution ownership and read/write authorization behavior. Additional cross-workflow endpoint regression coverage is needed. |
amber/src/test/scala/org/apache/texera/web/resource/dashboard/user/quota/UserQuotaResourceSpec.scala |
Nit: Rename the unauthorized-access test to clearly describe the authorization condition rather than a caller “mistaking” the execution ID. |
Review effort: Lite
|
Backport PR opened: draft #9317 (#9317) to |
|
Backport PR opened: draft #9318 (#9318) to |
Keep only the tests #9275 added to WorkflowExecutionsResourceSpec; the rest of the conflict block was main-only test code. UserQuotaResourceSpec does not exist on release/v1.2, so the whole file comes along: its users now set a password to satisfy the ck_nulltest constraint that release/v1.2 still has, and the test for #9190 (owner treated as WRITE) is dropped because that fix is not on this branch. Co-Authored-By: Claude Fable 5.1 <[email protected]>


What changes were proposed in this PR?
These are some changes Meng gave me that clean up a few things regarding the IDs requests give and some missing annotations
Any related issues, documentation, discussions?
No, it is a small change, so that would be overkill.
How was this PR tested?
It contains its own tests, it's a small change so nothing else should be necessary.
Was this PR authored or co-authored using generative AI tooling?
I believe so, but I edited the patches a little for clarity and to remove excessive comment narration.