KEMBAR78
fix: add gccl-invocation-id interceptor by frankyn · Pull Request #1309 · googleapis/java-storage · GitHub
Skip to content

Conversation

@frankyn
Copy link
Contributor

@frankyn frankyn commented Mar 25, 2022

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
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 as code owners March 28, 2022 21:22
@frankyn frankyn requested a review from BenWhitehead March 29, 2022 18:17
Copy link
Collaborator

@BenWhitehead BenWhitehead left a comment

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;

@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