Skip to content

fix: add gccl-invocation-id interceptor - #1309

Merged
BenWhitehead merged 26 commits into
mainfrom
invocation-id-interceptor
Apr 1, 2022
Merged

BenWhitehead merged 26 commits into
mainfrom
invocation-id-interceptor

Conversation

@frankyn

@frankyn frankyn commented Mar 25, 2022

Copy link
Copy Markdown
Contributor

Joint effort with @BenWhitehead who is the author of the original design, thank you Ben!

  • Ensure the tests and linter pass
  • Add option to disable the invocation id
  • Make sure this header isn't passed in for signed URLs
  • Appropriate docs were updated (if necessary)

@product-auto-label product-auto-label Bot added the api: storage Issues related to the googleapis/java-storage API. label Mar 26, 2022
@BenWhitehead BenWhitehead changed the title feat: Invocation id interceptor fix: add gccl-invocation-id interceptor Mar 28, 2022
BenWhitehead and others added 4 commits March 28, 2022 16:08
…e clear themselves

Also fixed a typo which meant that the v4 url wasn't being tested, however now the v4 url is failing to validate and I'm not sure how to fix the url.
HttpRpcContext testContext = new HttpRpcContext(testUUIDSupplier);
testContext.newInvocationId();
assertEquals(testUUIDSupplier.get(), testContext.getInvocationId());
UUID uuid = UUID.fromString("28220dff-1e8b-4770-9e10-022c2a99d8f3");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

per-discussion with @BenWhitehead: the test prior was using the supplier instance "testUUIDSupplier.get()" caused a mutation to the state of the Supplier but passes because there is only one UUID. Instead we should not test the Supplier<> and only test HttpRpcContext(), hence the update relies on testContext rather than accessing Supplier<> directly.

@frankyn
frankyn marked this pull request as ready for review March 28, 2022 21:22
@frankyn
frankyn requested review from a team March 28, 2022 21:22
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java Outdated
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java Outdated
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java Outdated
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java Outdated
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java Outdated
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java Outdated
Comment thread google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplTest.java Outdated
@frankyn
frankyn requested a review from BenWhitehead March 29, 2022 18:17

@BenWhitehead BenWhitehead left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We also need to add the following to private Builder(StorageOptions options) so we ensure we carry through any value set previously.

      this.storageIncludeInvocationId = options.includeInvocationId;

Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java Outdated
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java Outdated
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java Outdated
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java Outdated
@frankyn
frankyn requested a review from BenWhitehead March 29, 2022 19:59
@BenWhitehead BenWhitehead added the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 1, 2022
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 1, 2022
@BenWhitehead
BenWhitehead merged commit 335c267 into main Apr 1, 2022
@BenWhitehead
BenWhitehead deleted the invocation-id-interceptor branch April 1, 2022 21:32
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 API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants