Skip to content

Commit

Permalink
feat: change GCS gRPC API to get user billing project from gRPC metad…
Browse files Browse the repository at this point in the history
…ata instead of CommonRequestParams, and remove latter (#1396)

* feat: Change GCS gRPC API to get user billing project from gRPC metadata instead of CommonRequestParams, and remove latter

PiperOrigin-RevId: 449498085

Source-Link: googleapis/googleapis@d4444af

Source-Link: googleapis/googleapis-gen@e13d4f4
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTEzZDRmNGZiNDExMGY3OGVlODYwMTlhM2Q1NDA4ZmU1NzNlYjI4OSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: update clirr rules to allow removal of google/storage/v2/CommonRequestParams message

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: BenWhitehead <BenWhitehead@users.noreply.github.com>
  • Loading branch information
3 people committed May 19, 2022
1 parent 8834423 commit 8a7755c
Show file tree
Hide file tree
Showing 57 changed files with 636 additions and 8,180 deletions.

Large diffs are not rendered by default.

Expand Up @@ -1349,7 +1349,6 @@ public void composeObjectTest() throws Exception {
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
.setCommonRequestParams(CommonRequestParams.newBuilder().build())
.build();

Object actualResponse = client.composeObject(request);
Expand All @@ -1369,7 +1368,6 @@ public void composeObjectTest() throws Exception {
Assert.assertEquals(request.getKmsKey(), actualRequest.getKmsKey());
Assert.assertEquals(
request.getCommonObjectRequestParams(), actualRequest.getCommonObjectRequestParams());
Assert.assertEquals(request.getCommonRequestParams(), actualRequest.getCommonRequestParams());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -1393,7 +1391,6 @@ public void composeObjectExceptionTest() throws Exception {
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
.setCommonRequestParams(CommonRequestParams.newBuilder().build())
.build();
client.composeObject(request);
Assert.fail("No exception raised");
Expand Down Expand Up @@ -1640,7 +1637,6 @@ public void readObjectTest() throws Exception {
.setIfMetagenerationMatch(1043427781)
.setIfMetagenerationNotMatch(1025430873)
.setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
.setCommonRequestParams(CommonRequestParams.newBuilder().build())
.setReadMask(FieldMask.newBuilder().build())
.build();

Expand Down Expand Up @@ -1671,7 +1667,6 @@ public void readObjectExceptionTest() throws Exception {
.setIfMetagenerationMatch(1043427781)
.setIfMetagenerationNotMatch(1025430873)
.setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
.setCommonRequestParams(CommonRequestParams.newBuilder().build())
.setReadMask(FieldMask.newBuilder().build())
.build();

Expand Down Expand Up @@ -1769,7 +1764,6 @@ public void writeObjectTest() throws Exception {
.setObjectChecksums(ObjectChecksums.newBuilder().build())
.setFinishWrite(true)
.setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
.setCommonRequestParams(CommonRequestParams.newBuilder().build())
.build();

MockStreamObserver<WriteObjectResponse> responseObserver = new MockStreamObserver<>();
Expand Down Expand Up @@ -1797,7 +1791,6 @@ public void writeObjectExceptionTest() throws Exception {
.setObjectChecksums(ObjectChecksums.newBuilder().build())
.setFinishWrite(true)
.setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
.setCommonRequestParams(CommonRequestParams.newBuilder().build())
.build();

MockStreamObserver<WriteObjectResponse> responseObserver = new MockStreamObserver<>();
Expand Down Expand Up @@ -1945,7 +1938,6 @@ public void rewriteObjectTest() throws Exception {
.setCopySourceEncryptionKeyBytes(ByteString.EMPTY)
.setCopySourceEncryptionKeySha256Bytes(ByteString.EMPTY)
.setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
.setCommonRequestParams(CommonRequestParams.newBuilder().build())
.build();

RewriteResponse actualResponse = client.rewriteObject(request);
Expand Down Expand Up @@ -1992,7 +1984,6 @@ public void rewriteObjectTest() throws Exception {
actualRequest.getCopySourceEncryptionKeySha256Bytes());
Assert.assertEquals(
request.getCommonObjectRequestParams(), actualRequest.getCommonObjectRequestParams());
Assert.assertEquals(request.getCommonRequestParams(), actualRequest.getCommonRequestParams());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand Down Expand Up @@ -2031,7 +2022,6 @@ public void rewriteObjectExceptionTest() throws Exception {
.setCopySourceEncryptionKeyBytes(ByteString.EMPTY)
.setCopySourceEncryptionKeySha256Bytes(ByteString.EMPTY)
.setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
.setCommonRequestParams(CommonRequestParams.newBuilder().build())
.build();
client.rewriteObject(request);
Assert.fail("No exception raised");
Expand All @@ -2050,7 +2040,6 @@ public void startResumableWriteTest() throws Exception {
StartResumableWriteRequest.newBuilder()
.setWriteObjectSpec(WriteObjectSpec.newBuilder().build())
.setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
.setCommonRequestParams(CommonRequestParams.newBuilder().build())
.build();

StartResumableWriteResponse actualResponse = client.startResumableWrite(request);
Expand All @@ -2063,7 +2052,6 @@ public void startResumableWriteTest() throws Exception {
Assert.assertEquals(request.getWriteObjectSpec(), actualRequest.getWriteObjectSpec());
Assert.assertEquals(
request.getCommonObjectRequestParams(), actualRequest.getCommonObjectRequestParams());
Assert.assertEquals(request.getCommonRequestParams(), actualRequest.getCommonRequestParams());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -2080,7 +2068,6 @@ public void startResumableWriteExceptionTest() throws Exception {
StartResumableWriteRequest.newBuilder()
.setWriteObjectSpec(WriteObjectSpec.newBuilder().build())
.setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
.setCommonRequestParams(CommonRequestParams.newBuilder().build())
.build();
client.startResumableWrite(request);
Assert.fail("No exception raised");
Expand Down
16 changes: 16 additions & 0 deletions proto-google-cloud-storage-v2/clirr-ignored-differences.xml
@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- see http://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
<differences>
<!-- CommonRequestParams has been removed as a message in favor of grpc request metadata -->
<difference>
<differenceType>8001</differenceType>
<className>com/google/storage/v2/CommonRequestParams*</className>
</difference>
<difference>
<differenceType>6011</differenceType>
<className>com/google/storage/v2/**</className>
<field>COMMON_REQUEST_PARAMS_FIELD_NUMBER</field>
</difference>
<difference>
<differenceType>7002</differenceType>
<className>com/google/storage/v2/**</className>
<method>* *CommonRequestParams*(*)</method>
</difference>

</differences>

0 comments on commit 8a7755c

Please sign in to comment.