Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix. Allow passing null http headers object to translateTableName #12764

Merged

Conversation

shounakmk219
Copy link
Collaborator

Addresses issue #12745

@codecov-commenter
Copy link

codecov-commenter commented Apr 1, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 61.53%. Comparing base (59551e4) to head (377dc63).
Report is 188 commits behind head on master.

Files Patch % Lines
...a/org/apache/pinot/common/utils/DatabaseUtils.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #12764      +/-   ##
============================================
- Coverage     61.75%   61.53%   -0.22%     
+ Complexity      207      198       -9     
============================================
  Files          2436     2462      +26     
  Lines        133233   134627    +1394     
  Branches      20636    20839     +203     
============================================
+ Hits          82274    82841     +567     
- Misses        44911    45600     +689     
- Partials       6048     6186     +138     
Flag Coverage Δ
custom-integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration <0.01% <0.00%> (-0.01%) ⬇️
integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration2 0.00% <0.00%> (ø)
java-11 34.49% <0.00%> (-27.22%) ⬇️
java-21 61.42% <0.00%> (-0.21%) ⬇️
skip-bytebuffers-false 61.51% <0.00%> (-0.24%) ⬇️
skip-bytebuffers-true 61.39% <0.00%> (+33.67%) ⬆️
temurin 61.53% <0.00%> (-0.22%) ⬇️
unittests 61.52% <0.00%> (-0.22%) ⬇️
unittests1 46.12% <0.00%> (-0.77%) ⬇️
unittests2 27.94% <0.00%> (+0.21%) ⬆️

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.

Copy link
Member

@jackjlli jackjlli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing it! Does it make sense to put the @Nullable annotation to the callers of these two methods, like handleRequest() in BrokerRequestHandler class?

@shounakmk219
Copy link
Collaborator Author

shounakmk219 commented Apr 2, 2024

Not sure if implementations of BrokerRequestHandler.handleRequest are fine with a null header.
FineGrainedAccessControl.hasAccess interface which is invoked in BaseBrokerRequestHandler.handleRequest may be sensitive to headers based on provided implementation.
Technically the util only breaks if invoked through tests with null header as existing code path does not pass a null header anywhere.
I have handled this at test side code itself earlier during introduction of the util.

@jackjlli
Copy link
Member

jackjlli commented Apr 2, 2024

Not just the test code which will invoke the real logic, in fact a lot of companies will invoke the handleRequest() method with their own ways.

I have handled this at test side code itself earlier during introduction of the util.

And I just tested the code before the PR mentioned above, previously the test did work with a null httpHeaders. But after the code change in that PR it starts to fail with a null httpHeaders. Could you add a unit test for this to make sure the original behavior won't break?

Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm merging it since the fix is very straight forward. We can discuss why null values are passed in separately

@Jackie-Jiang Jackie-Jiang merged commit 3ce3697 into apache:master Apr 5, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants