Skip to content

fix: require component for user APIs#18606

Open
wolfkill wants to merge 1 commit into
apache:masterfrom
wolfkill:fix/user-api-component-required
Open

fix: require component for user APIs#18606
wolfkill wants to merge 1 commit into
apache:masterfrom
wolfkill:fix/user-api-component-required

Conversation

@wolfkill
Copy link
Copy Markdown
Contributor

Fixes #14594.

Summary

  • mark the user API component query parameter as required for get/delete/update endpoints
  • reject missing component values with a clear bad request instead of constructing null user names or surfacing an NPE
  • normalize validated component values before update/delete user lookups

Tests

  • JAVA_HOME=/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home ./mvnw -pl pinot-controller -am -Dtest=PinotAccessControlUserRestletResourceTest#testGetUserWithoutComponentReturnsClearBadRequest+testUserComponentQueryParamIsRequiredInSwagger -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false test
  • JAVA_HOME=/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home ./mvnw -pl pinot-controller -am -Dtest=PinotAccessControlUserRestletResourceTest -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false test
  • git diff --check

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 28, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 64.38%. Comparing base (9f8eb1a) to head (6517e60).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...sources/PinotAccessControlUserRestletResource.java 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18606      +/-   ##
============================================
+ Coverage     64.37%   64.38%   +0.01%     
  Complexity     1137     1137              
============================================
  Files          3335     3335              
  Lines        206065   206073       +8     
  Branches      32136    32137       +1     
============================================
+ Hits         132649   132676      +27     
+ Misses        62760    62750      -10     
+ Partials      10656    10647       -9     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-21 64.38% <92.30%> (+0.01%) ⬆️
temurin 64.38% <92.30%> (+0.01%) ⬆️
unittests 64.38% <92.30%> (+0.01%) ⬆️
unittests1 56.79% <ø> (+0.02%) ⬆️
unittests2 36.92% <92.30%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User API: API fails if we skip component field, which is not marked as required

2 participants