Skip to content

Mark user component query parameter as required#18631

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

Mark user component query parameter as required#18631
wolfkill wants to merge 1 commit into
apache:masterfrom
wolfkill:fix/user-component-required

Conversation

@wolfkill
Copy link
Copy Markdown
Contributor

Summary

  • mark the component query parameter as required for get, delete, and update User API operations
  • add a reflection-based test to keep the Swagger contract aligned with the required User API parameter

Why

The User API needs component to identify the component-specific user entry. Without this Swagger metadata, the UI can present the field as optional even though the request path requires it.

Fixes #14594

Tests

  • RED: JAVA_HOME=/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home ./mvnw -pl pinot-controller -am -Dtest=PinotAccessControlUserRestletResourceSwaggerTest -Dsurefire.failIfNoSpecifiedTests=false test failed before the annotation change with component must be marked required on getUser expected [true] but found [false]
  • GREEN: JAVA_HOME=/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home ./mvnw -pl pinot-controller -am -Dtest=PinotAccessControlUserRestletResourceSwaggerTest -Dsurefire.failIfNoSpecifiedTests=false test
  • git diff --check

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.41%. Comparing base (a762254) to head (21b605f).

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18631      +/-   ##
============================================
+ Coverage     64.40%   64.41%   +0.01%     
  Complexity     1137     1137              
============================================
  Files          3337     3337              
  Lines        206069   206069              
  Branches      32128    32128              
============================================
+ Hits         132710   132731      +21     
+ Misses        62726    62703      -23     
- Partials      10633    10635       +2     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-21 64.41% <ø> (+0.01%) ⬆️
temurin 64.41% <ø> (+0.01%) ⬆️
unittests 64.40% <ø> (+0.01%) ⬆️
unittests1 56.82% <ø> (+<0.01%) ⬆️
unittests2 36.94% <ø> (+0.01%) ⬆️

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