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

fixing swagger setup using localhost as host name #13254

Merged
merged 1 commit into from
May 29, 2024

Conversation

xiangfu0
Copy link
Contributor

Introduced https://github.com/apache/pinot/pull/13122/files#diff-7c6118ecbf342922f9e9288c5fbaf9c8dd3f158895d2a7e4e5582762249ecd06R54

We shouldn't set swagger hostname as localhost, which might not be accessible from the external environment.

E.g. pinot deployed in k8s will using pinot-controller-1 as lcoalhost name, but this hostname is not exposed outside.

Current Behavior is using machine hostname:
image

image

After fix:
image

image

@xiangfu0
Copy link
Contributor Author

cc: @abhioncbr

@xiangfu0 xiangfu0 added ui UI related issue bugfix labels May 29, 2024
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.

We do set host on server before. We might need to check the history on that. Maybe no one ever uses server swagger

@@ -50,12 +50,6 @@ public static void setupSwagger(String componentType, String resourcePackage, bo
beanConfig.setResourcePackage(resourcePackage);
beanConfig.setScan(true);

try {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to set the host based on the config for better customization? We can make a separate issue to support that.

Copy link
Contributor

Choose a reason for hiding this comment

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

It was introduced in #5941, and doesn't seem required. We can remove it for now and revisit later. This seems like a bug to me

@codecov-commenter
Copy link

codecov-commenter commented May 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.16%. Comparing base (59551e4) to head (628a5c5).
Report is 509 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #13254      +/-   ##
============================================
+ Coverage     61.75%   62.16%   +0.41%     
+ Complexity      207      198       -9     
============================================
  Files          2436     2534      +98     
  Lines        133233   139016    +5783     
  Branches      20636    21541     +905     
============================================
+ Hits          82274    86419    +4145     
- Misses        44911    46135    +1224     
- Partials       6048     6462     +414     
Flag Coverage Δ
custom-integration1 <0.01% <ø> (-0.01%) ⬇️
integration <0.01% <ø> (-0.01%) ⬇️
integration1 <0.01% <ø> (-0.01%) ⬇️
integration2 0.00% <ø> (ø)
java-11 62.13% <ø> (+0.42%) ⬆️
java-21 62.03% <ø> (+0.40%) ⬆️
skip-bytebuffers-false 62.14% <ø> (+0.39%) ⬆️
skip-bytebuffers-true 62.01% <ø> (+34.28%) ⬆️
temurin 62.16% <ø> (+0.41%) ⬆️
unittests 62.16% <ø> (+0.41%) ⬆️
unittests1 46.68% <ø> (-0.21%) ⬇️
unittests2 27.81% <ø> (+0.08%) ⬆️

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.

@xiangfu0 xiangfu0 force-pushed the fixing-swagger-localhost-issue branch from 3a06f96 to 628a5c5 Compare May 29, 2024 03:38
@xiangfu0 xiangfu0 merged commit 8a80b80 into apache:master May 29, 2024
19 checks passed
@xiangfu0 xiangfu0 deleted the fixing-swagger-localhost-issue branch May 29, 2024 05:26
gortiz pushed a commit to gortiz/pinot that referenced this pull request Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix ui UI related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants