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

fix: Settings objects should not try to read quotaProjectId from credentials #1162

Merged
merged 3 commits into from Aug 7, 2020

Conversation

chingor13
Copy link
Contributor

@chingor13 chingor13 commented Aug 5, 2020

This is causing downstream errors in unit tests because the settings are attempting to load credentials while the settings are being built.

This is a behavioral change. The settings object should not care about what's in the credentials provider when being asked for its configured quotaProjectId. We now will only return an explicitly configured quotaProjectId. ClientContext.create will correctly determine the correct value to use.

@chingor13 chingor13 requested a review from summer-ji-eng Aug 5, 2020
@google-cla google-cla bot added the cla: yes label Aug 5, 2020
@codecov
Copy link

@codecov codecov bot commented Aug 5, 2020

Codecov Report

Merging #1162 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1162      +/-   ##
============================================
+ Coverage     78.97%   78.99%   +0.01%     
  Complexity     1194     1194              
============================================
  Files           205      205              
  Lines          5266     5260       -6     
  Branches        436      435       -1     
============================================
- Hits           4159     4155       -4     
+ Misses          935      933       -2     
  Partials        172      172              
Impacted Files Coverage Δ Complexity Δ
...main/java/com/google/api/gax/rpc/StubSettings.java 75.67% <ø> (+0.35%) 12.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c56c79...725e12c. Read the comment docs.

@chingor13 chingor13 marked this pull request as draft Aug 5, 2020
@chingor13 chingor13 changed the title fix: defer credential loading until you ask for quotaProjectId fix: Settings objects should not try to read quotaProjectId from credentials Aug 5, 2020
@summer-ji-eng
Copy link
Contributor

@summer-ji-eng summer-ji-eng commented Aug 6, 2020

The downstream client lib test fails on get gax version (

ext.outputFile = file("gax/src/main/resources/dependencies.properties")
). Are we still consider to remove getting quota from credentials?

@chingor13
Copy link
Contributor Author

@chingor13 chingor13 commented Aug 6, 2020

Are we still consider to remove getting quota from credentials?

The change removes the settings objects asking the credentials for the quotaProjectId. The right headers should still be handled correctly for the requests.

@chingor13 chingor13 marked this pull request as ready for review Aug 6, 2020
@summer-ji-eng
Copy link
Contributor

@summer-ji-eng summer-ji-eng commented Aug 7, 2020

I expand this PR to hide header from setting as well see #1162

@summer-ji-eng
Copy link
Contributor

@summer-ji-eng summer-ji-eng commented Aug 7, 2020

@chingor13 I expand this PR to hide header from setting as well see #1162

@chingor13 chingor13 merged commit 1b09bcf into googleapis:master Aug 7, 2020
8 checks passed
@chingor13 chingor13 deleted the fix-order branch Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants