-
Notifications
You must be signed in to change notification settings - Fork 532
Add common project #1043
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 common project #1043
Conversation
…eparate from core
…kage version for full value
Leaving this as a draft until the core library is updated from this PR. Then, I'll update dependencies on this side to get everything working. |
); | ||
|
||
headers.put(HttpHeaders.X_IBMCLOUD_SDK_ANALYTICS, sdkAnalyticsHeaderValue); | ||
headers.put(HttpHeaders.USER_AGENT, getUserAgent()); |
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.
technically speaking... :) the user agent header value could be stored in a static field and not computed each time getDefaultHeaders() is called. I'm sure the performance difference is negligible, but I couldn't stop myself from mentioning it :)
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.
Any performance improvement is a good one! Done
🎉 This PR is included in version 7.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This PR adds a new
common
project with anSdkCommon
class to handle logic that's common to the services, but doesn't belong in the core since it's project-specific. Currently, that means it handles building theUser-Agent
andX-IBMCloud-SDK-Analytics
values that will be added to each service request.This PR won't contain the changes to the service methods, but for reference, the code will look something like this: