Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

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.

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 5, 2020
@codecov
Copy link

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 August 5, 2020 21:01
@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

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

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 August 6, 2020 21:05
@summer-ji-eng
Copy link
Contributor

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

@summer-ji-eng
Copy link
Contributor

@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
@chingor13 chingor13 deleted the fix-order branch August 7, 2020 19:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants