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: add nio entry to user-agent #774

Merged
merged 9 commits into from Dec 21, 2021
Merged

fix: add nio entry to user-agent #774

merged 9 commits into from Dec 21, 2021

Conversation

BenWhitehead
Copy link
Collaborator

No description provided.

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage-nio API. label Dec 13, 2021
private static class NioUserAgentEntryHeaderProvider extends FixedHeaderProvider {

private final ImmutableMap<String, String> userAgent =
ImmutableMap.of("user-agent", String.format("gcloud-java-nio/%s", VERSION));
Copy link
Member

Choose a reason for hiding this comment

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

Does this prepend to the existing user-agent?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It does. This is what it looks like in the logs (the version is missing because I ran it from my ide without the version file artifact

User-Agent: gcloud-java-nio/0.123.18-SNAPSHOT gcloud-java/2.2.1 Google-API-Java-Client/1.32.2 Google-HTTP-Java-Client/1.40.1 (gzip)

Copy link
Member

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

LGTM

@BenWhitehead BenWhitehead marked this pull request as ready for review December 15, 2021 20:18
@BenWhitehead BenWhitehead requested review from a team as code owners December 15, 2021 20:18
@BenWhitehead BenWhitehead added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 15, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 15, 2021
Move version information and configuration of header into StorageOptionsUtil

Introduce StorageOptionsUtil which provides utilities and default instance access for StorageOptions which include our new user-agent entry.

To all tests which called com.google.cloud.storage.contrib.nio.CloudStorageFileSystemProvider.setStorageOptions in their @before, there is now a corresponding @after which sets the storageOptions back to defaults
@BenWhitehead BenWhitehead added kokoro:force-run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Dec 21, 2021
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Dec 21, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage-nio API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants