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(transport/grpc): retain UserAgent option with new auth stack #2690

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

noahdietz
Copy link
Contributor

@noahdietz noahdietz commented Jul 15, 2024

The only code that converted the option.WithUserAgent to a gRPC DialOption WithUserAgent was in the dial function, which was bypassed when leveraging the new auth library that handles most of the important dialing set up re:credentials.

To fix this, I added a new helper specifically for use in dialPoolNewAuth that prepares dial options based on the given DialSettings - prepareDialOpionsNewAuth. I could've added the same logic to anywhere in dialPoolNewAuth to fix it, but I felt I needed to signal that this is the method to be modifying gRPC DialOptions in so that in the future, we can centralize further gRPC DialOption manipulation rather than just "wherever" like in the "old" dial.

Also stored the grpctransport.Dial function into a global variable so that unit tests could spoof it to check on the gRPC DialOptions that were provided - just like the "old" dial did for testing.

Updates googleapis/google-cloud-go#10550 but needs to be released here, integrated there, and released there.

Copy link
Member

@codyoss codyoss left a comment

Choose a reason for hiding this comment

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

Thanks!

@codyoss codyoss added the automerge Merge the pull request once unit tests and other checks pass. label Jul 15, 2024
@gcf-merge-on-green gcf-merge-on-green bot merged commit aa4662f into googleapis:main Jul 15, 2024
5 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jul 15, 2024
@noahdietz noahdietz deleted the new-auth-user-agent branch July 15, 2024 22:00
gcf-merge-on-green bot pushed a commit that referenced this pull request Jul 22, 2024
🤖 I have created a release *beep* *boop*
---


## [0.189.0](https://togithub.com/googleapis/google-api-go-client/compare/v0.188.0...v0.189.0) (2024-07-22)


### Features

* **all:** Auto-regenerate discovery clients ([#2680](https://togithub.com/googleapis/google-api-go-client/issues/2680)) ([4a713f7](https://togithub.com/googleapis/google-api-go-client/commit/4a713f714e522fc9b642b6e877f387b45b45d92c))
* **all:** Auto-regenerate discovery clients ([#2683](https://togithub.com/googleapis/google-api-go-client/issues/2683)) ([1e3757d](https://togithub.com/googleapis/google-api-go-client/commit/1e3757d0fae889f480bdd54dfeb09362ca0ac6d9))
* **all:** Auto-regenerate discovery clients ([#2685](https://togithub.com/googleapis/google-api-go-client/issues/2685)) ([611884d](https://togithub.com/googleapis/google-api-go-client/commit/611884d3f736ca0ac205859dc428537ab167fd19))
* **all:** Auto-regenerate discovery clients ([#2687](https://togithub.com/googleapis/google-api-go-client/issues/2687)) ([27405af](https://togithub.com/googleapis/google-api-go-client/commit/27405af8ca136a1c64f413f4fc3f0db57c53b80f))
* **all:** Auto-regenerate discovery clients ([#2691](https://togithub.com/googleapis/google-api-go-client/issues/2691)) ([a94722f](https://togithub.com/googleapis/google-api-go-client/commit/a94722f1bfc635faedebf847230fc97b9845f390))


### Bug Fixes

* **cba:** Update newAuth path to use nil oauth2 client ([#2684](https://togithub.com/googleapis/google-api-go-client/issues/2684)) ([d925dcb](https://togithub.com/googleapis/google-api-go-client/commit/d925dcbb27f2412664b43259cc4840d0f952857f))
* **transport/grpc:** Retain UserAgent option with new auth stack ([#2690](https://togithub.com/googleapis/google-api-go-client/issues/2690)) ([aa4662f](https://togithub.com/googleapis/google-api-go-client/commit/aa4662f7581724e440a9530d84d10264ff974c81))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
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.

2 participants