Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

fix: add nio entry to user-agent#774

Merged
BenWhitehead merged 9 commits into
mainfrom
user-agent
Dec 21, 2021
Merged

fix: add nio entry to user-agent#774
BenWhitehead merged 9 commits into
mainfrom
user-agent

Conversation

@BenWhitehead
Copy link
Copy Markdown
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
@BenWhitehead BenWhitehead requested a review from frankyn December 13, 2021 22:49
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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

@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 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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

3 participants