Skip to content

fix(resource): revoke of an unknown email returns 400 not 500 - #9573

Open
Ma77Ball wants to merge 1 commit into
apache:mainfrom
Ma77Ball:fix/resource-revoke-unknown-email
Open

Ma77Ball wants to merge 1 commit into
apache:mainfrom
Ma77Ball:fix/resource-revoke-unknown-email

Conversation

@Ma77Ball

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

  • ResourceAccess.revoke resolves the grantee uid through OwnerAccess.registeredUid and throws BadRequestException for an unregistered email, mirroring grant, so revoking access for an email that is not a registered user returns 400 instead of a 500 from a NullPointerException.

Any related issues, documentation, discussions?

Closes: #9570

How was this PR tested?

  • Run sbt "Resource/testOnly *ResourceAccessSpec" under JDK 17; expect 17 passing, including a new case asserting revoke with an unregistered email throws a 400 BadRequestException.
  • Share a dataset, then call the revoke-access endpoint with an email that is not a registered user, and confirm the response is 400, not 500.

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

Co-authored with Claude Opus 4.8 in compliance with ASF

… email

ResourceAccess.revoke resolved the grantee with ctx.select(USER.UID)...fetchOne().value1(), which returns null for an email that is not a registered user, so value1() threw a NullPointerException and the endpoint answered 500. revoke now resolves the uid through OwnerAccess.registeredUid and throws BadRequestException for an unregistered email, mirroring grant, so an unknown email yields a 400.

ResourceAccessSpec adds a revoke case asserting an unregistered email gives a 400 BadRequestException rather than crashing.
@Yicong-Huang Yicong-Huang added the release/v1.3 back porting to release/v1.3 label Nov 20, 2026
@github-actions
github-actions Bot requested a review from mengw15 November 20, 2026 21:46
@github-actions

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. A release/* label nominates a backport target; the branch's release manager approving this PR is what sends the fix there. The required Backport Approvals check stays red until every label below is approved, so each manager either approves or removes their own label — which is why the labels left on a merged PR are exactly the branches it reached.

Release branch Analysis
✅ release/v1.3 Change detected on this branch — label added; this fix is queued to backport here. @mengw15 decides: approving sends the fix here, removing this label declines it. The merge waits on one or the other. Review requested.
⚠️ release/v1.2 Not labeled automatically — none of the files this PR modifies exist on this branch (common/resource/src/main/scala/org/apache/texera/service/resource/ResourceAccess.scala, common/resource/src/test/scala/org/apache/texera/service/resource/ResourceAccessSpec.scala). The fix may target code that isn't on this release, or the files were moved/renamed after the branch was cut. Please check and add release/v1.2 by hand if this fix should be backported here — its release manager then has to approve before this PR can merge.

Auto-label run.

@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:

  • Contributors with relevant context: @aglinxinyuan, @tanishqgandhi1908
    You can notify them by mentioning @aglinxinyuan, @tanishqgandhi1908 in a comment.

@codecov-commenter

codecov-commenter commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.57%. Comparing base (7f9bdf3) to head (7b4e32d).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9573      +/-   ##
============================================
- Coverage     91.57%   91.57%   -0.01%     
  Complexity     5158     5158              
============================================
  Files          1300     1300              
  Lines         58092    58091       -1     
  Branches       7615     7615              
============================================
- Hits          53195    53194       -1     
  Misses         2959     2959              
  Partials       1938     1938              
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø)
agent-service 99.56% <ø> (ø) Carriedforward from 7f9bdf3
amber 85.43% <ø> (-0.01%) ⬇️ Carriedforward from 7f9bdf3
computing-unit-managing-service 63.88% <ø> (ø)
config-service 87.50% <ø> (ø)
file-service 82.16% <ø> (ø)
frontend 96.45% <ø> (ø) Carriedforward from 7f9bdf3
notebook-migration-service 83.77% <ø> (ø)
pyamber 98.38% <ø> (ø) Carriedforward from 7f9bdf3
result-service 85.71% <ø> (ø)
workflow-compiling-service 78.30% <ø> (ø)

*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

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main 7f9bdf3 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 495 0.302 19,734/25,678/25,678 us 🟢 -29.6% / 🔴 +94.7%
⚪ bs=100 sw=10 sl=64 1,010 0.616 97,114/114,777/114,777 us ⚪ within ±5% / 🔴 +31.9%
🔴 bs=1000 sw=10 sl=64 1,159 0.707 850,817/1,053,028/1,053,028 us 🔴 +15.0% / 🔴 +29.4%
Baseline details

Latest main 7f9bdf3 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 495 tuples/sec 497 tuples/sec 1,019 tuples/sec -0.4% -51.4%
bs=10 sw=10 sl=64 MB/s 0.302 MB/s 0.304 MB/s 0.622 MB/s -0.7% -51.5%
bs=10 sw=10 sl=64 p50 19,734 us 19,302 us 10,136 us +2.2% +94.7%
bs=10 sw=10 sl=64 p95 25,678 us 36,469 us 13,860 us -29.6% +85.3%
bs=10 sw=10 sl=64 p99 25,678 us 36,469 us 16,484 us -29.6% +55.8%
bs=100 sw=10 sl=64 throughput 1,010 tuples/sec 1,039 tuples/sec 1,363 tuples/sec -2.8% -25.9%
bs=100 sw=10 sl=64 MB/s 0.616 MB/s 0.634 MB/s 0.832 MB/s -2.8% -26.0%
bs=100 sw=10 sl=64 p50 97,114 us 92,929 us 79,194 us +4.5% +22.6%
bs=100 sw=10 sl=64 p95 114,777 us 116,556 us 87,022 us -1.5% +31.9%
bs=100 sw=10 sl=64 p99 114,777 us 116,556 us 106,894 us -1.5% +7.4%
bs=1000 sw=10 sl=64 throughput 1,159 tuples/sec 1,175 tuples/sec 1,407 tuples/sec -1.4% -17.6%
bs=1000 sw=10 sl=64 MB/s 0.707 MB/s 0.717 MB/s 0.859 MB/s -1.4% -17.7%
bs=1000 sw=10 sl=64 p50 850,817 us 845,335 us 776,422 us +0.6% +9.6%
bs=1000 sw=10 sl=64 p95 1,053,028 us 915,871 us 814,091 us +15.0% +29.4%
bs=1000 sw=10 sl=64 p99 1,053,028 us 915,871 us 860,577 us +15.0% +22.4%
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,403.96,200,128000,495,0.302,19734.21,25678.08,25678.08
1,100,10,64,20,1980.47,2000,1280000,1010,0.616,97113.76,114776.76,114776.76
2,1000,10,64,20,17254.09,20000,12800000,1159,0.707,850817.41,1053027.69,1053027.69

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common fix release/v1.3 back porting to release/v1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revoking dataset/model access for an unknown email returns 500

3 participants