-
Notifications
You must be signed in to change notification settings - Fork 196
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
Add config for User-Agent suffix #3650
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, but I have some ideas about an alternative way to plumb the value in.
@@ -66,7 +66,7 @@ func NewGenericClient( | |||
|
|||
ua := options.UserAgent | |||
if ua == "" { | |||
ua = userAgent | |||
ua = DefaultUserAgent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only be used if the code that calls NewGenericClient()
doesn't specify a user agent in the GenericClientOptions
struct passed in. I don't think that's ideal, as the configured setting wouldn't be included.
I haven't checked where GenericClientIOptions.UserAgent
is set, but I'm wondering if the value used there should be used as a part of the UA, not the whole thing.
/ok-to-test sha=fc7fcd4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment, otherwise looks good. I'll trigger testing and merge once that's addressed.
/ok-to-test sha=99313f5 |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Closes #1827
What this PR does / why we need it: This PR adds an
AZURE_USER_AGENT_SUFFIX
configuration option to allow appending to the default User-Agent used for Azure HTTP clients.Special notes for your reviewer:
Getting this wired up felt a little clunky, so any feedback on how to smooth that out is welcome.
I also wasn't sure exactly how best to add tests for this config, so any advice there would be appreciated. And tips on exactly where to look with ASO fully up and running to see if the user agent is really being set as expected.
How does this PR make you feel:
If applicable: