From d0a146d7b9b55f24c7b936b6591580a31d86d59c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 17:49:16 +0000 Subject: [PATCH 01/28] chore: release 2.1.8-SNAPSHOT (#1063) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- gapic-google-cloud-storage-v2/pom.xml | 4 ++-- google-cloud-storage/pom.xml | 4 ++-- grpc-google-cloud-storage-v2/pom.xml | 4 ++-- pom.xml | 8 ++++---- proto-google-cloud-storage-v2/pom.xml | 4 ++-- versions.txt | 8 ++++---- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gapic-google-cloud-storage-v2/pom.xml b/gapic-google-cloud-storage-v2/pom.xml index 98578b24f..be01056bf 100644 --- a/gapic-google-cloud-storage-v2/pom.xml +++ b/gapic-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc gapic-google-cloud-storage-v2 - 2.1.7-alpha + 2.1.8-alpha-SNAPSHOT gapic-google-cloud-storage-v2 GRPC library for gapic-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.1.7 + 2.1.8-SNAPSHOT diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml index 27e97af4b..08b4e6996 100644 --- a/google-cloud-storage/pom.xml +++ b/google-cloud-storage/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-storage - 2.1.7 + 2.1.8-SNAPSHOT jar Google Cloud Storage https://github.com/googleapis/java-storage @@ -12,7 +12,7 @@ com.google.cloud google-cloud-storage-parent - 2.1.7 + 2.1.8-SNAPSHOT google-cloud-storage diff --git a/grpc-google-cloud-storage-v2/pom.xml b/grpc-google-cloud-storage-v2/pom.xml index 497e681d2..cc1b8ef68 100644 --- a/grpc-google-cloud-storage-v2/pom.xml +++ b/grpc-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-storage-v2 - 2.1.7-alpha + 2.1.8-alpha-SNAPSHOT grpc-google-cloud-storage-v2 GRPC library for grpc-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.1.7 + 2.1.8-SNAPSHOT diff --git a/pom.xml b/pom.xml index d1f77e822..aa2bb497c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-storage-parent pom - 2.1.7 + 2.1.8-SNAPSHOT Storage Parent https://github.com/googleapis/java-storage @@ -93,17 +93,17 @@ com.google.api.grpc proto-google-cloud-storage-v2 - 2.1.7-alpha + 2.1.8-alpha-SNAPSHOT com.google.api.grpc grpc-google-cloud-storage-v2 - 2.1.7-alpha + 2.1.8-alpha-SNAPSHOT com.google.api.grpc gapic-google-cloud-storage-v2 - 2.1.7-alpha + 2.1.8-alpha-SNAPSHOT com.google.cloud diff --git a/proto-google-cloud-storage-v2/pom.xml b/proto-google-cloud-storage-v2/pom.xml index c3f5109c3..750d9d68e 100644 --- a/proto-google-cloud-storage-v2/pom.xml +++ b/proto-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-storage-v2 - 2.1.7-alpha + 2.1.8-alpha-SNAPSHOT proto-google-cloud-storage-v2 PROTO library for proto-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.1.7 + 2.1.8-SNAPSHOT diff --git a/versions.txt b/versions.txt index 7ceab6429..0c0a68da5 100644 --- a/versions.txt +++ b/versions.txt @@ -1,7 +1,7 @@ # Format: # module:released-version:current-version -google-cloud-storage:2.1.7:2.1.7 -gapic-google-cloud-storage-v2:2.1.7-alpha:2.1.7-alpha -grpc-google-cloud-storage-v2:2.1.7-alpha:2.1.7-alpha -proto-google-cloud-storage-v2:2.1.7-alpha:2.1.7-alpha +google-cloud-storage:2.1.7:2.1.8-SNAPSHOT +gapic-google-cloud-storage-v2:2.1.7-alpha:2.1.8-alpha-SNAPSHOT +grpc-google-cloud-storage-v2:2.1.7-alpha:2.1.8-alpha-SNAPSHOT +proto-google-cloud-storage-v2:2.1.7-alpha:2.1.8-alpha-SNAPSHOT From d46f00b8601059a6bc3c292bee1f1a5c73433faf Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 4 Oct 2021 21:26:21 +0200 Subject: [PATCH 02/28] chore(deps): update dependency com.google.cloud:google-cloud-storage to v2.1.7 (#1064) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3fbd529a4..f9103ac7e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-storage - 2.1.6 + 2.1.7 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b692e70de..d3ec7cfd2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-storage - 2.1.6 + 2.1.7 From f0033ebbc6c37740f2e5ddb2de1e0e7872bb824f Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Mon, 4 Oct 2021 19:23:13 -0400 Subject: [PATCH 03/28] test(retry): fix buckets.list tests incorrectly mapping to objects.list methods (#1065) --- .../storage/conformance/retry/RpcMethodMappings.java | 9 +-------- .../conformance/retry/testNamesWhichShouldSucceed.txt | 7 +++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index c76d2d004..0c42e4a1d 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -514,14 +514,7 @@ private static void insert(ArrayList a) { private static void list(ArrayList a) { a.add( RpcMethodMapping.newBuilder(15, buckets.list) - .withTest( - (ctx, c) -> - ctx.map(state -> state.consume(ctx.getStorage().list(c.getBucketName())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(98, buckets.list) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest((ctx, c) -> ctx.map(state -> state.consume(state.getBucket().list()))) + .withTest((ctx, c) -> ctx.map(state -> state.consume(ctx.getStorage().list()))) .build()); } diff --git a/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichShouldSucceed.txt b/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichShouldSucceed.txt index 7a183b7ea..553adc550 100644 --- a/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichShouldSucceed.txt +++ b/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichShouldSucceed.txt @@ -18,6 +18,7 @@ TestRetryConformance/1-[return-503_return-503]-storage.buckets.get-94 TestRetryConformance/1-[return-503_return-503]-storage.buckets.get-96 TestRetryConformance/1-[return-503_return-503]-storage.buckets.getIamPolicy-13 TestRetryConformance/1-[return-503_return-503]-storage.buckets.insert-14 +TestRetryConformance/1-[return-503_return-503]-storage.buckets.list-15 TestRetryConformance/1-[return-503_return-503]-storage.buckets.testIamPermissions-19 TestRetryConformance/1-[return-503_return-503]-storage.default_object_acl.get-103 TestRetryConformance/1-[return-503_return-503]-storage.default_object_acl.get-21 @@ -63,6 +64,7 @@ TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.get- TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.get-96 TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.getIamPolicy-13 TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.insert-14 +TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.list-15 TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.testIamPermissions-19 TestRetryConformance/1-[return-reset-connection_return-503]-storage.default_object_acl.get-103 TestRetryConformance/1-[return-reset-connection_return-503]-storage.default_object_acl.get-21 @@ -108,6 +110,7 @@ TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.buckets.get-96 TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.buckets.getIamPolicy-13 TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.buckets.insert-14 +TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.buckets.list-15 TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.buckets.testIamPermissions-19 TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.default_object_acl.get-103 TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.default_object_acl.get-21 @@ -277,6 +280,7 @@ TestRetryConformance/5-[return-400]-storage.buckets.get-94 TestRetryConformance/5-[return-400]-storage.buckets.get-96 TestRetryConformance/5-[return-400]-storage.buckets.getIamPolicy-13 TestRetryConformance/5-[return-400]-storage.buckets.insert-14 +TestRetryConformance/5-[return-400]-storage.buckets.list-15 TestRetryConformance/5-[return-400]-storage.buckets.patch-101 TestRetryConformance/5-[return-400]-storage.buckets.patch-17 TestRetryConformance/5-[return-400]-storage.buckets.setIamPolicy-18 @@ -370,6 +374,7 @@ TestRetryConformance/5-[return-401]-storage.buckets.get-94 TestRetryConformance/5-[return-401]-storage.buckets.get-96 TestRetryConformance/5-[return-401]-storage.buckets.getIamPolicy-13 TestRetryConformance/5-[return-401]-storage.buckets.insert-14 +TestRetryConformance/5-[return-401]-storage.buckets.list-15 TestRetryConformance/5-[return-401]-storage.buckets.patch-101 TestRetryConformance/5-[return-401]-storage.buckets.patch-17 TestRetryConformance/5-[return-401]-storage.buckets.setIamPolicy-18 @@ -454,6 +459,7 @@ TestRetryConformance/6-[return-503_return-400]-storage.buckets.get-12 TestRetryConformance/6-[return-503_return-400]-storage.buckets.get-95 TestRetryConformance/6-[return-503_return-400]-storage.buckets.get-97 TestRetryConformance/6-[return-503_return-400]-storage.buckets.getIamPolicy-13 +TestRetryConformance/6-[return-503_return-400]-storage.buckets.list-15 TestRetryConformance/6-[return-503_return-400]-storage.buckets.lockRetentionPolicy-100 TestRetryConformance/6-[return-503_return-400]-storage.buckets.patch-101 TestRetryConformance/6-[return-503_return-400]-storage.buckets.patch-122 @@ -511,6 +517,7 @@ TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.get- TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.get-95 TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.get-97 TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.getIamPolicy-13 +TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.list-15 TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.lockRetentionPolicy-100 TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.patch-101 TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.patch-122 From 2ef5ec0c84fcadb590cf7b12877a1332a681e812 Mon Sep 17 00:00:00 2001 From: Frank Natividad Date: Tue, 5 Oct 2021 12:14:11 -0700 Subject: [PATCH 04/28] fix: address errors raised rewites(mapping 58) (#1066) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) Fixes #1067☕️ --- .../storage/NewRetryAlgorithmManager.java | 4 +-- .../conformance/retry/RpcMethodMappings.java | 33 +++++++++++++++---- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java index 4dd6390df..58f2534f3 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java @@ -274,9 +274,7 @@ public ExceptionHandler getForObjectsList(String bucket, Map a) { private static void rewrite(ArrayList a) { a.add( RpcMethodMapping.newBuilder(58, objects.rewrite) + .withApplicable(TestRetryConformance::isPreconditionsProvided) .withTest( (ctx, c) -> ctx.map( - state -> - state.with( - ctx.getStorage() - .copy( - CopyRequest.of( - c.getBucketName(), "blob-source", "blob-target"))))) + state -> { + CopyRequest copyRequest = + CopyRequest.newBuilder() + .setSource(c.getBucketName(), c.getObjectName()) + .setTarget( + BlobId.of(c.getBucketName(), "destination-blob"), + BlobTargetOption.doesNotExist()) + .build(); + return state.with(ctx.getStorage().copy(copyRequest)); + })) + .build()); + a.add( + RpcMethodMapping.newBuilder(242, objects.rewrite) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withTest( + (ctx, c) -> + ctx.map( + state -> { + CopyRequest copyRequest = + CopyRequest.newBuilder() + .setSource(c.getBucketName(), c.getObjectName()) + .setTarget(BlobId.of(c.getBucketName(), "destination-blob")) + .build(); + return state.with(ctx.getStorage().copy(copyRequest)); + })) .build()); a.add( RpcMethodMapping.newBuilder(81, objects.rewrite) From 9111d35d6941bb0f8782bce3a4b953f1f4674b56 Mon Sep 17 00:00:00 2001 From: Frank Natividad Date: Tue, 5 Oct 2021 15:15:34 -0700 Subject: [PATCH 05/28] fix: validate non-idempotent case for 81,82,83,84,85,86 (#1071) --- .../cloud/storage/conformance/retry/RpcMethodMappings.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index dff9a68a3..3413050f1 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -1872,6 +1872,7 @@ private static void rewrite(ArrayList a) { .build()); a.add( RpcMethodMapping.newBuilder(81, objects.rewrite) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( blobIdWithoutGeneration .andThen(Rpc.blobWithGeneration) @@ -1884,6 +1885,7 @@ private static void rewrite(ArrayList a) { .build()); a.add( RpcMethodMapping.newBuilder(82, objects.rewrite) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( blobIdWithoutGeneration .andThen(Rpc.blobWithGeneration) @@ -1901,6 +1903,7 @@ private static void rewrite(ArrayList a) { .build()); a.add( RpcMethodMapping.newBuilder(83, objects.rewrite) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( blobIdWithoutGeneration .andThen(Rpc.blobWithGeneration) @@ -1916,6 +1919,7 @@ private static void rewrite(ArrayList a) { .build()); a.add( RpcMethodMapping.newBuilder(84, objects.rewrite) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( blobIdWithoutGeneration .andThen(Rpc.blobWithGeneration) @@ -1933,6 +1937,7 @@ private static void rewrite(ArrayList a) { .build()); a.add( RpcMethodMapping.newBuilder(85, objects.rewrite) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( blobIdWithoutGeneration .andThen(Rpc.blobWithGeneration) @@ -1950,6 +1955,7 @@ private static void rewrite(ArrayList a) { .build()); a.add( RpcMethodMapping.newBuilder(86, objects.rewrite) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( blobIdWithoutGeneration .andThen(Rpc.blobWithGeneration) From 6e450e3cadeef8a77a4510f4913a580b163acf70 Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Tue, 5 Oct 2021 18:18:56 -0400 Subject: [PATCH 06/28] test(retry): decouple querying retry_test state from test success (#1072) when debugging a failing test, the retry_test state will now be queried allowing for its presence to show in request logs to aid debugging. --- .../cloud/storage/conformance/retry/RetryTestFixture.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java index 79a19a124..9a769e858 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java @@ -101,9 +101,11 @@ public void evaluate() throws Throwable { } finally { LOGGER.fine("Verifying end state of retry_test resource..."); try { - if (testSuccess && retryTest != null) { + if (retryTest != null) { RetryTestResource postTestState = testBench.getRetryTest(retryTest); - assertTrue("expected completed to be true, but was false", postTestState.completed); + if (testSuccess) { + assertTrue("expected completed to be true, but was false", postTestState.completed); + } } } finally { LOGGER.fine("Verifying end state of retry_test resource complete"); From 3f7ed5f671f5588cbfced6c0947e6115bdd9ea6e Mon Sep 17 00:00:00 2001 From: Frank Natividad Date: Wed, 6 Oct 2021 10:42:36 -0700 Subject: [PATCH 07/28] test(retry): correct setIamPolicy conformance tests (#1075) --- .../storage/NewRetryAlgorithmManager.java | 5 +-- .../conformance/retry/RpcMethodMappings.java | 44 ++++++++++++++++--- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java index 58f2534f3..e89090f5c 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java @@ -143,10 +143,7 @@ public ExceptionHandler getForBucketsGetIamPolicy( @Override public ExceptionHandler getForBucketsSetIamPolicy( String bucket, Policy pb, Map optionsMap) { - // TODO: Include etag when it is supported by the library - return optionsMap.containsKey(StorageRpc.Option.IF_METAGENERATION_MATCH) - ? IDEMPOTENT_HANDLER - : NON_IDEMPOTENT_HANDLER; + return pb.getEtag() != null ? IDEMPOTENT_HANDLER : NON_IDEMPOTENT_HANDLER; } @Override diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index 3413050f1..849c80975 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -27,6 +27,8 @@ import static org.junit.Assert.assertTrue; import com.google.cloud.BaseServiceException; +import com.google.cloud.Binding; +import com.google.cloud.Identity; import com.google.cloud.Policy; import com.google.cloud.ReadChannel; import com.google.cloud.RetryHelper.RetryHelperException; @@ -48,6 +50,7 @@ import com.google.cloud.storage.Storage.CopyRequest; import com.google.cloud.storage.Storage.SignUrlOption; import com.google.cloud.storage.Storage.UriScheme; +import com.google.cloud.storage.StorageRoles; import com.google.cloud.storage.conformance.retry.CtxFunctions.Local; import com.google.cloud.storage.conformance.retry.CtxFunctions.Rpc; import com.google.cloud.storage.conformance.retry.CtxFunctions.Util; @@ -66,6 +69,7 @@ import com.google.cloud.storage.conformance.retry.RpcMethodMappings.Mappings.ObjectAcl; import com.google.cloud.storage.conformance.retry.RpcMethodMappings.Mappings.Objects; import com.google.cloud.storage.conformance.retry.RpcMethodMappings.Mappings.ServiceAccount; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimap; @@ -614,8 +618,22 @@ private static void setIamPolicy(ArrayList a) { ctx.getStorage() .setIamPolicy( state.getBucket().getName(), - Policy.newBuilder().build())))) - .build()); // TODO: configure policy + Policy.newBuilder() + .setVersion(3) + .setBindings( + ImmutableList.of( + Binding.newBuilder() + .setRole( + StorageRoles.legacyBucketOwner() + .toString()) + .setMembers( + ImmutableList.of( + Identity.projectOwner( + "project-id") + .getValue())) + .build())) + .build())))) + .build()); a.add( RpcMethodMapping.newBuilder(240, buckets.setIamPolicy) .withApplicable(TestRetryConformance::isPreconditionsProvided) @@ -627,10 +645,24 @@ private static void setIamPolicy(ArrayList a) { ctx.getStorage() .setIamPolicy( state.getBucket().getName(), - Policy.newBuilder().build(), - BucketSourceOption.metagenerationMatch( - state.getBucket().getMetageneration()))))) - .build()); // TODO: configure policy + Policy.newBuilder() + .setEtag("h??") + .setVersion(3) + .setBindings( + ImmutableList.of( + Binding.newBuilder() + .setRole( + StorageRoles.legacyBucketOwner() + .toString()) + .setMembers( + ImmutableList.of( + Identity.projectOwner( + "project-id") + .getValue())) + .build())) + .build(), + BucketSourceOption.userProject("project-id"))))) + .build()); } private static void testIamPermission(ArrayList a) { From 822da418b69911b18b526ea84c4e40905f5dbc13 Mon Sep 17 00:00:00 2001 From: Frank Natividad Date: Wed, 6 Oct 2021 10:43:45 -0700 Subject: [PATCH 08/28] test(retry): correct lockRetentionPolicy and bucket patch tests (#1077) --- .../cloud/storage/NewRetryAlgorithmManager.java | 5 ++--- .../storage/conformance/retry/RpcMethodMappings.java | 12 +++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java index e89090f5c..a73d74a19 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java @@ -129,9 +129,8 @@ public ExceptionHandler getForBucketsList(Map optionsMap) @Override public ExceptionHandler getForBucketsLockRetentionPolicy( Bucket pb, Map optionsMap) { - return optionsMap.containsKey(StorageRpc.Option.IF_METAGENERATION_MATCH) - ? IDEMPOTENT_HANDLER - : NON_IDEMPOTENT_HANDLER; + // Always idempotent because IfMetagenerationMatch is required + return IDEMPOTENT_HANDLER; } @Override diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index 849c80975..2b37782b2 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -549,6 +549,7 @@ private static void patch(ArrayList a) { .build()); a.add( RpcMethodMapping.newBuilder(101, buckets.patch) + .withApplicable(TestRetryConformance::isPreconditionsProvided) .withTest( bucketInfo .andThen(Rpc.bucket) @@ -562,6 +563,15 @@ private static void patch(ArrayList a) { .update( BucketTargetOption.metagenerationMatch()))))) .build()); + a.add( + RpcMethodMapping.newBuilder(243, buckets.patch) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withTest( + bucketInfo + .andThen(Rpc.bucket) + .andThen( + (ctx, c) -> ctx.map(state -> state.with(state.getBucket().update())))) + .build()); } private static void update(ArrayList a) {} @@ -588,7 +598,7 @@ private static void lockRetentionPolicy(ArrayList a) { state.with( ctx.getStorage() .lockRetentionPolicy( - state.getBucketInfo(), + state.getBucket(), BucketTargetOption.metagenerationMatch()))))) .build()); a.add( From b196d0cf85a2e5d9683c8a5d7f897625a0ae7b90 Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Wed, 6 Oct 2021 13:58:29 -0400 Subject: [PATCH 09/28] test(retry): configure project id in TestRetryConformance along with other parameters (#1080) Add new `projectId` field to TestRetryConformance to manage and provide project id literal value that can be used everywhere. --- .../retry/ITRetryConformanceTest.java | 17 +++++++++++++++-- .../conformance/retry/RetryTestFixture.java | 2 +- .../conformance/retry/RpcMethodMappings.java | 6 +++--- .../conformance/retry/TestRetryConformance.java | 10 +++++++++- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java index 59510de70..a6a08d73c 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java @@ -136,6 +136,7 @@ public static Collection testCases() throws IOException { .setRetryTestsJsonResourcePath( "com/google/cloud/conformance/storage/v1/retry_tests.json") .setMappings(new RpcMethodMappings()) + .setProjectId("conformance-tests") .setHost(TEST_BENCH.getBaseUri().replaceAll("https?://", "")) .setTestAllowFilter(RetryTestCaseResolver.includeAll()) .build(); @@ -182,18 +183,21 @@ private static final class RetryTestCaseResolver { private final BiPredicate testAllowFilter; private final Random rand; private final String host; + private final String projectId; RetryTestCaseResolver( String retryTestsJsonResourcePath, RpcMethodMappings mappings, BiPredicate testAllowFilter, Random rand, - String host) { + String host, + String projectId) { this.retryTestsJsonResourcePath = retryTestsJsonResourcePath; this.mappings = mappings; this.testAllowFilter = testAllowFilter; this.rand = rand; this.host = host; + this.projectId = projectId; } /** Load, permute and generate all RetryTestCases which are to be run in this suite */ @@ -254,6 +258,7 @@ private List generateTestCases( if (mappings.isEmpty()) { TestRetryConformance testRetryConformance = new TestRetryConformance( + projectId, host, testCase.getId(), method, @@ -268,6 +273,7 @@ private List generateTestCases( for (RpcMethodMapping mapping : mappings) { TestRetryConformance testRetryConformance = new TestRetryConformance( + projectId, host, testCase.getId(), method, @@ -348,6 +354,7 @@ static final class Builder { private String host; private BiPredicate testAllowFilter; private final Random rand; + private String projectId; public Builder() { this.rand = resolveRand(); @@ -374,6 +381,11 @@ public Builder setHost(String host) { return this; } + public Builder setProjectId(String projectId) { + this.projectId = projectId; + return this; + } + /** * Set the allow filter for determining if a particular {@link RpcMethod} and {@link * TestRetryConformance} should be included in the generated test suite. @@ -391,7 +403,8 @@ public RetryTestCaseResolver build() { requireNonNull(mappings, "mappings must be non null"), requireNonNull(testAllowFilter, "testAllowList must be non null"), rand, - host); + requireNonNull(host, "host must be non null"), + requireNonNull(projectId, "projectId must be non null")); } /** diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java index 9a769e858..2b054c6fa 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java @@ -140,7 +140,7 @@ private Storage newStorage(boolean forTest) { StorageOptions.newBuilder() .setHost(testBench.getBaseUri()) .setCredentials(NoCredentials.getInstance()) - .setProjectId("conformance-tests"); + .setProjectId(testRetryConformance.getProjectId()); builder = PackagePrivateMethodWorkarounds.useNewRetryAlgorithmManager(builder); if (forTest) { builder.setHeaderProvider( diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index 2b37782b2..cb0175697 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -639,7 +639,7 @@ private static void setIamPolicy(ArrayList a) { .setMembers( ImmutableList.of( Identity.projectOwner( - "project-id") + c.getProjectId()) .getValue())) .build())) .build())))) @@ -667,11 +667,11 @@ private static void setIamPolicy(ArrayList a) { .setMembers( ImmutableList.of( Identity.projectOwner( - "project-id") + c.getProjectId()) .getValue())) .build())) .build(), - BucketSourceOption.userProject("project-id"))))) + BucketSourceOption.userProject(c.getProjectId()))))) .build()); } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestRetryConformance.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestRetryConformance.java index 953cb5998..027da5377 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestRetryConformance.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestRetryConformance.java @@ -58,6 +58,7 @@ final class TestRetryConformance { BASE_ID = formatter.format(now).replaceAll("[:]", "").substring(0, 6); } + private final String projectId; private final String bucketName; private final String bucketName2; private final String userProject; @@ -78,16 +79,18 @@ final class TestRetryConformance { private final int mappingId; TestRetryConformance( + String projectId, String host, int scenarioId, Method method, InstructionList instruction, boolean preconditionsProvided, boolean expectSuccess) { - this(host, scenarioId, method, instruction, preconditionsProvided, expectSuccess, 0); + this(projectId, host, scenarioId, method, instruction, preconditionsProvided, expectSuccess, 0); } TestRetryConformance( + String projectId, String host, int scenarioId, Method method, @@ -95,6 +98,7 @@ final class TestRetryConformance { boolean preconditionsProvided, boolean expectSuccess, int mappingId) { + this.projectId = projectId; this.host = host; this.scenarioId = scenarioId; this.method = requireNonNull(method, "method must be non null"); @@ -116,6 +120,10 @@ final class TestRetryConformance { String.format("%s_s%03d-%s-m%03d_obj1", BASE_ID, scenarioId, instructionsString, mappingId); } + public String getProjectId() { + return projectId; + } + public String getHost() { return host; } From df2251a56fc147243bc433e56a5d032237647e5e Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Wed, 6 Oct 2021 18:51:35 -0400 Subject: [PATCH 10/28] test(retry): update storage.*.delete mappings (#1082) Delete operations against StorageRpc return a boolean rather than throwing an exception for certain scenarios (404). Update mappings to assert that the returned boolean is true. Fixes #1081 --- .../conformance/retry/RpcMethodMappings.java | 189 +++++++++++------- 1 file changed, 118 insertions(+), 71 deletions(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index cb0175697..82a5437db 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -248,24 +248,29 @@ private static void delete(ArrayList a) { .withTest( (ctx, c) -> ctx.map( - state -> - state.with( - ctx.getStorage() - .deleteAcl(c.getBucketName(), User.ofAllUsers())))) - .build()); // TODO: Why does this exist, varargs should suffice + state -> { + boolean deleteSuccess = + ctx.getStorage().deleteAcl(c.getBucketName(), User.ofAllUsers()); + assertTrue(deleteSuccess); + return state.with(deleteSuccess); + })) + .build()); a.add( RpcMethodMapping.newBuilder(2, bucket_acl.delete) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( (ctx, c) -> ctx.map( - state -> - state.with( - ctx.getStorage() - .deleteAcl( - c.getBucketName(), - User.ofAllUsers(), - BucketSourceOption.userProject(c.getUserProject()))))) + state -> { + boolean success = + ctx.getStorage() + .deleteAcl( + c.getBucketName(), + User.ofAllUsers(), + BucketSourceOption.userProject(c.getUserProject())); + assertTrue(success); + return state.with(success); + })) .build()); a.add( RpcMethodMapping.newBuilder(87, bucket_acl.delete) @@ -275,11 +280,12 @@ private static void delete(ArrayList a) { .andThen( (ctx, c) -> ctx.map( - state -> - state.with( - state - .getBucket() - .deleteAcl(state.getAcl().getEntity()))))) + state -> { + boolean success = + state.getBucket().deleteAcl(state.getAcl().getEntity()); + assertTrue(success); + return state.with(success); + }))) .build()); } @@ -431,12 +437,15 @@ private static void delete(ArrayList a) { .withTest( (ctx, c) -> ctx.map( - state -> - state.with( - ctx.getStorage() - .delete( - c.getBucketName(), - BucketSourceOption.userProject(c.getUserProject()))))) + state -> { + boolean success = + ctx.getStorage() + .delete( + c.getBucketName(), + BucketSourceOption.userProject(c.getUserProject())); + assertTrue(success); + return state.with(success); + })) .build()); a.add( RpcMethodMapping.newBuilder(92, buckets.delete) @@ -444,7 +453,13 @@ private static void delete(ArrayList a) { bucketInfo .andThen(Rpc.bucket) .andThen( - (ctx, c) -> ctx.map(state -> state.with(state.getBucket().delete())))) + (ctx, c) -> + ctx.map( + state -> { + boolean success = state.getBucket().delete(); + assertTrue(success); + return state.with(success); + }))) .build()); a.add( RpcMethodMapping.newBuilder(93, buckets.delete) @@ -452,11 +467,14 @@ private static void delete(ArrayList a) { .withTest( (ctx, c) -> ctx.map( - state -> - state.with( - state - .getBucket() - .delete(Bucket.BucketSourceOption.metagenerationMatch())))) + state -> { + boolean success = + state + .getBucket() + .delete(Bucket.BucketSourceOption.metagenerationMatch()); + assertTrue(success); + return state.with(success); + })) .build()); } @@ -470,7 +488,14 @@ private static void get(ArrayList a) { a.add( RpcMethodMapping.newBuilder(94, buckets.get) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest((ctx, c) -> ctx.map(state -> state.with(state.getBucket().exists()))) + .withTest( + (ctx, c) -> + ctx.map( + state -> { + boolean success = state.getBucket().exists(); + assertTrue(success); + return state.with(success); + })) .build()); a.add( RpcMethodMapping.newBuilder(95, buckets.get) @@ -478,11 +503,14 @@ private static void get(ArrayList a) { .withTest( (ctx, c) -> ctx.map( - state -> - state.with( - state - .getBucket() - .exists(Bucket.BucketSourceOption.metagenerationMatch())))) + state -> { + boolean success = + state + .getBucket() + .exists(Bucket.BucketSourceOption.metagenerationMatch()); + assertTrue(success); + return state.with(success); + })) .build()); a.add( RpcMethodMapping.newBuilder(96, buckets.get) @@ -699,11 +727,14 @@ private static void delete(ArrayList a) { .withTest( (ctx, c) -> ctx.map( - state -> - state.with( - ctx.getStorage() - .deleteDefaultAcl( - c.getBucketName(), state.getAcl().getEntity())))) + state -> { + boolean success = + ctx.getStorage() + .deleteDefaultAcl( + c.getBucketName(), state.getAcl().getEntity()); + assertTrue(success); + return state.with(success); + })) .build()); a.add( RpcMethodMapping.newBuilder(102, default_object_acl.delete) @@ -713,11 +744,14 @@ private static void delete(ArrayList a) { .andThen( (ctx, c) -> ctx.map( - state -> - state.with( - state - .getBucket() - .deleteDefaultAcl(state.getAcl().getEntity()))))) + state -> { + boolean success = + state + .getBucket() + .deleteDefaultAcl(state.getAcl().getEntity()); + assertTrue(success); + return state.with(success); + }))) .build()); } @@ -928,11 +962,13 @@ private static void delete(ArrayList a) { blobIdWithoutGeneration.andThen( (ctx, c) -> ctx.map( - state -> - state.with( - ctx.getStorage() - .deleteAcl( - state.getBlobId(), state.getAcl().getEntity()))))) + state -> { + boolean success = + ctx.getStorage() + .deleteAcl(state.getBlobId(), state.getAcl().getEntity()); + assertTrue(success); + return state.with(success); + }))) .build()); a.add( RpcMethodMapping.newBuilder(62, object_acl.delete) @@ -942,11 +978,12 @@ private static void delete(ArrayList a) { .andThen( (ctx, c) -> ctx.map( - state -> - state.with( - state - .getBlob() - .deleteAcl(state.getAcl().getEntity()))))) + state -> { + boolean success = + state.getBlob().deleteAcl(state.getAcl().getEntity()); + assertTrue(success); + return state.with(success); + }))) .build()); } @@ -1060,8 +1097,12 @@ private static void delete(ArrayList a) { .withTest( (ctx, c) -> ctx.map( - state -> - state.with(ctx.getStorage().delete(state.getBlob().getBlobId())))) + state -> { + boolean success = + ctx.getStorage().delete(state.getBlob().getBlobId()); + assertTrue(success); + return state.with(success); + })) .build()); // TODO: Why does this exist, varargs should suffice a.add( RpcMethodMapping.newBuilder(37, objects.delete) @@ -1069,12 +1110,15 @@ private static void delete(ArrayList a) { .withTest( (ctx, c) -> ctx.map( - state -> - state.with( - ctx.getStorage() - .delete( - state.getBlob().getBlobId(), - BlobSourceOption.generationMatch())))) + state -> { + boolean success = + ctx.getStorage() + .delete( + state.getBlob().getBlobId(), + BlobSourceOption.generationMatch()); + assertTrue(success); + return state.with(success); + })) .build()); // TODO: Correct arg? a.add( RpcMethodMapping.newBuilder(38, objects.delete) @@ -1082,14 +1126,17 @@ private static void delete(ArrayList a) { .withTest( (ctx, c) -> ctx.map( - state -> - state.with( - ctx.getStorage() - .delete( - state.getBlob().getBlobId().getBucket(), - state.getBlob().getBlobId().getName(), - BlobSourceOption.generationMatch( - state.getBlob().getGeneration()))))) + state -> { + boolean success = + ctx.getStorage() + .delete( + state.getBlob().getBlobId().getBucket(), + state.getBlob().getBlobId().getName(), + BlobSourceOption.generationMatch( + state.getBlob().getGeneration())); + assertTrue(success); + return state.with(success); + })) .build()); // TODO: Correct arg? a.add( RpcMethodMapping.newBuilder(67, objects.delete) From 2c4e6c166d09c51e3f37a49f453b11b0f5a56465 Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Wed, 6 Oct 2021 20:55:48 -0400 Subject: [PATCH 11/28] test(retry): fix 48 and 114 (#1084) com.google.cloud.storage.Storage.create(com.google.cloud.storage.BlobInfo, java.io.InputStream, com.google.cloud.storage.Storage.BlobWriteOption...) is never safe to retry as it does not wrap the inputstream provided to allow it to be safely read multiple times Fixes #1083 --- .../conformance/retry/RpcMethodMappings.java | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index 82a5437db..4e443867a 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -1477,19 +1477,18 @@ private static void insert(ArrayList a) { .build()); a.add( RpcMethodMapping.newBuilder(48, objects.insert) - .withApplicable(TestRetryConformance::isPreconditionsProvided) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(blobInfoWithGenerationZero)) .withTest( - blobInfoWithGenerationZero.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .create( - ctx.getState().getBlobInfo(), - new ByteArrayInputStream( - c.getHelloWorldUtf8Bytes()), - BlobWriteOption.generationMatch()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .create( + ctx.getState().getBlobInfo(), + new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()), + BlobWriteOption.generationMatch())))) .build()); a.add( RpcMethodMapping.newBuilder(49, objects.insert) @@ -1717,17 +1716,16 @@ private static void insert(ArrayList a) { a.add( RpcMethodMapping.newBuilder(114, objects.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(blobInfoWithoutGeneration)) .withTest( - blobInfoWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .create( - ctx.getState().getBlobInfo(), - new ByteArrayInputStream( - c.getHelloWorldUtf8Bytes())))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .create( + ctx.getState().getBlobInfo(), + new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()))))) .build()); a.add( RpcMethodMapping.newBuilder(115, objects.insert) From 1c52b3db6699c2ad325853e95231e1a908da069f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 7 Oct 2021 17:34:51 +0200 Subject: [PATCH 12/28] deps: update kms.version to v0.93.1 (#1079) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api.grpc:proto-google-cloud-kms-v1](https://togithub.com/googleapis/java-kms) | `0.93.0` -> `0.93.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-kms-v1/0.93.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-kms-v1/0.93.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-kms-v1/0.93.1/compatibility-slim/0.93.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-kms-v1/0.93.1/confidence-slim/0.93.0)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.api.grpc:grpc-google-cloud-kms-v1](https://togithub.com/googleapis/java-kms) | `0.93.0` -> `0.93.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:grpc-google-cloud-kms-v1/0.93.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:grpc-google-cloud-kms-v1/0.93.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:grpc-google-cloud-kms-v1/0.93.1/compatibility-slim/0.93.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:grpc-google-cloud-kms-v1/0.93.1/confidence-slim/0.93.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-storage). --- google-cloud-storage/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml index 08b4e6996..31550b59b 100644 --- a/google-cloud-storage/pom.xml +++ b/google-cloud-storage/pom.xml @@ -16,7 +16,7 @@ google-cloud-storage - 0.93.0 + 0.93.1 From 8788a621feed223c86b1a9809e6edfc6cd85b487 Mon Sep 17 00:00:00 2001 From: Frank Natividad Date: Thu, 7 Oct 2021 10:34:23 -0700 Subject: [PATCH 13/28] test(retry): fix test case 118 (#1088) --- .../cloud/storage/conformance/retry/RpcMethodMappings.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index 4e443867a..a15317472 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -1595,7 +1595,7 @@ private static void insert(ArrayList a) { .build()); a.add( RpcMethodMapping.newBuilder(77, objects.insert) - .withApplicable(TestRetryConformance::isPreconditionsProvided) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( blobInfoWithoutGeneration .andThen(Rpc.createEmptyBlob) @@ -1787,7 +1787,7 @@ private static void insert(ArrayList a) { .create( c.getObjectName(), c.getHelloWorldUtf8Bytes(), - Bucket.BlobTargetOption.generationMatch(1L)))))) + Bucket.BlobTargetOption.doesNotExist()))))) .build()); a.add( RpcMethodMapping.newBuilder(119, objects.insert) From ebece5a9f401621eba4630ad231c36ab974e141f Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Thu, 7 Oct 2021 10:44:43 -0700 Subject: [PATCH 14/28] chore: update repo-metadata.json client_documentation link (#1085) --- .repo-metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.repo-metadata.json b/.repo-metadata.json index be68abc55..0ffa26e8a 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -2,7 +2,7 @@ "name": "storage", "name_pretty": "Cloud Storage", "product_documentation": "https://cloud.google.com/storage", - "client_documentation": "https://googleapis.dev/java/google-cloud-storage/latest/index.html", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-storage/latest/history", "api_description": "is a durable and highly available object storage service. Google Cloud Storage is almost infinitely scalable and guarantees consistency: when a write succeeds, the latest copy of the object will be returned to any GET, globally.", "issue_tracker": "https://issuetracker.google.com/savedsearches/559782", "release_level": "ga", From 4e30e186140c53d6be3c0a36c11ac50d1bd4a87f Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Thu, 7 Oct 2021 14:39:24 -0400 Subject: [PATCH 15/28] test(retry): fix mapping 78 (#1090) * move creation of object from withTest to withSetup to ensure it doesn't consume the instructions for the test * update RetryTestFixture to set max attempts to 3 to match what our conformance tests expect * update Exception Handler Interceptor to handle HttpResponseExceptions related to resumable media operations Fixes #1089 --- .../storage/NewRetryAlgorithmManager.java | 18 +++++++++---- .../conformance/retry/CtxFunctions.java | 4 +-- .../conformance/retry/RetryTestFixture.java | 23 +++++++++-------- .../conformance/retry/RpcMethodMappings.java | 25 ++++++++----------- 4 files changed, 39 insertions(+), 31 deletions(-) diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java index a73d74a19..1b2c5d51a 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/NewRetryAlgorithmManager.java @@ -17,6 +17,7 @@ package com.google.cloud.storage; import com.google.api.client.googleapis.json.GoogleJsonResponseException; +import com.google.api.client.http.HttpResponseException; import com.google.api.services.storage.model.Bucket; import com.google.api.services.storage.model.BucketAccessControl; import com.google.api.services.storage.model.HmacKeyMetadata; @@ -328,6 +329,9 @@ public RetryResult beforeEval(Exception exception) { //noinspection StatementWithEmptyBody if (cause instanceof GoogleJsonResponseException) { // this is handled by the case for BaseServiceException below + } else if (cause instanceof HttpResponseException) { + int code = ((HttpResponseException) cause).getStatusCode(); + return shouldRetryCode(code); } else if (cause instanceof IOException) { IOException ioException = (IOException) cause; return BaseServiceException.isRetryable(idempotent, ioException) @@ -338,13 +342,17 @@ public RetryResult beforeEval(Exception exception) { if (exception instanceof BaseServiceException) { int code = ((BaseServiceException) exception).getCode(); - if (retryableCodes.contains(code)) { - return RetryResult.RETRY; - } else { - return RetryResult.NO_RETRY; - } + return shouldRetryCode(code); } return RetryResult.CONTINUE_EVALUATION; } + + private RetryResult shouldRetryCode(int code) { + if (retryableCodes.contains(code)) { + return RetryResult.RETRY; + } else { + return RetryResult.NO_RETRY; + } + } } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java index d51de7a66..c3ae82b3e 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java @@ -113,13 +113,13 @@ static final class Rpc { } static final class ResourceSetup { - private static final CtxFunction bucket = + static final CtxFunction bucket = (ctx, c) -> { BucketInfo bucketInfo = BucketInfo.newBuilder(c.getBucketName()).build(); Bucket resolvedBucket = ctx.getStorage().create(bucketInfo); return ctx.map(s -> s.with(resolvedBucket)); }; - private static final CtxFunction object = + static final CtxFunction object = (ctx, c) -> { BlobInfo blobInfo = BlobInfo.newBuilder(ctx.getState().getBucket().getName(), c.getObjectName()).build(); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java index 2b054c6fa..6037c8563 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java @@ -18,7 +18,6 @@ import static org.junit.Assert.assertTrue; -import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.FixedHeaderProvider; import com.google.cloud.NoCredentials; import com.google.cloud.conformance.storage.v1.InstructionList; @@ -143,14 +142,17 @@ private Storage newStorage(boolean forTest) { .setProjectId(testRetryConformance.getProjectId()); builder = PackagePrivateMethodWorkarounds.useNewRetryAlgorithmManager(builder); if (forTest) { - builder.setHeaderProvider( - new FixedHeaderProvider() { - @Override - public Map getHeaders() { - return ImmutableMap.of( - "x-retry-test-id", retryTest.id, "User-Agent", "java-conformance-tests/"); - } - }); + builder + .setHeaderProvider( + new FixedHeaderProvider() { + @Override + public Map getHeaders() { + return ImmutableMap.of( + "x-retry-test-id", retryTest.id, "User-Agent", "java-conformance-tests/"); + } + }) + .setRetrySettings( + StorageOptions.getDefaultRetrySettings().toBuilder().setMaxAttempts(3).build()); } else { builder .setHeaderProvider( @@ -160,7 +162,8 @@ public Map getHeaders() { return ImmutableMap.of("User-Agent", "java-conformance-tests/"); } }) - .setRetrySettings(RetrySettings.newBuilder().setMaxAttempts(1).build()); + .setRetrySettings( + StorageOptions.getDefaultRetrySettings().toBuilder().setMaxAttempts(1).build()); } return builder.build().getService(); } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index a15317472..74d0fae9b 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -52,6 +52,7 @@ import com.google.cloud.storage.Storage.UriScheme; import com.google.cloud.storage.StorageRoles; import com.google.cloud.storage.conformance.retry.CtxFunctions.Local; +import com.google.cloud.storage.conformance.retry.CtxFunctions.ResourceSetup; import com.google.cloud.storage.conformance.retry.CtxFunctions.Rpc; import com.google.cloud.storage.conformance.retry.CtxFunctions.Util; import com.google.cloud.storage.conformance.retry.RpcMethod.storage.bucket_acl; @@ -1611,21 +1612,17 @@ private static void insert(ArrayList a) { a.add( RpcMethodMapping.newBuilder(78, objects.insert) .withApplicable(TestRetryConformance::isPreconditionsProvided) + .withSetup( + defaultSetup.andThen(blobInfoWithoutGeneration).andThen(ResourceSetup.object)) .withTest( - blobInfoWithoutGeneration - .andThen(Rpc.createEmptyBlob) - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> - ctx.peek( - state -> { - try (WriteChannel writer = - state - .getBlob() - .writer(BlobWriteOption.generationMatch())) { - writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); - } - }))) + (ctx, c) -> + ctx.peek( + state -> { + try (WriteChannel writer = + state.getBlob().writer(BlobWriteOption.generationMatch())) { + writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); + } + })) .build()); a.add( RpcMethodMapping.newBuilder(108, objects.insert) From 477024e3637fd2ba6693dc14e84dd477a25d7ac2 Mon Sep 17 00:00:00 2001 From: Frank Natividad Date: Fri, 8 Oct 2021 08:31:28 -0700 Subject: [PATCH 16/28] test(retry): fix test case 54 (#1092) --- .../conformance/retry/RpcMethodMappings.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index 74d0fae9b..029df981b 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -1571,6 +1571,7 @@ private static void insert(ArrayList a) { .build()); a.add( RpcMethodMapping.newBuilder(54, objects.insert) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( blobInfoWithoutGeneration.andThen( (ctx, c) -> @@ -1583,12 +1584,28 @@ private static void insert(ArrayList a) { 1, TimeUnit.HOURS, SignUrlOption.httpMethod(HttpMethod.POST), + // TODO: Instead of using bucketBoundHostname fix Signer + // to get BaseUri from StorageOptions + // NOTE(frankyn/benwhitehead): testbench expects HTTP + // scheme and we are using a hack to get around + // the lack of scheme manipulation by using + // bucketBoundHostname to select HTTP + // scheme instead. Bucket name is not present explicitly + // in bucketBoundHostname because it's + // expected to be referred to by the Bucket Bound Hostname + // so we must append it, being the hack, + // to get around the limitation. SignUrlOption.withBucketBoundHostname( - c.getHost(), UriScheme.HTTP), + c.getHost() + + "/" + + c.getBucketName() + + "/" + + c.getObjectName(), + UriScheme.HTTP), SignUrlOption.withExtHeaders( ImmutableMap.of("x-goog-resumable", "start")), SignUrlOption.signWith(c.getServiceAccountSigner()), - SignUrlOption.withV2Signature()); + SignUrlOption.withV4Signature()); try (WriteChannel writer = storage.writer(signedUrl)) { writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); } From 238d8af0e7a090442d9c5d3f9d43f5b95dd3a8c6 Mon Sep 17 00:00:00 2001 From: Frank Natividad Date: Fri, 8 Oct 2021 09:57:24 -0700 Subject: [PATCH 17/28] test(retry): address test cases 52, 120, and 121 (#1093) --- .../storage/conformance/retry/RpcMethodMappings.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index 029df981b..8026b8a03 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -1540,7 +1540,7 @@ private static void insert(ArrayList a) { .build()); a.add( RpcMethodMapping.newBuilder(52, objects.insert) - .withApplicable(TestRetryConformance::isPreconditionsProvided) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( blobInfoWithoutGeneration.andThen( (ctx, c) -> @@ -1824,7 +1824,7 @@ private static void insert(ArrayList a) { .build()); a.add( RpcMethodMapping.newBuilder(120, objects.insert) - .withApplicable(TestRetryConformance::isPreconditionsProvided) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( bucketInfo .andThen(Rpc.bucket) @@ -1839,11 +1839,11 @@ private static void insert(ArrayList a) { c.getObjectName(), new ByteArrayInputStream( c.getHelloWorldUtf8Bytes()), - Bucket.BlobWriteOption.generationMatch(1L)))))) + Bucket.BlobWriteOption.doesNotExist()))))) .build()); a.add( RpcMethodMapping.newBuilder(121, objects.insert) - .withApplicable(TestRetryConformance::isPreconditionsProvided) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( bucketInfo .andThen(Rpc.bucket) @@ -1859,7 +1859,7 @@ private static void insert(ArrayList a) { new ByteArrayInputStream( c.getHelloWorldUtf8Bytes()), "text/plain);charset=utf-8", - Bucket.BlobWriteOption.generationMatch(1L)))))) + Bucket.BlobWriteOption.doesNotExist()))))) .build()); } From 3ee3bb81d2736337ec0288ac0b559df03e9fe2b8 Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Fri, 8 Oct 2021 15:02:55 -0400 Subject: [PATCH 18/28] test(retry): fix incorrect precondition option mapping 119 (#1097) The precondition to assert the absence of an object is IfGenerationMatch=0 not IfGenerationMatch=1 Fixes #1096 --- .../cloud/storage/conformance/retry/RpcMethodMappings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index 8026b8a03..d757dea78 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -1820,7 +1820,7 @@ private static void insert(ArrayList a) { c.getObjectName(), c.getHelloWorldUtf8Bytes(), "text/plain);charset=utf-8", - Bucket.BlobTargetOption.generationMatch(1L)))))) + Bucket.BlobTargetOption.doesNotExist()))))) .build()); a.add( RpcMethodMapping.newBuilder(120, objects.insert) From 1c233a9386dc5da52b0f24c4d69f7fb3bd1ff4fb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Oct 2021 23:07:57 +0200 Subject: [PATCH 19/28] test(deps): update dependency org.mockito:mockito-core to v4 (#1086) * test(deps): update dependency org.mockito:mockito-core to v4 * Fix dependency problem Co-authored-by: Chanseok Oh --- pom.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa2bb497c..68bd96ef1 100644 --- a/pom.xml +++ b/pom.xml @@ -81,8 +81,15 @@ org.mockito mockito-core - 2.28.2 + 4.0.0 test + + + + org.objenesis + objenesis + + org.objenesis From 04d9a8cb015137ada1b2e4cc3f8e62e19e79bbec Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Mon, 11 Oct 2021 18:17:28 -0400 Subject: [PATCH 20/28] chore(retry): cleanup RpcMethodMappings and associated setup (#1098) * Cleanup left over todo's that have been addressed * Ensure all setup operations are taking place during setup and not in the test * Update CtxFunctions to narrow scope of package public functions * Update object setup to also set BlobInfo and BlobId --- .../conformance/retry/CtxFunctions.java | 92 +- .../retry/GracefulConformanceEnforcement.java | 2 +- .../conformance/retry/RetryTestFixture.java | 2 +- .../conformance/retry/RpcMethodMappings.java | 1302 +++++++---------- 4 files changed, 622 insertions(+), 776 deletions(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java index c3ae82b3e..f3797505a 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java @@ -48,10 +48,30 @@ */ final class CtxFunctions { - static final class Util { - private static final CtxFunction blobIdAndBlobInfo = - (ctx, c) -> ctx.map(state -> state.with(BlobInfo.newBuilder(state.getBlobId()).build())); + static final class Local { + + /** + * Populate a copy destination for the state present in the ctx. + * + * @see State#getCopyDest() + */ + static final CtxFunction blobCopy = + (ctx, c) -> ctx.map(s -> s.withCopyDest(BlobId.of(c.getBucketName2(), c.getObjectName()))); + /** + * Populate a bucket info for the state present in the ctx. + * + *

this is primarily useful in the case when you want to insert a bucket during the test + * + * @see State#getBucketInfo() + */ + static final CtxFunction bucketInfo = + (ctx, c) -> ctx.map(s -> s.with(BucketInfo.of(c.getBucketName()))); + /** + * Populate a compose request for the state present in the ctx. + * + * @see State#getComposeRequest() + */ static final CtxFunction composeRequest = (ctx, c) -> ctx.map( @@ -77,59 +97,71 @@ static final class Util { ComposeRequest r = builder.build(); return state.with(r); }); - } - static final class Local { - static final CtxFunction blobCopy = - (ctx, c) -> ctx.map(s -> s.withCopyDest(BlobId.of(c.getBucketName2(), c.getObjectName()))); - - static final CtxFunction bucketInfo = - (ctx, c) -> ctx.map(s -> s.with(BucketInfo.of(c.getBucketName()))); - static final CtxFunction blobIdWithoutGeneration = + private static final CtxFunction blobIdAndBlobInfo = + (ctx, c) -> ctx.map(state -> state.with(BlobInfo.newBuilder(state.getBlobId()).build())); + private static final CtxFunction blobIdWithoutGeneration = (ctx, c) -> ctx.map(s -> s.with(BlobId.of(c.getBucketName(), c.getObjectName()))); - static final CtxFunction blobIdWithGenerationZero = + private static final CtxFunction blobIdWithGenerationZero = (ctx, c) -> ctx.map(s -> s.with(BlobId.of(c.getBucketName(), c.getObjectName(), 0L))); + /** + * Populate a blobId and blob info for the state present in the ctx which specifies a null + * generation. Use when a generation value shouldn't be part of a request or other evaluation. + * + * @see State#getBlobId() + * @see State#getBlobInfo() + */ static final CtxFunction blobInfoWithoutGeneration = - blobIdWithoutGeneration.andThen(Util.blobIdAndBlobInfo); + blobIdWithoutGeneration.andThen(blobIdAndBlobInfo); + /** + * Populate a blobId and blob info for the state present in the ctx which specifies a generation + * of 0 (zero). + * + * @see State#getBlobId() + * @see State#getBlobInfo() + */ static final CtxFunction blobInfoWithGenerationZero = - blobIdWithGenerationZero.andThen(Util.blobIdAndBlobInfo); + blobIdWithGenerationZero.andThen(blobIdAndBlobInfo); } static final class Rpc { - static final CtxFunction bucket = - (ctx, c) -> - ctx.map(state -> state.with(ctx.getStorage().get(state.getBucketInfo().getName()))); - static final CtxFunction blobWithGeneration = - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .create( - BlobInfo.newBuilder(state.getBlobId()).build(), - c.getHelloWorldUtf8Bytes()))); static final CtxFunction createEmptyBlob = (ctx, c) -> ctx.map(state -> state.with(ctx.getStorage().create(state.getBlobInfo()))); } static final class ResourceSetup { - static final CtxFunction bucket = + private static final CtxFunction bucket = (ctx, c) -> { BucketInfo bucketInfo = BucketInfo.newBuilder(c.getBucketName()).build(); Bucket resolvedBucket = ctx.getStorage().create(bucketInfo); return ctx.map(s -> s.with(resolvedBucket)); }; + /** + * Create a new object in the {@link State#getBucket()} and populate a blobId, blob info and + * blob for the state present in the ctx. + * + *

This method will issue an RPC. + * + * @see State#getBlob() + * @see State#getBlobId() + * @see State#getBlobInfo() + */ static final CtxFunction object = (ctx, c) -> { BlobInfo blobInfo = BlobInfo.newBuilder(ctx.getState().getBucket().getName(), c.getObjectName()).build(); - Blob resolvedBlob = ctx.getStorage().create(blobInfo); - return ctx.map(s -> s.with(resolvedBlob)); + Blob resolvedBlob = ctx.getStorage().create(blobInfo, c.getHelloWorldUtf8Bytes()); + return ctx.map( + s -> + s.with(resolvedBlob) + .with((BlobInfo) resolvedBlob) + .with(resolvedBlob.getBlobId())); }; + static final CtxFunction serviceAccount = (ctx, c) -> ctx.map(s -> s.with(ServiceAccount.of(c.getServiceAccountSigner().getAccount()))); - static final CtxFunction hmacKey = + private static final CtxFunction hmacKey = (ctx, c) -> ctx.map( s -> { diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/GracefulConformanceEnforcement.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/GracefulConformanceEnforcement.java index 2fd4f90bb..b8929476d 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/GracefulConformanceEnforcement.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/GracefulConformanceEnforcement.java @@ -32,7 +32,7 @@ /** * As the adherence of {@link com.google.cloud.storage.Storage} to the retry conformance test suite * is an ongoing effort, we need a way in which those tests which are not yet in compliance do not - * server as blockers for other features and commits. + * serve as blockers for other features and commits. * *

This class provides a transparent means of enforcing the reporting of failed tests when ran in * a CI environment. When a test is run, if it fails for any reason the test name will be checked diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java index 6037c8563..ba80d1ff3 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java @@ -86,7 +86,7 @@ public void evaluate() throws Throwable { boolean testSuccess = false; boolean testSkipped = false; try { - LOGGER.finer("Setting up retry_test resource..."); + LOGGER.fine("Setting up retry_test resource..."); RetryTestResource retryTestResource = newRetryTestResource( testRetryConformance.getMethod(), testRetryConformance.getInstruction()); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index d757dea78..f9389de59 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -16,10 +16,6 @@ package com.google.cloud.storage.conformance.retry; -import static com.google.cloud.storage.conformance.retry.CtxFunctions.Local.blobIdWithoutGeneration; -import static com.google.cloud.storage.conformance.retry.CtxFunctions.Local.blobInfoWithGenerationZero; -import static com.google.cloud.storage.conformance.retry.CtxFunctions.Local.blobInfoWithoutGeneration; -import static com.google.cloud.storage.conformance.retry.CtxFunctions.Local.bucketInfo; import static com.google.cloud.storage.conformance.retry.CtxFunctions.ResourceSetup.defaultSetup; import static com.google.cloud.storage.conformance.retry.CtxFunctions.ResourceSetup.serviceAccount; import static com.google.common.base.Predicates.not; @@ -54,7 +50,6 @@ import com.google.cloud.storage.conformance.retry.CtxFunctions.Local; import com.google.cloud.storage.conformance.retry.CtxFunctions.ResourceSetup; import com.google.cloud.storage.conformance.retry.CtxFunctions.Rpc; -import com.google.cloud.storage.conformance.retry.CtxFunctions.Util; import com.google.cloud.storage.conformance.retry.RpcMethod.storage.bucket_acl; import com.google.cloud.storage.conformance.retry.RpcMethod.storage.buckets; import com.google.cloud.storage.conformance.retry.RpcMethod.storage.default_object_acl; @@ -82,7 +77,6 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.io.OutputStream; import java.net.URL; import java.nio.ByteBuffer; import java.nio.channels.Channels; @@ -276,17 +270,14 @@ private static void delete(ArrayList a) { a.add( RpcMethodMapping.newBuilder(87, bucket_acl.delete) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - state.getBucket().deleteAcl(state.getAcl().getEntity()); - assertTrue(success); - return state.with(success); - }))) + (ctx, c) -> + ctx.map( + state -> { + boolean success = + state.getBucket().deleteAcl(state.getAcl().getEntity()); + assertTrue(success); + return state.with(success); + })) .build()); } @@ -299,7 +290,7 @@ private static void get(ArrayList a) { state -> state.with( ctx.getStorage().getAcl(c.getBucketName(), User.ofAllUsers())))) - .build()); // TODO: Why does this exist, varargs should suffice + .build()); a.add( RpcMethodMapping.newBuilder(4, bucket_acl.get) .withTest( @@ -316,14 +307,10 @@ private static void get(ArrayList a) { a.add( RpcMethodMapping.newBuilder(88, bucket_acl.get) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state.getBucket().getAcl(state.getAcl().getEntity()))))) + (ctx, c) -> + ctx.map( + state -> + state.with(state.getBucket().getAcl(state.getAcl().getEntity())))) .build()); } @@ -336,7 +323,7 @@ private static void insert(ArrayList a) { state -> state.with( ctx.getStorage().createAcl(c.getBucketName(), state.getAcl())))) - .build()); // TODO: Why does this exist, varargs should suffice + .build()); a.add( RpcMethodMapping.newBuilder(6, bucket_acl.insert) .withTest( @@ -353,13 +340,8 @@ private static void insert(ArrayList a) { a.add( RpcMethodMapping.newBuilder(89, bucket_acl.insert) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with(state.getBucket().createAcl(state.getAcl()))))) + (ctx, c) -> + ctx.map(state -> state.with(state.getBucket().createAcl(state.getAcl())))) .build()); } @@ -370,7 +352,7 @@ private static void list(ArrayList a) { (ctx, c) -> ctx.map( state -> state.withAcls(ctx.getStorage().listAcls(c.getBucketName())))) - .build()); // TODO: Why does this exist, varargs should suffice + .build()); a.add( RpcMethodMapping.newBuilder(8, bucket_acl.list) .withTest( @@ -386,11 +368,7 @@ private static void list(ArrayList a) { a.add( RpcMethodMapping.newBuilder(90, bucket_acl.list) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map(state -> state.withAcls(state.getBucket().listAcls())))) + (ctx, c) -> ctx.map(state -> state.withAcls(state.getBucket().listAcls()))) .build()); } @@ -403,7 +381,7 @@ private static void patch(ArrayList a) { state -> state.with( ctx.getStorage().updateAcl(c.getBucketName(), state.getAcl())))) - .build()); // TODO: Why does this exist, varargs should suffice + .build()); a.add( RpcMethodMapping.newBuilder(10, bucket_acl.patch) .withTest( @@ -420,13 +398,8 @@ private static void patch(ArrayList a) { a.add( RpcMethodMapping.newBuilder(91, bucket_acl.patch) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with(state.getBucket().updateAcl(state.getAcl()))))) + (ctx, c) -> + ctx.map(state -> state.with(state.getBucket().updateAcl(state.getAcl())))) .build()); } } @@ -451,16 +424,13 @@ private static void delete(ArrayList a) { a.add( RpcMethodMapping.newBuilder(92, buckets.delete) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> { - boolean success = state.getBucket().delete(); - assertTrue(success); - return state.with(success); - }))) + (ctx, c) -> + ctx.map( + state -> { + boolean success = state.getBucket().delete(); + assertTrue(success); + return state.with(success); + })) .build()); a.add( RpcMethodMapping.newBuilder(93, buckets.delete) @@ -536,12 +506,11 @@ private static void insert(ArrayList a) { a.add( RpcMethodMapping.newBuilder(14, buckets.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.bucketInfo)) .withTest( - bucketInfo.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with(ctx.getStorage().create(state.getBucketInfo()))))) + (ctx, c) -> + ctx.map( + state -> state.with(ctx.getStorage().create(state.getBucketInfo())))) .build()); } @@ -557,11 +526,8 @@ private static void patch(ArrayList a) { RpcMethodMapping.newBuilder(17, buckets.patch) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( - bucketInfo.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with(ctx.getStorage().update(state.getBucketInfo()))))) + (ctx, c) -> + ctx.map(state -> state.with(ctx.getStorage().update(state.getBucket())))) .build()); a.add( RpcMethodMapping.newBuilder(122, buckets.patch) @@ -580,26 +546,18 @@ private static void patch(ArrayList a) { RpcMethodMapping.newBuilder(101, buckets.patch) .withApplicable(TestRetryConformance::isPreconditionsProvided) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .update( - BucketTargetOption.metagenerationMatch()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + state + .getBucket() + .update(BucketTargetOption.metagenerationMatch())))) .build()); a.add( RpcMethodMapping.newBuilder(243, buckets.patch) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> ctx.map(state -> state.with(state.getBucket().update())))) + .withTest((ctx, c) -> ctx.map(state -> state.with(state.getBucket().update()))) .build()); } @@ -620,15 +578,14 @@ private static void lockRetentionPolicy(ArrayList a) { RpcMethodMapping.newBuilder(16, buckets.lockRetentionPolicy) .withApplicable(TestRetryConformance::isPreconditionsProvided) .withTest( - bucketInfo.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .lockRetentionPolicy( - state.getBucket(), - BucketTargetOption.metagenerationMatch()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .lockRetentionPolicy( + state.getBucket(), + BucketTargetOption.metagenerationMatch())))) .build()); a.add( RpcMethodMapping.newBuilder(100, buckets.lockRetentionPolicy) @@ -716,7 +673,7 @@ private static void testIamPermission(ArrayList a) { .testIamPermissions( c.getBucketName(), Collections.singletonList("todo: permissions"))))) - .build()); // TODO: configure permissions + .build()); } } @@ -740,19 +697,14 @@ private static void delete(ArrayList a) { a.add( RpcMethodMapping.newBuilder(102, default_object_acl.delete) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - state - .getBucket() - .deleteDefaultAcl(state.getAcl().getEntity()); - assertTrue(success); - return state.with(success); - }))) + (ctx, c) -> + ctx.map( + state -> { + boolean success = + state.getBucket().deleteDefaultAcl(state.getAcl().getEntity()); + assertTrue(success); + return state.with(success); + })) .build()); } @@ -771,16 +723,11 @@ private static void get(ArrayList a) { a.add( RpcMethodMapping.newBuilder(103, default_object_acl.get) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .getDefaultAcl(state.getAcl().getEntity()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + state.getBucket().getDefaultAcl(state.getAcl().getEntity())))) .build()); } @@ -798,14 +745,10 @@ private static void insert(ArrayList a) { a.add( RpcMethodMapping.newBuilder(104, default_object_acl.insert) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state.getBucket().createDefaultAcl(state.getAcl()))))) + (ctx, c) -> + ctx.map( + state -> + state.with(state.getBucket().createDefaultAcl(state.getAcl())))) .build()); } @@ -822,12 +765,8 @@ private static void list(ArrayList a) { a.add( RpcMethodMapping.newBuilder(105, default_object_acl.list) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> state.withAcls(state.getBucket().listDefaultAcls())))) + (ctx, c) -> + ctx.map(state -> state.withAcls(state.getBucket().listDefaultAcls()))) .build()); } @@ -845,14 +784,10 @@ private static void patch(ArrayList a) { a.add( RpcMethodMapping.newBuilder(106, default_object_acl.patch) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state.getBucket().updateDefaultAcl(state.getAcl()))))) + (ctx, c) -> + ctx.map( + state -> + state.with(state.getBucket().updateDefaultAcl(state.getAcl())))) .build()); } @@ -872,8 +807,7 @@ private static void delete(ArrayList a) { Storage storage = ctx.getStorage(); HmacKeyMetadata metadata = state.getHmacKey().getMetadata(); // for delete we're only using the metadata, clear the key that - // was populated - // in defaultSetup and specify the updated metadata + // was populated in defaultSetup and specify the updated metadata return state .withHmacKey(null) .with( @@ -926,7 +860,7 @@ private static void update(ArrayList a) { .updateHmacKeyState( state.getHmacKey().getMetadata(), HmacKeyState.ACTIVE)))) - .build()); // TODO: what state should be used in the test? + .build()); } private static void create(ArrayList a) { @@ -960,31 +894,28 @@ private static void delete(ArrayList a) { a.add( RpcMethodMapping.newBuilder(30, object_acl.delete) .withTest( - blobIdWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - ctx.getStorage() - .deleteAcl(state.getBlobId(), state.getAcl().getEntity()); - assertTrue(success); - return state.with(success); - }))) + (ctx, c) -> + ctx.map( + state -> { + boolean success = + ctx.getStorage() + .deleteAcl( + state.getBlob().getBlobId(), state.getAcl().getEntity()); + assertTrue(success); + return state.with(success); + })) .build()); a.add( RpcMethodMapping.newBuilder(62, object_acl.delete) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - state.getBlob().deleteAcl(state.getAcl().getEntity()); - assertTrue(success); - return state.with(success); - }))) + (ctx, c) -> + ctx.map( + state -> { + boolean success = + state.getBlob().deleteAcl(state.getAcl().getEntity()); + assertTrue(success); + return state.with(success); + })) .build()); } @@ -992,26 +923,22 @@ private static void get(ArrayList a) { a.add( RpcMethodMapping.newBuilder(31, object_acl.get) .withTest( - blobIdWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .getAcl( - state.getBlobId(), state.getAcl().getEntity()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .getAcl( + state.getBlob().getBlobId(), + state.getAcl().getEntity())))) .build()); a.add( RpcMethodMapping.newBuilder(63, object_acl.get) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state.getBlob().getAcl(state.getAcl().getEntity()))))) + (ctx, c) -> + ctx.map( + state -> + state.with(state.getBlob().getAcl(state.getAcl().getEntity())))) .build()); } @@ -1019,24 +946,18 @@ private static void insert(ArrayList a) { a.add( RpcMethodMapping.newBuilder(32, object_acl.insert) .withTest( - blobIdWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createAcl(state.getBlobId(), state.getAcl()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .createAcl(state.getBlob().getBlobId(), state.getAcl())))) .build()); a.add( RpcMethodMapping.newBuilder(64, object_acl.insert) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with(state.getBlob().createAcl(state.getAcl()))))) + (ctx, c) -> + ctx.map(state -> state.with(state.getBlob().createAcl(state.getAcl())))) .build()); } @@ -1044,20 +965,15 @@ private static void list(ArrayList a) { a.add( RpcMethodMapping.newBuilder(33, object_acl.list) .withTest( - blobIdWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> - state.withAcls(ctx.getStorage().listAcls(state.getBlobId()))))) + (ctx, c) -> + ctx.map( + state -> + state.withAcls( + ctx.getStorage().listAcls(state.getBlob().getBlobId())))) .build()); a.add( RpcMethodMapping.newBuilder(65, object_acl.list) - .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> - ctx.map(state -> state.withAcls(state.getBlob().listAcls())))) + .withTest((ctx, c) -> ctx.map(state -> state.withAcls(state.getBlob().listAcls()))) .build()); } @@ -1065,24 +981,18 @@ private static void patch(ArrayList a) { a.add( RpcMethodMapping.newBuilder(34, object_acl.patch) .withTest( - blobIdWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .updateAcl(state.getBlobId(), state.getAcl()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .updateAcl(state.getBlob().getBlobId(), state.getAcl())))) .build()); a.add( RpcMethodMapping.newBuilder(66, object_acl.patch) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with(state.getBlob().updateAcl(state.getAcl()))))) + (ctx, c) -> + ctx.map(state -> state.with(state.getBlob().updateAcl(state.getAcl())))) .build()); } @@ -1104,7 +1014,7 @@ private static void delete(ArrayList a) { assertTrue(success); return state.with(success); })) - .build()); // TODO: Why does this exist, varargs should suffice + .build()); a.add( RpcMethodMapping.newBuilder(37, objects.delete) .withApplicable(TestRetryConformance::isPreconditionsProvided) @@ -1120,7 +1030,7 @@ private static void delete(ArrayList a) { assertTrue(success); return state.with(success); })) - .build()); // TODO: Correct arg? + .build()); a.add( RpcMethodMapping.newBuilder(38, objects.delete) .withApplicable(TestRetryConformance::isPreconditionsProvided) @@ -1138,7 +1048,7 @@ private static void delete(ArrayList a) { assertTrue(success); return state.with(success); })) - .build()); // TODO: Correct arg? + .build()); a.add( RpcMethodMapping.newBuilder(67, objects.delete) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) @@ -1158,328 +1068,276 @@ private static void delete(ArrayList a) { private static void get(ArrayList a) { a.add( RpcMethodMapping.newBuilder(39, objects.get) + .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) .withTest( - blobIdWithoutGeneration.andThen( - (ctx, c) -> - ctx.map(state -> state.with(ctx.getStorage().get(state.getBlobId()))))) - .build()); // TODO: Why does this exist, varargs should suffice + (ctx, c) -> + ctx.map( + state -> state.with(ctx.getStorage().get(state.getBlob().getBlobId())))) + .build()); a.add( RpcMethodMapping.newBuilder(239, objects.get) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withApplicable(TestRetryConformance::isPreconditionsProvided) .withTest( (ctx, c) -> ctx.peek(state -> ctx.getStorage().get(state.getBlob().getBlobId()))) - .withTearDown( - CtxFunctions.ResourceTeardown.object.andThen( - CtxFunctions.ResourceTeardown.bucket)) .build()); a.add( RpcMethodMapping.newBuilder(40, objects.get) .withTest( - blobIdWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .get( - state.getBlobId(), - BlobGetOption.metagenerationMatch(1L)))))) - .build()); // TODO: Correct arg? + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .get( + state.getBlob().getBlobId(), + BlobGetOption.metagenerationMatch( + state.getBlob().getMetageneration()))))) + .build()); a.add( RpcMethodMapping.newBuilder(41, objects.get) .withTest( - blobIdWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .get( - state.getBlobId().getBucket(), - state.getBlobId().getName(), - BlobGetOption.metagenerationMatch(1L)))))) - .build()); // TODO: Correct arg? + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .get( + state.getBlob().getBlobId().getBucket(), + state.getBlob().getBlobId().getName(), + BlobGetOption.metagenerationMatch( + state.getBlob().getMetageneration()))))) + .build()); a.add( RpcMethodMapping.newBuilder(42, objects.get) .withTest( - blobIdWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .readAllBytes( - state.getBlobId(), - BlobSourceOption.metagenerationMatch(1L)))))) - .build()); // TODO: Correct arg? + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .readAllBytes( + state.getBlob().getBlobId(), + BlobSourceOption.metagenerationMatch( + state.getBlob().getMetageneration()))))) + .build()); a.add( RpcMethodMapping.newBuilder(43, objects.get) .withTest( - blobIdWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .readAllBytes( - state.getBlobId().getBucket(), - state.getBlobId().getName(), - BlobSourceOption.metagenerationMatch(1L)))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .readAllBytes( + state.getBlob().getBlobId().getBucket(), + state.getBlob().getBlobId().getName(), + BlobSourceOption.metagenerationMatch( + state.getBlob().getMetageneration()))))) .build()); a.add( RpcMethodMapping.newBuilder(44, objects.get) .withTest( - blobIdWithoutGeneration.andThen( - (ctx, c) -> - ctx.peek( - state -> { - try { - ReadChannel reader = - ctx.getStorage().reader(ctx.getState().getBlobId()); - WritableByteChannel write = - Channels.newChannel(NullOutputStream.INSTANCE); - ByteStreams.copy(reader, write); - } catch (IOException e) { - if (e.getCause() instanceof RetryHelperException) { - RetryHelperException cause = - (RetryHelperException) e.getCause(); - if (cause.getCause() instanceof BaseServiceException) { - throw cause.getCause(); - } - } + (ctx, c) -> + ctx.peek( + state -> { + try { + ReadChannel reader = + ctx.getStorage().reader(ctx.getState().getBlob().getBlobId()); + WritableByteChannel write = + Channels.newChannel(ByteStreams.nullOutputStream()); + ByteStreams.copy(reader, write); + } catch (IOException e) { + if (e.getCause() instanceof RetryHelperException) { + RetryHelperException cause = (RetryHelperException) e.getCause(); + if (cause.getCause() instanceof BaseServiceException) { + throw cause.getCause(); } - }))) + } + } + })) .build()); a.add( RpcMethodMapping.newBuilder(45, objects.get) .withTest( - blobIdWithoutGeneration.andThen( - (ctx, c) -> - ctx.peek( - state -> { - try { - ReadChannel reader = - ctx.getStorage() - .reader( - ctx.getState().getBlobId().getBucket(), - ctx.getState().getBlobId().getName()); - WritableByteChannel write = - Channels.newChannel(NullOutputStream.INSTANCE); - ByteStreams.copy(reader, write); - } catch (IOException e) { - if (e.getCause() instanceof RetryHelperException) { - RetryHelperException cause = - (RetryHelperException) e.getCause(); - if (cause.getCause() instanceof BaseServiceException) { - throw cause.getCause(); - } - } + (ctx, c) -> + ctx.peek( + state -> { + try { + ReadChannel reader = + ctx.getStorage() + .reader( + ctx.getState().getBlob().getBlobId().getBucket(), + ctx.getState().getBlob().getBlobId().getName()); + WritableByteChannel write = + Channels.newChannel(ByteStreams.nullOutputStream()); + ByteStreams.copy(reader, write); + } catch (IOException e) { + if (e.getCause() instanceof RetryHelperException) { + RetryHelperException cause = (RetryHelperException) e.getCause(); + if (cause.getCause() instanceof BaseServiceException) { + throw cause.getCause(); } - }))) + } + } + })) .build()); a.add( RpcMethodMapping.newBuilder(60, objects.get) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> ctx.peek(state -> assertTrue(state.getBlob().exists())))) + .withTest((ctx, c) -> ctx.peek(state -> assertTrue(state.getBlob().exists()))) .build()); a.add( RpcMethodMapping.newBuilder(61, objects.get) .withApplicable(TestRetryConformance::isPreconditionsProvided) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> - ctx.peek( - state -> - assertTrue( - state - .getBlob() - .exists(Blob.BlobSourceOption.generationMatch()))))) + (ctx, c) -> + ctx.peek( + state -> + assertTrue( + state + .getBlob() + .exists(Blob.BlobSourceOption.generationMatch())))) .build()); a.add( RpcMethodMapping.newBuilder(69, objects.get) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> - ctx.peek( - state -> { - Path tmpOutFile = - Files.createTempFile(c.getMethod().getName(), ".txt"); - state - .getBlob() - .downloadTo( - tmpOutFile); // TODO: Why does this exist, varargs - // should suffice - byte[] downloadedBytes = Files.readAllBytes(tmpOutFile); - assertThat(downloadedBytes) - .isEqualTo(c.getHelloWorldUtf8Bytes()); - }))) + (ctx, c) -> + ctx.peek( + state -> { + Path tmpOutFile = + Files.createTempFile(c.getMethod().getName(), ".txt"); + state.getBlob().downloadTo(tmpOutFile); + // should suffice + byte[] downloadedBytes = Files.readAllBytes(tmpOutFile); + assertThat(downloadedBytes).isEqualTo(c.getHelloWorldUtf8Bytes()); + })) .build()); a.add( RpcMethodMapping.newBuilder(70, objects.get) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> - ctx.peek( - state -> { - Path tmpOutFile = - Files.createTempFile(c.getMethod().getName(), ".txt"); - state - .getBlob() - .downloadTo( - tmpOutFile, Blob.BlobSourceOption.generationMatch()); - byte[] downloadedBytes = Files.readAllBytes(tmpOutFile); - assertThat(downloadedBytes) - .isEqualTo(c.getHelloWorldUtf8Bytes()); - }))) + (ctx, c) -> + ctx.peek( + state -> { + Path tmpOutFile = + Files.createTempFile(c.getMethod().getName(), ".txt"); + state + .getBlob() + .downloadTo(tmpOutFile, Blob.BlobSourceOption.generationMatch()); + byte[] downloadedBytes = Files.readAllBytes(tmpOutFile); + assertThat(downloadedBytes).isEqualTo(c.getHelloWorldUtf8Bytes()); + })) .build()); a.add( RpcMethodMapping.newBuilder(71, objects.get) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> - ctx.peek( - state -> { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - state.getBlob().downloadTo(baos); - byte[] downloadedBytes = baos.toByteArray(); - assertThat(downloadedBytes) - .isEqualTo(c.getHelloWorldUtf8Bytes()); - }))) + (ctx, c) -> + ctx.peek( + state -> { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + state.getBlob().downloadTo(baos); + byte[] downloadedBytes = baos.toByteArray(); + assertThat(downloadedBytes).isEqualTo(c.getHelloWorldUtf8Bytes()); + })) .build()); a.add( RpcMethodMapping.newBuilder(72, objects.get) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> - ctx.peek( - state -> { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - state - .getBlob() - .downloadTo( - baos, Blob.BlobSourceOption.generationMatch()); - byte[] downloadedBytes = baos.toByteArray(); - assertThat(downloadedBytes) - .isEqualTo(c.getHelloWorldUtf8Bytes()); - }))) + (ctx, c) -> + ctx.peek( + state -> { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + state + .getBlob() + .downloadTo(baos, Blob.BlobSourceOption.generationMatch()); + byte[] downloadedBytes = baos.toByteArray(); + assertThat(downloadedBytes).isEqualTo(c.getHelloWorldUtf8Bytes()); + })) .build()); a.add( RpcMethodMapping.newBuilder(73, objects.get) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> - ctx.peek( - state -> { - byte[] downloadedBytes = state.getBlob().getContent(); - assertThat(downloadedBytes) - .isEqualTo(c.getHelloWorldUtf8Bytes()); - }))) + (ctx, c) -> + ctx.peek( + state -> { + byte[] downloadedBytes = state.getBlob().getContent(); + assertThat(downloadedBytes).isEqualTo(c.getHelloWorldUtf8Bytes()); + })) .build()); a.add( RpcMethodMapping.newBuilder(74, objects.get) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> - ctx.peek( - state -> { - byte[] downloadedBytes = - state - .getBlob() - .getContent( - Blob.BlobSourceOption.metagenerationMatch()); - assertThat(downloadedBytes) - .isEqualTo(c.getHelloWorldUtf8Bytes()); - }))) + (ctx, c) -> + ctx.peek( + state -> { + byte[] downloadedBytes = + state + .getBlob() + .getContent(Blob.BlobSourceOption.metagenerationMatch()); + assertThat(downloadedBytes).isEqualTo(c.getHelloWorldUtf8Bytes()); + })) .build()); a.add( RpcMethodMapping.newBuilder(75, objects.get) - .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen((ctx, c) -> ctx.peek(state -> state.getBlob().reload()))) + .withTest((ctx, c) -> ctx.peek(state -> state.getBlob().reload())) .build()); a.add( RpcMethodMapping.newBuilder(76, objects.get) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen( - (ctx, c) -> - ctx.peek( - state -> - state - .getBlob() - .reload(Blob.BlobSourceOption.metagenerationMatch())))) + (ctx, c) -> + ctx.peek( + state -> + state + .getBlob() + .reload(Blob.BlobSourceOption.metagenerationMatch()))) .build()); a.add( RpcMethodMapping.newBuilder(107, objects.get) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> state.with(state.getBucket().get(c.getObjectName()))))) - .build()); // TODO: Fill out permutations here + (ctx, c) -> + ctx.map(state -> state.with(state.getBucket().get(c.getObjectName())))) + .build()); } private static void insert(ArrayList a) { a.add( RpcMethodMapping.newBuilder(46, objects.insert) .withApplicable(TestRetryConformance::isPreconditionsProvided) + .withSetup(defaultSetup.andThen(Local.blobInfoWithGenerationZero)) .withTest( - blobInfoWithGenerationZero.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .create( - ctx.getState().getBlobInfo(), - c.getHelloWorldUtf8Bytes(), - BlobTargetOption.generationMatch()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .create( + ctx.getState().getBlobInfo(), + c.getHelloWorldUtf8Bytes(), + BlobTargetOption.generationMatch())))) .build()); a.add( RpcMethodMapping.newBuilder(47, objects.insert) .withApplicable(TestRetryConformance::isPreconditionsProvided) + .withSetup(defaultSetup.andThen(Local.blobInfoWithGenerationZero)) .withTest( - blobInfoWithGenerationZero.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .create( - ctx.getState().getBlobInfo(), - c.getHelloWorldUtf8Bytes(), - 0, - c.getHelloWorldUtf8Bytes().length / 2, - BlobTargetOption.generationMatch()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .create( + ctx.getState().getBlobInfo(), + c.getHelloWorldUtf8Bytes(), + 0, + c.getHelloWorldUtf8Bytes().length / 2, + BlobTargetOption.generationMatch())))) .build()); a.add( RpcMethodMapping.newBuilder(48, objects.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(blobInfoWithGenerationZero)) + .withSetup(defaultSetup.andThen(Local.blobInfoWithGenerationZero)) .withTest( (ctx, c) -> ctx.map( @@ -1494,143 +1352,143 @@ private static void insert(ArrayList a) { a.add( RpcMethodMapping.newBuilder(49, objects.insert) .withApplicable(TestRetryConformance::isPreconditionsProvided) + .withSetup(defaultSetup.andThen(Local.blobInfoWithGenerationZero)) .withTest( - blobInfoWithGenerationZero.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createFrom( - ctx.getState().getBlobInfo(), - new ByteArrayInputStream( - c.getHelloWorldUtf8Bytes()), - BlobWriteOption.generationMatch()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .createFrom( + ctx.getState().getBlobInfo(), + new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()), + BlobWriteOption.generationMatch())))) .build()); a.add( RpcMethodMapping.newBuilder(50, objects.insert) .withApplicable(TestRetryConformance::isPreconditionsProvided) + .withSetup(defaultSetup.andThen(Local.blobInfoWithGenerationZero)) .withTest( - blobInfoWithGenerationZero.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createFrom( - ctx.getState().getBlobInfo(), - c.getHelloWorldFilePath(), - BlobWriteOption.generationMatch()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .createFrom( + ctx.getState().getBlobInfo(), + c.getHelloWorldFilePath(), + BlobWriteOption.generationMatch())))) .build()); a.add( RpcMethodMapping.newBuilder(51, objects.insert) .withApplicable(TestRetryConformance::isPreconditionsProvided) + .withSetup(defaultSetup.andThen(Local.blobInfoWithGenerationZero)) .withTest( - blobInfoWithGenerationZero.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createFrom( - ctx.getState().getBlobInfo(), - c.getHelloWorldFilePath(), - _2MiB, - BlobWriteOption.generationMatch()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .createFrom( + ctx.getState().getBlobInfo(), + c.getHelloWorldFilePath(), + _2MiB, + BlobWriteOption.generationMatch())))) .build()); a.add( RpcMethodMapping.newBuilder(52, objects.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) .withTest( - blobInfoWithoutGeneration.andThen( - (ctx, c) -> - ctx.peek( - state -> { - try (WriteChannel writer = - ctx.getStorage().writer(ctx.getState().getBlobInfo())) { - writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); - } - }))) + (ctx, c) -> + ctx.peek( + state -> { + try (WriteChannel writer = + ctx.getStorage().writer(ctx.getState().getBlobInfo())) { + writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); + } + })) .build()); a.add( RpcMethodMapping.newBuilder(53, objects.insert) .withApplicable(TestRetryConformance::isPreconditionsProvided) + .withSetup(defaultSetup.andThen(Local.blobInfoWithGenerationZero)) .withTest( - blobInfoWithGenerationZero.andThen( - (ctx, c) -> - ctx.peek( - state -> { - try (WriteChannel writer = - ctx.getStorage() - .writer( - ctx.getState().getBlobInfo(), - BlobWriteOption.generationMatch())) { - writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); - } - }))) + (ctx, c) -> + ctx.peek( + state -> { + try (WriteChannel writer = + ctx.getStorage() + .writer( + ctx.getState().getBlobInfo(), + BlobWriteOption.generationMatch())) { + writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); + } + })) .build()); a.add( RpcMethodMapping.newBuilder(54, objects.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) .withTest( - blobInfoWithoutGeneration.andThen( - (ctx, c) -> - ctx.peek( - state -> { - Storage storage = ctx.getStorage(); - URL signedUrl = - storage.signUrl( - state.getBlobInfo(), - 1, - TimeUnit.HOURS, - SignUrlOption.httpMethod(HttpMethod.POST), - // TODO: Instead of using bucketBoundHostname fix Signer - // to get BaseUri from StorageOptions - // NOTE(frankyn/benwhitehead): testbench expects HTTP - // scheme and we are using a hack to get around - // the lack of scheme manipulation by using - // bucketBoundHostname to select HTTP - // scheme instead. Bucket name is not present explicitly - // in bucketBoundHostname because it's - // expected to be referred to by the Bucket Bound Hostname - // so we must append it, being the hack, - // to get around the limitation. - SignUrlOption.withBucketBoundHostname( - c.getHost() - + "/" - + c.getBucketName() - + "/" - + c.getObjectName(), - UriScheme.HTTP), - SignUrlOption.withExtHeaders( - ImmutableMap.of("x-goog-resumable", "start")), - SignUrlOption.signWith(c.getServiceAccountSigner()), - SignUrlOption.withV4Signature()); - try (WriteChannel writer = storage.writer(signedUrl)) { - writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); - } - }))) + (ctx, c) -> + ctx.peek( + state -> { + Storage storage = ctx.getStorage(); + URL signedUrl = + storage.signUrl( + state.getBlobInfo(), + 1, + TimeUnit.HOURS, + SignUrlOption.httpMethod(HttpMethod.POST), + // TODO(#1094): Instead of using bucketBoundHostname fix + // Signer to get BaseUri from StorageOptions + // NOTE(frankyn/benwhitehead): testbench expects HTTP scheme + // and we are using a hack to get around the lack of scheme + // manipulation by using bucketBoundHostname to select HTTP + // scheme instead. Bucket name is not present explicitly in + // bucketBoundHostname because it's expected to be referred to + // by the Bucket Bound Hostname so we must append it, being + // the hack, to get around the limitation. + SignUrlOption.withBucketBoundHostname( + c.getHost() + + "/" + + c.getBucketName() + + "/" + + c.getObjectName(), + UriScheme.HTTP), + SignUrlOption.withExtHeaders( + ImmutableMap.of("x-goog-resumable", "start")), + SignUrlOption.signWith(c.getServiceAccountSigner()), + SignUrlOption.withV4Signature()); + try (WriteChannel writer = storage.writer(signedUrl)) { + writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); + } + })) .build()); a.add( RpcMethodMapping.newBuilder(77, objects.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup( + defaultSetup + .andThen(Local.blobInfoWithoutGeneration) + .andThen(Rpc.createEmptyBlob)) .withTest( - blobInfoWithoutGeneration - .andThen(Rpc.createEmptyBlob) - .andThen( - (ctx, c) -> - ctx.peek( - state -> { - try (WriteChannel writer = state.getBlob().writer()) { - writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); - } - }))) + (ctx, c) -> + ctx.peek( + state -> { + try (WriteChannel writer = state.getBlob().writer()) { + writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); + } + })) .build()); a.add( RpcMethodMapping.newBuilder(78, objects.insert) .withApplicable(TestRetryConformance::isPreconditionsProvided) .withSetup( - defaultSetup.andThen(blobInfoWithoutGeneration).andThen(ResourceSetup.object)) + defaultSetup + .andThen(Local.blobInfoWithoutGeneration) + .andThen(ResourceSetup.object)) .withTest( (ctx, c) -> ctx.peek( @@ -1652,7 +1510,7 @@ private static void insert(ArrayList a) { state .getBucket() .create(c.getObjectName(), c.getHelloWorldUtf8Bytes())))) - .build()); // TODO: Fill out permutations here + .build()); a.add( RpcMethodMapping.newBuilder(109, objects.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) @@ -1700,37 +1558,37 @@ private static void insert(ArrayList a) { a.add( RpcMethodMapping.newBuilder(112, objects.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) .withTest( - blobInfoWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .create( - ctx.getState().getBlobInfo(), - c.getHelloWorldUtf8Bytes()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .create( + ctx.getState().getBlobInfo(), + c.getHelloWorldUtf8Bytes())))) .build()); a.add( RpcMethodMapping.newBuilder(113, objects.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) .withTest( - blobInfoWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .create( - ctx.getState().getBlobInfo(), - c.getHelloWorldUtf8Bytes(), - 0, - c.getHelloWorldUtf8Bytes().length / 2))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .create( + ctx.getState().getBlobInfo(), + c.getHelloWorldUtf8Bytes(), + 0, + c.getHelloWorldUtf8Bytes().length / 2)))) .build()); a.add( RpcMethodMapping.newBuilder(114, objects.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(blobInfoWithoutGeneration)) + .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) .withTest( (ctx, c) -> ctx.map( @@ -1744,122 +1602,107 @@ private static void insert(ArrayList a) { a.add( RpcMethodMapping.newBuilder(115, objects.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) .withTest( - blobInfoWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createFrom( - ctx.getState().getBlobInfo(), - new ByteArrayInputStream( - c.getHelloWorldUtf8Bytes())))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .createFrom( + ctx.getState().getBlobInfo(), + new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()))))) .build()); a.add( RpcMethodMapping.newBuilder(116, objects.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) .withTest( - blobInfoWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createFrom( - ctx.getState().getBlobInfo(), - c.getHelloWorldFilePath()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .createFrom( + ctx.getState().getBlobInfo(), + c.getHelloWorldFilePath())))) .build()); a.add( RpcMethodMapping.newBuilder(117, objects.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) .withTest( - blobInfoWithoutGeneration.andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createFrom( - ctx.getState().getBlobInfo(), - c.getHelloWorldFilePath(), - _2MiB))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + ctx.getStorage() + .createFrom( + ctx.getState().getBlobInfo(), + c.getHelloWorldFilePath(), + _2MiB)))) .build()); a.add( RpcMethodMapping.newBuilder(118, objects.insert) .withApplicable(TestRetryConformance::isPreconditionsProvided) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .create( - c.getObjectName(), - c.getHelloWorldUtf8Bytes(), - Bucket.BlobTargetOption.doesNotExist()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + state + .getBucket() + .create( + c.getObjectName(), + c.getHelloWorldUtf8Bytes(), + Bucket.BlobTargetOption.doesNotExist())))) .build()); a.add( RpcMethodMapping.newBuilder(119, objects.insert) .withApplicable(TestRetryConformance::isPreconditionsProvided) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .create( - c.getObjectName(), - c.getHelloWorldUtf8Bytes(), - "text/plain);charset=utf-8", - Bucket.BlobTargetOption.doesNotExist()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + state + .getBucket() + .create( + c.getObjectName(), + c.getHelloWorldUtf8Bytes(), + "text/plain);charset=utf-8", + Bucket.BlobTargetOption.doesNotExist())))) .build()); a.add( RpcMethodMapping.newBuilder(120, objects.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .create( - c.getObjectName(), - new ByteArrayInputStream( - c.getHelloWorldUtf8Bytes()), - Bucket.BlobWriteOption.doesNotExist()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + state + .getBucket() + .create( + c.getObjectName(), + new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()), + Bucket.BlobWriteOption.doesNotExist())))) .build()); a.add( RpcMethodMapping.newBuilder(121, objects.insert) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) .withTest( - bucketInfo - .andThen(Rpc.bucket) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .create( - c.getObjectName(), - new ByteArrayInputStream( - c.getHelloWorldUtf8Bytes()), - "text/plain);charset=utf-8", - Bucket.BlobWriteOption.doesNotExist()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + state + .getBucket() + .create( + c.getObjectName(), + new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()), + "text/plain);charset=utf-8", + Bucket.BlobWriteOption.doesNotExist())))) .build()); } @@ -1880,7 +1723,7 @@ private static void patch(ArrayList a) { (ctx, c) -> ctx.map( state -> state.with(ctx.getStorage().update(ctx.getState().getBlob())))) - .build()); // TODO: Why does this exist, varargs should suffice + .build()); a.add( RpcMethodMapping.newBuilder(57, objects.patch) .withApplicable(TestRetryConformance::isPreconditionsProvided) @@ -1910,7 +1753,7 @@ private static void patch(ArrayList a) { state .getBlob() .update(BlobTargetOption.metagenerationMatch())))) - .build()); // TODO: Correct arg? + .build()); } private static void update(ArrayList a) {} @@ -1919,7 +1762,7 @@ private static void compose(ArrayList a) { a.add( RpcMethodMapping.newBuilder(35, objects.compose) .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withSetup(defaultSetup.andThen(Util.composeRequest)) + .withSetup(defaultSetup.andThen(Local.composeRequest)) .withTest( (ctx, c) -> ctx.map( @@ -1929,7 +1772,7 @@ private static void compose(ArrayList a) { a.add( RpcMethodMapping.newBuilder(241, objects.compose) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Util.composeRequest)) + .withSetup(defaultSetup.andThen(Local.composeRequest)) .withTest( (ctx, c) -> ctx.map( @@ -1974,104 +1817,82 @@ private static void rewrite(ArrayList a) { a.add( RpcMethodMapping.newBuilder(81, objects.rewrite) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.blobCopy)) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen(Local.blobCopy) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with(state.getBlob().copyTo(state.getCopyDest()))))) + (ctx, c) -> + ctx.map(state -> state.with(state.getBlob().copyTo(state.getCopyDest())))) .build()); a.add( RpcMethodMapping.newBuilder(82, objects.rewrite) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.blobCopy)) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen(Local.blobCopy) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBlob() - .copyTo( - state.getCopyDest(), - Blob.BlobSourceOption.metagenerationMatch()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + state + .getBlob() + .copyTo( + state.getCopyDest(), + Blob.BlobSourceOption.metagenerationMatch())))) .build()); a.add( RpcMethodMapping.newBuilder(83, objects.rewrite) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.blobCopy)) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen(Local.blobCopy) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBlob() - .copyTo(state.getCopyDest().getBucket()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + state.getBlob().copyTo(state.getCopyDest().getBucket())))) .build()); a.add( RpcMethodMapping.newBuilder(84, objects.rewrite) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.blobCopy)) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen(Local.blobCopy) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBlob() - .copyTo( - state.getCopyDest().getBucket(), - Blob.BlobSourceOption.metagenerationMatch()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + state + .getBlob() + .copyTo( + state.getCopyDest().getBucket(), + Blob.BlobSourceOption.metagenerationMatch())))) .build()); a.add( RpcMethodMapping.newBuilder(85, objects.rewrite) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.blobCopy)) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen(Local.blobCopy) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBlob() - .copyTo( - state.getCopyDest().getBucket(), - state.getCopyDest().getName()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + state + .getBlob() + .copyTo( + state.getCopyDest().getBucket(), + state.getCopyDest().getName())))) .build()); a.add( RpcMethodMapping.newBuilder(86, objects.rewrite) .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) + .withSetup(defaultSetup.andThen(Local.blobCopy)) .withTest( - blobIdWithoutGeneration - .andThen(Rpc.blobWithGeneration) - .andThen(Local.blobCopy) - .andThen( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBlob() - .copyTo( - state.getCopyDest().getBucket(), - state.getCopyDest().getName(), - Blob.BlobSourceOption.metagenerationMatch()))))) + (ctx, c) -> + ctx.map( + state -> + state.with( + state + .getBlob() + .copyTo( + state.getCopyDest().getBucket(), + state.getCopyDest().getName(), + Blob.BlobSourceOption.metagenerationMatch())))) .build()); } @@ -2094,11 +1915,4 @@ private static void get(ArrayList a) { private static void put(ArrayList a) {} } } - - static final class NullOutputStream extends OutputStream { - private static final NullOutputStream INSTANCE = new NullOutputStream(); - - @Override - public void write(int b) {} - } } From bf9dccc182d462d0c14d20864538874761bc089a Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Mon, 11 Oct 2021 18:32:12 -0400 Subject: [PATCH 21/28] test(retry): update temp file cleanup code (#1099) Update temp file cleanup code to ensure everything is cleaned up in the proper scope and order. --- .../conformance/retry/RpcMethodMappings.java | 51 ++++++++++++------- .../storage/conformance/retry/TestBench.java | 11 ++-- 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index f9389de59..6470ab17f 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -50,6 +50,7 @@ import com.google.cloud.storage.conformance.retry.CtxFunctions.Local; import com.google.cloud.storage.conformance.retry.CtxFunctions.ResourceSetup; import com.google.cloud.storage.conformance.retry.CtxFunctions.Rpc; +import com.google.cloud.storage.conformance.retry.Functions.EConsumer; import com.google.cloud.storage.conformance.retry.RpcMethod.storage.bucket_acl; import com.google.cloud.storage.conformance.retry.RpcMethod.storage.buckets; import com.google.cloud.storage.conformance.retry.RpcMethod.storage.default_object_acl; @@ -232,6 +233,16 @@ private void reportMappingSummary() { } } + private static void withTempFile(String prefix, String suffix, EConsumer f) + throws Throwable { + Path tmpOutFile = Files.createTempFile(prefix, suffix); + try { + f.consume(tmpOutFile); + } finally { + Files.delete(tmpOutFile); + } + } + static final class Mappings { static final class BucketAcl { @@ -1205,29 +1216,35 @@ private static void get(ArrayList a) { .withTest( (ctx, c) -> ctx.peek( - state -> { - Path tmpOutFile = - Files.createTempFile(c.getMethod().getName(), ".txt"); - state.getBlob().downloadTo(tmpOutFile); - // should suffice - byte[] downloadedBytes = Files.readAllBytes(tmpOutFile); - assertThat(downloadedBytes).isEqualTo(c.getHelloWorldUtf8Bytes()); - })) + state -> + withTempFile( + c.getMethod().getName(), + ".txt", + (tmpOutFile) -> { + state.getBlob().downloadTo(tmpOutFile); + byte[] downloadedBytes = Files.readAllBytes(tmpOutFile); + assertThat(downloadedBytes) + .isEqualTo(c.getHelloWorldUtf8Bytes()); + }))) .build()); a.add( RpcMethodMapping.newBuilder(70, objects.get) .withTest( (ctx, c) -> ctx.peek( - state -> { - Path tmpOutFile = - Files.createTempFile(c.getMethod().getName(), ".txt"); - state - .getBlob() - .downloadTo(tmpOutFile, Blob.BlobSourceOption.generationMatch()); - byte[] downloadedBytes = Files.readAllBytes(tmpOutFile); - assertThat(downloadedBytes).isEqualTo(c.getHelloWorldUtf8Bytes()); - })) + state -> + withTempFile( + c.getMethod().getName(), + ".txt", + (tmpOutFile) -> { + state + .getBlob() + .downloadTo( + tmpOutFile, Blob.BlobSourceOption.generationMatch()); + byte[] downloadedBytes = Files.readAllBytes(tmpOutFile); + assertThat(downloadedBytes) + .isEqualTo(c.getHelloWorldUtf8Bytes()); + }))) .build()); a.add( RpcMethodMapping.newBuilder(71, objects.get) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestBench.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestBench.java index f344b9804..f4da57ff1 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestBench.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestBench.java @@ -148,8 +148,11 @@ public Statement apply(final Statement base, Description description) { @Override public void evaluate() throws Throwable { Path tempDirectory = Files.createTempDirectory("retry-conformance-server"); - File outFile = tempDirectory.resolve("stdout").toFile(); - File errFile = tempDirectory.resolve("stderr").toFile(); + Path outPath = tempDirectory.resolve("stdout"); + Path errPath = tempDirectory.resolve("stderr"); + + File outFile = outPath.toFile(); + File errFile = errPath.toFile(); LOGGER.info("Redirecting server stdout to: " + outFile.getAbsolutePath()); LOGGER.info("Redirecting server stderr to: " + errFile.getAbsolutePath()); String dockerImage = String.format("%s:%s", dockerImageName, dockerImageTag); @@ -230,8 +233,8 @@ public boolean shouldRetry( process.destroy(); if (cleanupStrategy == CleanupStrategy.ALWAYS || (success && cleanupStrategy == CleanupStrategy.ONLY_ON_SUCCESS)) { - outFile.delete(); - errFile.delete(); + Files.delete(errPath); + Files.delete(outPath); Files.delete(tempDirectory); } } From 17d884b1823325dda77ac8339ee3774a0f52dc70 Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Tue, 12 Oct 2021 15:28:16 -0400 Subject: [PATCH 22/28] test(retry): refactor things to ensure teardown is run per test (#1100) * Refactor teardown function to be tolerant of multiple objects being created during a test (copy, rewrite etc.), and bucket and hmac key existence. * Fix RpcMethodMapping.Builder not correctly carrying though a specified tearDown operation * Update mapping 26 (storage.hmacKey.delete) not fully clearing the state it was modifying Related to #1095 (I don't think cleanup is the sole reason for test failures, but this does seem to alleviate the failures for several of the seeds.) --- .../conformance/retry/CtxFunctions.java | 57 +++++++++++++++---- .../storage/conformance/retry/Functions.java | 9 --- .../retry/ITRetryConformanceTest.java | 46 +++++++++------ .../conformance/retry/RpcMethodMapping.java | 11 +++- .../conformance/retry/RpcMethodMappings.java | 10 ++-- .../storage/conformance/retry/State.java | 6 -- 6 files changed, 87 insertions(+), 52 deletions(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java index f3797505a..5e8e04fce 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java @@ -18,6 +18,7 @@ import static com.google.common.collect.Sets.newHashSet; +import com.google.api.gax.paging.Page; import com.google.cloud.conformance.storage.v1.Resource; import com.google.cloud.storage.Acl; import com.google.cloud.storage.Acl.Role; @@ -28,7 +29,10 @@ import com.google.cloud.storage.Bucket; import com.google.cloud.storage.BucketInfo; import com.google.cloud.storage.HmacKey; +import com.google.cloud.storage.HmacKey.HmacKeyMetadata; +import com.google.cloud.storage.HmacKey.HmacKeyState; import com.google.cloud.storage.ServiceAccount; +import com.google.cloud.storage.Storage; import com.google.cloud.storage.Storage.BlobTargetOption; import com.google.cloud.storage.Storage.ComposeRequest; import com.google.cloud.storage.conformance.retry.Functions.CtxFunction; @@ -203,17 +207,46 @@ static final class ResourceSetup { } static final class ResourceTeardown { - static final CtxFunction object = - (ctx, c) -> { - BlobInfo blobInfo = - BlobInfo.newBuilder(ctx.getState().getBucket().getName(), c.getObjectName()).build(); - ctx.getStorage().delete(blobInfo.getBlobId()); - return ctx.map(s -> s.with((Blob) null)); - }; - static final CtxFunction bucket = - (ctx, c) -> { - ctx.getState().getBucket().delete(); - return ctx.map(s -> s.with((Bucket) null)); - }; + private static final CtxFunction deleteAllObjects = + (ctx, c) -> + ctx.map( + s -> { + Storage storage = ctx.getStorage(); + deleteBucket(storage, c.getBucketName()); + deleteBucket(storage, c.getBucketName2()); + State newState = + s.with((Blob) null) + .with((BlobInfo) null) + .with((BlobId) null) + .with((Bucket) null); + + if (s.hasHmacKeyMetadata()) { + HmacKeyMetadata metadata = s.getHmacKeyMetadata(); + if (metadata.getState() == HmacKeyState.ACTIVE) { + metadata = storage.updateHmacKeyState(metadata, HmacKeyState.INACTIVE); + } + storage.deleteHmacKey(metadata); + newState.with((HmacKeyMetadata) null).withHmacKey(null); + } + + return newState; + }); + + static final CtxFunction defaultTeardown = deleteAllObjects; + + private static void deleteBucket(Storage storage, String bucketName) { + Bucket bucket = storage.get(bucketName); + if (bucket != null) { + emptyBucket(storage, bucketName); + bucket.delete(); + } + } + + private static void emptyBucket(Storage storage, String bucketName) { + Page blobs = storage.list(bucketName); + for (Blob blob : blobs.iterateAll()) { + blob.delete(); + } + } } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/Functions.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/Functions.java index cda0eedde..46d5643e0 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/Functions.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/Functions.java @@ -61,13 +61,4 @@ interface EFunction { interface EConsumer { void consume(A a) throws Throwable; } - - /** - * Define a function which has a void return. This is definition is absolutely not pure and only - * exists because some methods on the public api for storage have void return type. - */ - @FunctionalInterface - interface VoidFunction { - void apply() throws Throwable; - } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java index a6a08d73c..40dcd2afa 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java @@ -51,7 +51,9 @@ import java.util.function.BiPredicate; import java.util.logging.Logger; import java.util.stream.Collectors; +import org.junit.After; import org.junit.AssumptionViolatedException; +import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; @@ -80,6 +82,9 @@ public class ITRetryConformanceTest { private final TestRetryConformance testRetryConformance; private final RpcMethodMapping mapping; + private Storage nonTestStorage; + private Storage testStorage; + private Ctx ctx; public ITRetryConformanceTest( TestRetryConformance testRetryConformance, RpcMethodMapping mapping) { @@ -91,35 +96,40 @@ public ITRetryConformanceTest( new RetryTestFixture(CleanupStrategy.ALWAYS, TEST_BENCH, testRetryConformance); } + @Before + public void setUp() throws Throwable { + LOGGER.fine("Running setup..."); + nonTestStorage = retryTestFixture.getNonTestStorage(); + testStorage = retryTestFixture.getTestStorage(); + // it's important to keep these two ctx assignments separate to allow for teardown to work in + // the case setup fails for some reason + ctx = ctx(nonTestStorage, empty()); + ctx = mapping.getSetup().apply(ctx, testRetryConformance).leftMap(s -> testStorage); + LOGGER.fine("Running setup complete"); + } + + @After + public void tearDown() throws Throwable { + LOGGER.fine("Running teardown..."); + getReplaceStorageInObjectsFromCtx() + .andThen(mapping.getTearDown()) + .apply(ctx, testRetryConformance); + LOGGER.fine("Running teardown complete"); + } + /** * Run an individual test case. 1. Create two storage clients, one for setup/teardown and one for * test execution 2. Run setup 3. Run test 4. Run teardown */ @Test public void test() throws Throwable { - Storage nonTestStorage = retryTestFixture.getNonTestStorage(); - Storage testStorage = retryTestFixture.getTestStorage(); - - Ctx ctx = ctx(nonTestStorage, empty()); - - LOGGER.fine("Running setup..."); - Ctx postSetupCtx = - mapping.getSetup().apply(ctx, testRetryConformance).leftMap(s -> testStorage); - LOGGER.fine("Running setup complete"); - LOGGER.fine("Running test..."); - Ctx postTestCtx = + ctx = getReplaceStorageInObjectsFromCtx() .andThen(mapping.getTest()) - .apply(postSetupCtx, testRetryConformance) + .apply(ctx, testRetryConformance) .leftMap(s -> nonTestStorage); LOGGER.fine("Running test complete"); - - LOGGER.fine("Running teardown..."); - getReplaceStorageInObjectsFromCtx() - .andThen(mapping.getTearDown()) - .apply(postTestCtx, testRetryConformance); - LOGGER.fine("Running teardown complete"); } /** diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMapping.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMapping.java index 2d76aa572..1c3947adb 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMapping.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMapping.java @@ -22,6 +22,7 @@ import com.google.cloud.storage.StorageException; import com.google.cloud.storage.conformance.retry.CtxFunctions.ResourceSetup; +import com.google.cloud.storage.conformance.retry.CtxFunctions.ResourceTeardown; import com.google.cloud.storage.conformance.retry.Functions.CtxFunction; import com.google.common.base.Preconditions; import com.google.errorprone.annotations.Immutable; @@ -152,7 +153,13 @@ static final class Builder { private CtxFunction tearDown; Builder(int mappingId, RpcMethod method) { - this(mappingId, method, x -> true, ResourceSetup.defaultSetup, null, CtxFunction.identity()); + this( + mappingId, + method, + x -> true, + ResourceSetup.defaultSetup, + null, + ResourceTeardown.defaultTeardown); } private Builder( @@ -179,7 +186,7 @@ public Builder withSetup(CtxFunction setup) { } public Builder withTest(CtxFunction test) { - return new Builder(mappingId, method, applicable, setup, test, CtxFunction.identity()); + return new Builder(mappingId, method, applicable, setup, test, tearDown); } public Builder withTearDown(CtxFunction tearDown) { diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java index 6470ab17f..668fa902c 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java @@ -828,11 +828,11 @@ private static void delete(ArrayList a) { .withTest( (ctx, c) -> ctx.map( - state -> - state.consume( - () -> - ctx.getStorage() - .deleteHmacKey(state.getHmacKeyMetadata())))) + state -> { + ctx.getStorage().deleteHmacKey(state.getHmacKeyMetadata()); + // clear the metadata from the state now that we've deleted it + return state.with((HmacKeyMetadata) null); + })) .build()); } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/State.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/State.java index 4f7552977..94d1542ca 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/State.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/State.java @@ -31,7 +31,6 @@ import com.google.cloud.storage.HmacKey.HmacKeyMetadata; import com.google.cloud.storage.ServiceAccount; import com.google.cloud.storage.Storage.ComposeRequest; -import com.google.cloud.storage.conformance.retry.Functions.VoidFunction; import com.google.common.collect.ImmutableMap; import com.google.errorprone.annotations.Immutable; import java.util.HashMap; @@ -92,11 +91,6 @@ static State empty() { return EMPTY; } - public State consume(VoidFunction f) throws Throwable { - f.apply(); - return this; - } - public boolean hasAcl() { return hasValue(KEY_ACL); } From 0cd4ec09c847f46d4858d78e0642364a3901598c Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Tue, 12 Oct 2021 15:58:14 -0400 Subject: [PATCH 23/28] test(retry): pin version of testbench image to v0.8.0 (#1102) * update testNamesWhichShouldSucceed.txt to match fixes from testbench:v0.8.0 --- .../storage/conformance/retry/TestBench.java | 2 +- .../retry/testNamesWhichShouldSucceed.txt | 84 ++++++++++++++++--- 2 files changed, 72 insertions(+), 14 deletions(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestBench.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestBench.java index f4da57ff1..c5642f9a2 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestBench.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestBench.java @@ -288,7 +288,7 @@ static final class Builder { private static final String DEFAULT_BASE_URI = "http://localhost:9000"; private static final String DEFAULT_IMAGE_NAME = "gcr.io/cloud-devrel-public-resources/storage-testbench"; - private static final String DEFAULT_IMAGE_TAG = "latest"; + private static final String DEFAULT_IMAGE_TAG = "v0.8.0"; private boolean ignorePullError; private String baseUri; diff --git a/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichShouldSucceed.txt b/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichShouldSucceed.txt index 553adc550..8e4cfbd53 100644 --- a/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichShouldSucceed.txt +++ b/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichShouldSucceed.txt @@ -32,7 +32,6 @@ TestRetryConformance/1-[return-503_return-503]-storage.object_acl.get-63 TestRetryConformance/1-[return-503_return-503]-storage.object_acl.list-33 TestRetryConformance/1-[return-503_return-503]-storage.object_acl.list-65 TestRetryConformance/1-[return-503_return-503]-storage.objects.get-107 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-239 TestRetryConformance/1-[return-503_return-503]-storage.objects.get-39 TestRetryConformance/1-[return-503_return-503]-storage.objects.get-40 TestRetryConformance/1-[return-503_return-503]-storage.objects.get-41 @@ -78,7 +77,6 @@ TestRetryConformance/1-[return-reset-connection_return-503]-storage.object_acl.g TestRetryConformance/1-[return-reset-connection_return-503]-storage.object_acl.list-33 TestRetryConformance/1-[return-reset-connection_return-503]-storage.object_acl.list-65 TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-107 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-239 TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-39 TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-40 TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-41 @@ -124,7 +122,6 @@ TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.object_acl.list-33 TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.object_acl.list-65 TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-107 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-239 TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-39 TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-40 TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-41 @@ -145,35 +142,63 @@ TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.serviceaccount.get-59 TestRetryConformance/2-[return-503_return-503]-storage.buckets.patch-101 TestRetryConformance/2-[return-503_return-503]-storage.buckets.patch-122 +TestRetryConformance/2-[return-503_return-503]-storage.buckets.setIamPolicy-240 TestRetryConformance/2-[return-503_return-503]-storage.objects.compose-35 TestRetryConformance/2-[return-503_return-503]-storage.objects.delete-37 TestRetryConformance/2-[return-503_return-503]-storage.objects.delete-38 TestRetryConformance/2-[return-503_return-503]-storage.objects.delete-68 +TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-118 +TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-119 TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-46 TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-47 +TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-49 +TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-50 +TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-51 +TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-53 +TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-78 TestRetryConformance/2-[return-503_return-503]-storage.objects.patch-57 TestRetryConformance/2-[return-503_return-503]-storage.objects.patch-80 +TestRetryConformance/2-[return-503_return-503]-storage.objects.rewrite-58 TestRetryConformance/2-[return-reset-connection_return-503]-storage.buckets.patch-101 TestRetryConformance/2-[return-reset-connection_return-503]-storage.buckets.patch-122 +TestRetryConformance/2-[return-reset-connection_return-503]-storage.buckets.setIamPolicy-240 TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.compose-35 TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.delete-37 TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.delete-38 TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.delete-68 +TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-118 +TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-119 TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-46 TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-47 +TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-49 +TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-50 +TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-51 +TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-53 +TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-78 TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.patch-57 TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.patch-80 +TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.rewrite-58 TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.buckets.patch-101 TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.buckets.patch-122 +TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.buckets.setIamPolicy-240 TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.compose-35 TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.delete-37 TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.delete-38 TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.delete-68 +TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-118 +TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-119 TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-46 TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-47 +TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-49 +TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-50 +TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-51 +TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-53 +TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-78 TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.patch-57 TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.patch-80 +TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.rewrite-58 TestRetryConformance/3-[return-503]-storage.buckets.patch-17 +TestRetryConformance/3-[return-503]-storage.buckets.patch-243 TestRetryConformance/3-[return-503]-storage.buckets.setIamPolicy-18 TestRetryConformance/3-[return-503]-storage.hmacKey.update-29 TestRetryConformance/3-[return-503]-storage.objects.compose-241 @@ -189,9 +214,15 @@ TestRetryConformance/3-[return-503]-storage.objects.insert-114 TestRetryConformance/3-[return-503]-storage.objects.insert-115 TestRetryConformance/3-[return-503]-storage.objects.insert-116 TestRetryConformance/3-[return-503]-storage.objects.insert-117 +TestRetryConformance/3-[return-503]-storage.objects.insert-120 +TestRetryConformance/3-[return-503]-storage.objects.insert-121 +TestRetryConformance/3-[return-503]-storage.objects.insert-48 +TestRetryConformance/3-[return-503]-storage.objects.insert-52 +TestRetryConformance/3-[return-503]-storage.objects.insert-54 +TestRetryConformance/3-[return-503]-storage.objects.insert-77 TestRetryConformance/3-[return-503]-storage.objects.patch-56 TestRetryConformance/3-[return-503]-storage.objects.patch-79 -TestRetryConformance/3-[return-503]-storage.objects.rewrite-58 +TestRetryConformance/3-[return-503]-storage.objects.rewrite-242 TestRetryConformance/3-[return-503]-storage.objects.rewrite-81 TestRetryConformance/3-[return-503]-storage.objects.rewrite-82 TestRetryConformance/3-[return-503]-storage.objects.rewrite-83 @@ -199,6 +230,7 @@ TestRetryConformance/3-[return-503]-storage.objects.rewrite-84 TestRetryConformance/3-[return-503]-storage.objects.rewrite-85 TestRetryConformance/3-[return-503]-storage.objects.rewrite-86 TestRetryConformance/3-[return-reset-connection]-storage.buckets.patch-17 +TestRetryConformance/3-[return-reset-connection]-storage.buckets.patch-243 TestRetryConformance/3-[return-reset-connection]-storage.buckets.setIamPolicy-18 TestRetryConformance/3-[return-reset-connection]-storage.hmacKey.update-29 TestRetryConformance/3-[return-reset-connection]-storage.objects.compose-241 @@ -212,9 +244,15 @@ TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-114 TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-115 TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-116 TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-117 +TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-120 +TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-121 +TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-48 +TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-52 +TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-54 +TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-77 TestRetryConformance/3-[return-reset-connection]-storage.objects.patch-56 TestRetryConformance/3-[return-reset-connection]-storage.objects.patch-79 -TestRetryConformance/3-[return-reset-connection]-storage.objects.rewrite-58 +TestRetryConformance/3-[return-reset-connection]-storage.objects.rewrite-242 TestRetryConformance/3-[return-reset-connection]-storage.objects.rewrite-81 TestRetryConformance/3-[return-reset-connection]-storage.objects.rewrite-82 TestRetryConformance/3-[return-reset-connection]-storage.objects.rewrite-83 @@ -281,8 +319,8 @@ TestRetryConformance/5-[return-400]-storage.buckets.get-96 TestRetryConformance/5-[return-400]-storage.buckets.getIamPolicy-13 TestRetryConformance/5-[return-400]-storage.buckets.insert-14 TestRetryConformance/5-[return-400]-storage.buckets.list-15 -TestRetryConformance/5-[return-400]-storage.buckets.patch-101 TestRetryConformance/5-[return-400]-storage.buckets.patch-17 +TestRetryConformance/5-[return-400]-storage.buckets.patch-243 TestRetryConformance/5-[return-400]-storage.buckets.setIamPolicy-18 TestRetryConformance/5-[return-400]-storage.buckets.testIamPermissions-19 TestRetryConformance/5-[return-400]-storage.default_object_acl.delete-102 @@ -314,7 +352,6 @@ TestRetryConformance/5-[return-400]-storage.objects.compose-241 TestRetryConformance/5-[return-400]-storage.objects.delete-36 TestRetryConformance/5-[return-400]-storage.objects.delete-67 TestRetryConformance/5-[return-400]-storage.objects.get-107 -TestRetryConformance/5-[return-400]-storage.objects.get-239 TestRetryConformance/5-[return-400]-storage.objects.get-39 TestRetryConformance/5-[return-400]-storage.objects.get-40 TestRetryConformance/5-[return-400]-storage.objects.get-41 @@ -341,10 +378,16 @@ TestRetryConformance/5-[return-400]-storage.objects.insert-114 TestRetryConformance/5-[return-400]-storage.objects.insert-115 TestRetryConformance/5-[return-400]-storage.objects.insert-116 TestRetryConformance/5-[return-400]-storage.objects.insert-117 +TestRetryConformance/5-[return-400]-storage.objects.insert-120 +TestRetryConformance/5-[return-400]-storage.objects.insert-121 +TestRetryConformance/5-[return-400]-storage.objects.insert-48 +TestRetryConformance/5-[return-400]-storage.objects.insert-52 +TestRetryConformance/5-[return-400]-storage.objects.insert-54 +TestRetryConformance/5-[return-400]-storage.objects.insert-77 TestRetryConformance/5-[return-400]-storage.objects.list-55 TestRetryConformance/5-[return-400]-storage.objects.patch-56 TestRetryConformance/5-[return-400]-storage.objects.patch-79 -TestRetryConformance/5-[return-400]-storage.objects.rewrite-58 +TestRetryConformance/5-[return-400]-storage.objects.rewrite-242 TestRetryConformance/5-[return-400]-storage.objects.rewrite-81 TestRetryConformance/5-[return-400]-storage.objects.rewrite-82 TestRetryConformance/5-[return-400]-storage.objects.rewrite-83 @@ -375,8 +418,8 @@ TestRetryConformance/5-[return-401]-storage.buckets.get-96 TestRetryConformance/5-[return-401]-storage.buckets.getIamPolicy-13 TestRetryConformance/5-[return-401]-storage.buckets.insert-14 TestRetryConformance/5-[return-401]-storage.buckets.list-15 -TestRetryConformance/5-[return-401]-storage.buckets.patch-101 TestRetryConformance/5-[return-401]-storage.buckets.patch-17 +TestRetryConformance/5-[return-401]-storage.buckets.patch-243 TestRetryConformance/5-[return-401]-storage.buckets.setIamPolicy-18 TestRetryConformance/5-[return-401]-storage.buckets.testIamPermissions-19 TestRetryConformance/5-[return-401]-storage.default_object_acl.delete-102 @@ -408,7 +451,6 @@ TestRetryConformance/5-[return-401]-storage.objects.compose-241 TestRetryConformance/5-[return-401]-storage.objects.delete-36 TestRetryConformance/5-[return-401]-storage.objects.delete-67 TestRetryConformance/5-[return-401]-storage.objects.get-107 -TestRetryConformance/5-[return-401]-storage.objects.get-239 TestRetryConformance/5-[return-401]-storage.objects.get-39 TestRetryConformance/5-[return-401]-storage.objects.get-40 TestRetryConformance/5-[return-401]-storage.objects.get-41 @@ -435,10 +477,16 @@ TestRetryConformance/5-[return-401]-storage.objects.insert-114 TestRetryConformance/5-[return-401]-storage.objects.insert-115 TestRetryConformance/5-[return-401]-storage.objects.insert-116 TestRetryConformance/5-[return-401]-storage.objects.insert-117 +TestRetryConformance/5-[return-401]-storage.objects.insert-120 +TestRetryConformance/5-[return-401]-storage.objects.insert-121 +TestRetryConformance/5-[return-401]-storage.objects.insert-48 +TestRetryConformance/5-[return-401]-storage.objects.insert-52 +TestRetryConformance/5-[return-401]-storage.objects.insert-54 +TestRetryConformance/5-[return-401]-storage.objects.insert-77 TestRetryConformance/5-[return-401]-storage.objects.list-55 TestRetryConformance/5-[return-401]-storage.objects.patch-56 TestRetryConformance/5-[return-401]-storage.objects.patch-79 -TestRetryConformance/5-[return-401]-storage.objects.rewrite-58 +TestRetryConformance/5-[return-401]-storage.objects.rewrite-242 TestRetryConformance/5-[return-401]-storage.objects.rewrite-81 TestRetryConformance/5-[return-401]-storage.objects.rewrite-82 TestRetryConformance/5-[return-401]-storage.objects.rewrite-83 @@ -461,6 +509,7 @@ TestRetryConformance/6-[return-503_return-400]-storage.buckets.get-97 TestRetryConformance/6-[return-503_return-400]-storage.buckets.getIamPolicy-13 TestRetryConformance/6-[return-503_return-400]-storage.buckets.list-15 TestRetryConformance/6-[return-503_return-400]-storage.buckets.lockRetentionPolicy-100 +TestRetryConformance/6-[return-503_return-400]-storage.buckets.lockRetentionPolicy-16 TestRetryConformance/6-[return-503_return-400]-storage.buckets.patch-101 TestRetryConformance/6-[return-503_return-400]-storage.buckets.patch-122 TestRetryConformance/6-[return-503_return-400]-storage.buckets.setIamPolicy-240 @@ -480,7 +529,7 @@ TestRetryConformance/6-[return-503_return-400]-storage.objects.compose-35 TestRetryConformance/6-[return-503_return-400]-storage.objects.delete-37 TestRetryConformance/6-[return-503_return-400]-storage.objects.delete-38 TestRetryConformance/6-[return-503_return-400]-storage.objects.delete-68 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-39 +TestRetryConformance/6-[return-503_return-400]-storage.objects.get-239 TestRetryConformance/6-[return-503_return-400]-storage.objects.get-40 TestRetryConformance/6-[return-503_return-400]-storage.objects.get-41 TestRetryConformance/6-[return-503_return-400]-storage.objects.get-42 @@ -500,9 +549,15 @@ TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-118 TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-119 TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-46 TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-47 +TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-49 +TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-50 +TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-51 +TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-53 +TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-78 TestRetryConformance/6-[return-503_return-400]-storage.objects.list-55 TestRetryConformance/6-[return-503_return-400]-storage.objects.patch-57 TestRetryConformance/6-[return-503_return-400]-storage.objects.patch-80 +TestRetryConformance/6-[return-503_return-400]-storage.objects.rewrite-58 TestRetryConformance/6-[return-503_return-400]-storage.serviceaccount.get-59 TestRetryConformance/6-[return-reset-connection_return-401]-storage.bucket_acl.get-3 TestRetryConformance/6-[return-reset-connection_return-401]-storage.bucket_acl.get-4 @@ -519,6 +574,7 @@ TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.get- TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.getIamPolicy-13 TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.list-15 TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.lockRetentionPolicy-100 +TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.lockRetentionPolicy-16 TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.patch-101 TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.patch-122 TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.setIamPolicy-240 @@ -538,7 +594,7 @@ TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.comp TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.delete-37 TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.delete-38 TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.delete-68 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-39 +TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-239 TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-40 TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-41 TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-42 @@ -562,7 +618,9 @@ TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.inse TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.insert-50 TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.insert-51 TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.insert-53 +TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.insert-78 TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.list-55 TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.patch-57 TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.patch-80 +TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.rewrite-58 TestRetryConformance/6-[return-reset-connection_return-401]-storage.serviceaccount.get-59 From 7c3640c6584dfc12b51d06cf4383036a252fb022 Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Tue, 12 Oct 2021 18:53:03 -0400 Subject: [PATCH 24/28] test(retry): invert GracefulConformanceEnforcement to be allow list (#1103) Now that the retry conformance test suite is mostly passing we want to assume passing and allow for the occasional failure rather than expecting failure and disallowing selective failures. --- .../retry/GracefulConformanceEnforcement.java | 19 +- .../retry/testNamesWhichCanFail.txt | 16 + .../retry/testNamesWhichShouldSucceed.txt | 626 ------------------ 3 files changed, 25 insertions(+), 636 deletions(-) create mode 100644 google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichCanFail.txt delete mode 100644 google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichShouldSucceed.txt diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/GracefulConformanceEnforcement.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/GracefulConformanceEnforcement.java index b8929476d..7d792c423 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/GracefulConformanceEnforcement.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/GracefulConformanceEnforcement.java @@ -36,18 +36,18 @@ * *

This class provides a transparent means of enforcing the reporting of failed tests when ran in * a CI environment. When a test is run, if it fails for any reason the test name will be checked - * against a list of known complying tests. If the tests name is missing from the known list, then - * the failure will be wrapped in an assumption failure to show up as a skipped test rather than a - * failed one. + * against an allow list of known failing tests. If the tests name is present in the allow list, + * then the failure will be wrapped in an assumption failure to show up as a skipped test rather + * than a failed one. */ final class GracefulConformanceEnforcement implements TestRule { private final String testName; - private final Set testNamesWhichShouldSucceed; + private final Set testNamesWhichCanFail; public GracefulConformanceEnforcement(String testName) { this.testName = testName; - this.testNamesWhichShouldSucceed = loadTestNamesWhichShouldSucceed(); + this.testNamesWhichCanFail = loadTestNamesWhichCanFail(); } @Override @@ -61,14 +61,13 @@ public void evaluate() throws Throwable { // pass through any assumption/ignore errors as they are throw e; } catch (Throwable t) { - if (testNamesWhichShouldSucceed.contains(testName)) { + if (!testNamesWhichCanFail.contains(testName)) { throw t; } else { if (isRunningInCI()) { throw new AssumptionViolatedException( String.format( - "Test %s is not expected to succeed yet, downgrading failure to ignored.", - testName), + "Test %s is allowed to fail, downgrading failure to ignored.", testName), t); } else { throw t; @@ -84,11 +83,11 @@ private static boolean isRunningInCI() { || "integration".equals(System.getenv("JOB_TYPE")); } - private static Set loadTestNamesWhichShouldSucceed() { + private static Set loadTestNamesWhichCanFail() { ClassLoader cl = Thread.currentThread().getContextClassLoader(); InputStream inputStream = cl.getResourceAsStream( - "com/google/cloud/storage/conformance/retry/testNamesWhichShouldSucceed.txt"); + "com/google/cloud/storage/conformance/retry/testNamesWhichCanFail.txt"); assertNotNull(inputStream); try { return CharStreams.readLines(new InputStreamReader(inputStream)).stream() diff --git a/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichCanFail.txt b/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichCanFail.txt new file mode 100644 index 000000000..683f4c094 --- /dev/null +++ b/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichCanFail.txt @@ -0,0 +1,16 @@ +# Each line should be a full test name +# Each test name present in the file will be expected to pass in a CI environment +# +# This list can be regenerated by running the following command in a shell: +# mvn -Penable-integration-test clean verify && xq '//testsuite/testcase[./error or ./failure]/@name' google-cloud-storage/target/failsafe-reports/TEST-com.google.cloud.storage.conformance.retry.ITRetryConformanceTest-sponge_log.xml | tail -n+2 | head -n-1 | sed 's# test\[##g' | sed 's#\]##g' | sort | tee -a google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichCanFail.txt +# where xq is the package from https://github.com/jeffbr13/xq + +TestRetryConformance/3-[return-reset-connection]-storage.objects.delete-36 +TestRetryConformance/3-[return-reset-connection]-storage.objects.delete-67 +TestRetryConformance/4-[return-reset-connection]-storage.bucket_acl.delete-1 +TestRetryConformance/4-[return-reset-connection]-storage.bucket_acl.delete-2 +TestRetryConformance/4-[return-reset-connection]-storage.bucket_acl.delete-87 +TestRetryConformance/4-[return-reset-connection]-storage.default_object_acl.delete-102 +TestRetryConformance/4-[return-reset-connection]-storage.default_object_acl.delete-20 +TestRetryConformance/4-[return-reset-connection]-storage.object_acl.delete-30 +TestRetryConformance/4-[return-reset-connection]-storage.object_acl.delete-62 diff --git a/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichShouldSucceed.txt b/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichShouldSucceed.txt deleted file mode 100644 index 8e4cfbd53..000000000 --- a/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichShouldSucceed.txt +++ /dev/null @@ -1,626 +0,0 @@ -# Each line should be a full test name -# Each test name present in the file will be expected to pass in a CI environment -# -# This list can be regenerated by running the following command in a shell: -# mvn -Penable-integration-test clean verify && xq '//testsuite/testcase[not(./error) and not(./failure) and not(./skipped)]/@name' google-cloud-storage/target/failsafe-reports/TEST-com.google.cloud.storage.conformance.retry.ITRetryConformanceTest-sponge_log.xml | tail -n+2 | head -n-1 | sed 's# test\[##g' | sed 's#\]##g' | sort | tee -a google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichShouldSucceed.txt -# where xq is the package from https://github.com/jeffbr13/xq - -TestRetryConformance/1-[return-503_return-503]-storage.bucket_acl.get-3 -TestRetryConformance/1-[return-503_return-503]-storage.bucket_acl.get-4 -TestRetryConformance/1-[return-503_return-503]-storage.bucket_acl.get-88 -TestRetryConformance/1-[return-503_return-503]-storage.bucket_acl.list-7 -TestRetryConformance/1-[return-503_return-503]-storage.bucket_acl.list-8 -TestRetryConformance/1-[return-503_return-503]-storage.bucket_acl.list-90 -TestRetryConformance/1-[return-503_return-503]-storage.buckets.delete-11 -TestRetryConformance/1-[return-503_return-503]-storage.buckets.delete-92 -TestRetryConformance/1-[return-503_return-503]-storage.buckets.get-12 -TestRetryConformance/1-[return-503_return-503]-storage.buckets.get-94 -TestRetryConformance/1-[return-503_return-503]-storage.buckets.get-96 -TestRetryConformance/1-[return-503_return-503]-storage.buckets.getIamPolicy-13 -TestRetryConformance/1-[return-503_return-503]-storage.buckets.insert-14 -TestRetryConformance/1-[return-503_return-503]-storage.buckets.list-15 -TestRetryConformance/1-[return-503_return-503]-storage.buckets.testIamPermissions-19 -TestRetryConformance/1-[return-503_return-503]-storage.default_object_acl.get-103 -TestRetryConformance/1-[return-503_return-503]-storage.default_object_acl.get-21 -TestRetryConformance/1-[return-503_return-503]-storage.default_object_acl.list-105 -TestRetryConformance/1-[return-503_return-503]-storage.default_object_acl.list-23 -TestRetryConformance/1-[return-503_return-503]-storage.hmacKey.delete-26 -TestRetryConformance/1-[return-503_return-503]-storage.hmacKey.get-27 -TestRetryConformance/1-[return-503_return-503]-storage.hmacKey.list-28 -TestRetryConformance/1-[return-503_return-503]-storage.object_acl.get-31 -TestRetryConformance/1-[return-503_return-503]-storage.object_acl.get-63 -TestRetryConformance/1-[return-503_return-503]-storage.object_acl.list-33 -TestRetryConformance/1-[return-503_return-503]-storage.object_acl.list-65 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-107 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-39 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-40 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-41 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-42 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-43 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-44 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-45 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-60 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-69 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-70 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-71 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-72 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-73 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-74 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-75 -TestRetryConformance/1-[return-503_return-503]-storage.objects.get-76 -TestRetryConformance/1-[return-503_return-503]-storage.objects.list-55 -TestRetryConformance/1-[return-503_return-503]-storage.serviceaccount.get-59 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.bucket_acl.get-3 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.bucket_acl.get-4 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.bucket_acl.get-88 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.bucket_acl.list-7 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.bucket_acl.list-8 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.bucket_acl.list-90 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.delete-11 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.delete-92 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.get-12 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.get-94 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.get-96 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.getIamPolicy-13 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.insert-14 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.list-15 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.buckets.testIamPermissions-19 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.default_object_acl.get-103 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.default_object_acl.get-21 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.default_object_acl.list-105 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.default_object_acl.list-23 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.hmacKey.delete-26 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.hmacKey.get-27 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.hmacKey.list-28 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.object_acl.get-31 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.object_acl.get-63 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.object_acl.list-33 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.object_acl.list-65 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-107 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-39 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-40 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-41 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-42 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-43 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-44 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-45 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-60 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-69 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-70 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-71 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-72 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-73 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-74 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-75 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.get-76 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.objects.list-55 -TestRetryConformance/1-[return-reset-connection_return-503]-storage.serviceaccount.get-59 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.bucket_acl.get-3 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.bucket_acl.get-4 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.bucket_acl.get-88 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.bucket_acl.list-7 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.bucket_acl.list-8 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.bucket_acl.list-90 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.buckets.delete-11 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.buckets.delete-92 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.buckets.get-12 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.buckets.get-94 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.buckets.get-96 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.buckets.getIamPolicy-13 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.buckets.insert-14 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.buckets.list-15 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.buckets.testIamPermissions-19 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.default_object_acl.get-103 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.default_object_acl.get-21 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.default_object_acl.list-105 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.default_object_acl.list-23 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.hmacKey.delete-26 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.hmacKey.get-27 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.hmacKey.list-28 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.object_acl.get-31 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.object_acl.get-63 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.object_acl.list-33 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.object_acl.list-65 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-107 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-39 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-40 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-41 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-42 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-43 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-44 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-45 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-60 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-69 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-70 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-71 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-72 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-73 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-74 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-75 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.get-76 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.objects.list-55 -TestRetryConformance/1-[return-reset-connection_return-reset-connection]-storage.serviceaccount.get-59 -TestRetryConformance/2-[return-503_return-503]-storage.buckets.patch-101 -TestRetryConformance/2-[return-503_return-503]-storage.buckets.patch-122 -TestRetryConformance/2-[return-503_return-503]-storage.buckets.setIamPolicy-240 -TestRetryConformance/2-[return-503_return-503]-storage.objects.compose-35 -TestRetryConformance/2-[return-503_return-503]-storage.objects.delete-37 -TestRetryConformance/2-[return-503_return-503]-storage.objects.delete-38 -TestRetryConformance/2-[return-503_return-503]-storage.objects.delete-68 -TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-118 -TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-119 -TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-46 -TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-47 -TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-49 -TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-50 -TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-51 -TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-53 -TestRetryConformance/2-[return-503_return-503]-storage.objects.insert-78 -TestRetryConformance/2-[return-503_return-503]-storage.objects.patch-57 -TestRetryConformance/2-[return-503_return-503]-storage.objects.patch-80 -TestRetryConformance/2-[return-503_return-503]-storage.objects.rewrite-58 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.buckets.patch-101 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.buckets.patch-122 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.buckets.setIamPolicy-240 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.compose-35 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.delete-37 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.delete-38 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.delete-68 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-118 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-119 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-46 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-47 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-49 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-50 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-51 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-53 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.insert-78 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.patch-57 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.patch-80 -TestRetryConformance/2-[return-reset-connection_return-503]-storage.objects.rewrite-58 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.buckets.patch-101 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.buckets.patch-122 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.buckets.setIamPolicy-240 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.compose-35 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.delete-37 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.delete-38 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.delete-68 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-118 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-119 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-46 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-47 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-49 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-50 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-51 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-53 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.insert-78 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.patch-57 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.patch-80 -TestRetryConformance/2-[return-reset-connection_return-reset-connection]-storage.objects.rewrite-58 -TestRetryConformance/3-[return-503]-storage.buckets.patch-17 -TestRetryConformance/3-[return-503]-storage.buckets.patch-243 -TestRetryConformance/3-[return-503]-storage.buckets.setIamPolicy-18 -TestRetryConformance/3-[return-503]-storage.hmacKey.update-29 -TestRetryConformance/3-[return-503]-storage.objects.compose-241 -TestRetryConformance/3-[return-503]-storage.objects.delete-36 -TestRetryConformance/3-[return-503]-storage.objects.delete-67 -TestRetryConformance/3-[return-503]-storage.objects.insert-108 -TestRetryConformance/3-[return-503]-storage.objects.insert-109 -TestRetryConformance/3-[return-503]-storage.objects.insert-110 -TestRetryConformance/3-[return-503]-storage.objects.insert-111 -TestRetryConformance/3-[return-503]-storage.objects.insert-112 -TestRetryConformance/3-[return-503]-storage.objects.insert-113 -TestRetryConformance/3-[return-503]-storage.objects.insert-114 -TestRetryConformance/3-[return-503]-storage.objects.insert-115 -TestRetryConformance/3-[return-503]-storage.objects.insert-116 -TestRetryConformance/3-[return-503]-storage.objects.insert-117 -TestRetryConformance/3-[return-503]-storage.objects.insert-120 -TestRetryConformance/3-[return-503]-storage.objects.insert-121 -TestRetryConformance/3-[return-503]-storage.objects.insert-48 -TestRetryConformance/3-[return-503]-storage.objects.insert-52 -TestRetryConformance/3-[return-503]-storage.objects.insert-54 -TestRetryConformance/3-[return-503]-storage.objects.insert-77 -TestRetryConformance/3-[return-503]-storage.objects.patch-56 -TestRetryConformance/3-[return-503]-storage.objects.patch-79 -TestRetryConformance/3-[return-503]-storage.objects.rewrite-242 -TestRetryConformance/3-[return-503]-storage.objects.rewrite-81 -TestRetryConformance/3-[return-503]-storage.objects.rewrite-82 -TestRetryConformance/3-[return-503]-storage.objects.rewrite-83 -TestRetryConformance/3-[return-503]-storage.objects.rewrite-84 -TestRetryConformance/3-[return-503]-storage.objects.rewrite-85 -TestRetryConformance/3-[return-503]-storage.objects.rewrite-86 -TestRetryConformance/3-[return-reset-connection]-storage.buckets.patch-17 -TestRetryConformance/3-[return-reset-connection]-storage.buckets.patch-243 -TestRetryConformance/3-[return-reset-connection]-storage.buckets.setIamPolicy-18 -TestRetryConformance/3-[return-reset-connection]-storage.hmacKey.update-29 -TestRetryConformance/3-[return-reset-connection]-storage.objects.compose-241 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-108 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-109 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-110 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-111 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-112 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-113 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-114 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-115 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-116 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-117 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-120 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-121 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-48 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-52 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-54 -TestRetryConformance/3-[return-reset-connection]-storage.objects.insert-77 -TestRetryConformance/3-[return-reset-connection]-storage.objects.patch-56 -TestRetryConformance/3-[return-reset-connection]-storage.objects.patch-79 -TestRetryConformance/3-[return-reset-connection]-storage.objects.rewrite-242 -TestRetryConformance/3-[return-reset-connection]-storage.objects.rewrite-81 -TestRetryConformance/3-[return-reset-connection]-storage.objects.rewrite-82 -TestRetryConformance/3-[return-reset-connection]-storage.objects.rewrite-83 -TestRetryConformance/3-[return-reset-connection]-storage.objects.rewrite-84 -TestRetryConformance/3-[return-reset-connection]-storage.objects.rewrite-85 -TestRetryConformance/3-[return-reset-connection]-storage.objects.rewrite-86 -TestRetryConformance/4-[return-503]-storage.bucket_acl.delete-1 -TestRetryConformance/4-[return-503]-storage.bucket_acl.delete-2 -TestRetryConformance/4-[return-503]-storage.bucket_acl.delete-87 -TestRetryConformance/4-[return-503]-storage.bucket_acl.insert-5 -TestRetryConformance/4-[return-503]-storage.bucket_acl.insert-6 -TestRetryConformance/4-[return-503]-storage.bucket_acl.insert-89 -TestRetryConformance/4-[return-503]-storage.bucket_acl.patch-10 -TestRetryConformance/4-[return-503]-storage.bucket_acl.patch-9 -TestRetryConformance/4-[return-503]-storage.bucket_acl.patch-91 -TestRetryConformance/4-[return-503]-storage.default_object_acl.delete-102 -TestRetryConformance/4-[return-503]-storage.default_object_acl.delete-20 -TestRetryConformance/4-[return-503]-storage.default_object_acl.insert-104 -TestRetryConformance/4-[return-503]-storage.default_object_acl.insert-22 -TestRetryConformance/4-[return-503]-storage.default_object_acl.patch-106 -TestRetryConformance/4-[return-503]-storage.default_object_acl.patch-24 -TestRetryConformance/4-[return-503]-storage.hmacKey.create-25 -TestRetryConformance/4-[return-503]-storage.object_acl.delete-30 -TestRetryConformance/4-[return-503]-storage.object_acl.delete-62 -TestRetryConformance/4-[return-503]-storage.object_acl.insert-32 -TestRetryConformance/4-[return-503]-storage.object_acl.insert-64 -TestRetryConformance/4-[return-503]-storage.object_acl.patch-34 -TestRetryConformance/4-[return-503]-storage.object_acl.patch-66 -TestRetryConformance/4-[return-reset-connection]-storage.bucket_acl.insert-5 -TestRetryConformance/4-[return-reset-connection]-storage.bucket_acl.insert-6 -TestRetryConformance/4-[return-reset-connection]-storage.bucket_acl.insert-89 -TestRetryConformance/4-[return-reset-connection]-storage.bucket_acl.patch-10 -TestRetryConformance/4-[return-reset-connection]-storage.bucket_acl.patch-9 -TestRetryConformance/4-[return-reset-connection]-storage.bucket_acl.patch-91 -TestRetryConformance/4-[return-reset-connection]-storage.default_object_acl.insert-104 -TestRetryConformance/4-[return-reset-connection]-storage.default_object_acl.insert-22 -TestRetryConformance/4-[return-reset-connection]-storage.default_object_acl.patch-106 -TestRetryConformance/4-[return-reset-connection]-storage.default_object_acl.patch-24 -TestRetryConformance/4-[return-reset-connection]-storage.hmacKey.create-25 -TestRetryConformance/4-[return-reset-connection]-storage.object_acl.insert-32 -TestRetryConformance/4-[return-reset-connection]-storage.object_acl.insert-64 -TestRetryConformance/4-[return-reset-connection]-storage.object_acl.patch-34 -TestRetryConformance/4-[return-reset-connection]-storage.object_acl.patch-66 -TestRetryConformance/5-[return-400]-storage.bucket_acl.delete-1 -TestRetryConformance/5-[return-400]-storage.bucket_acl.delete-2 -TestRetryConformance/5-[return-400]-storage.bucket_acl.delete-87 -TestRetryConformance/5-[return-400]-storage.bucket_acl.get-3 -TestRetryConformance/5-[return-400]-storage.bucket_acl.get-4 -TestRetryConformance/5-[return-400]-storage.bucket_acl.get-88 -TestRetryConformance/5-[return-400]-storage.bucket_acl.insert-5 -TestRetryConformance/5-[return-400]-storage.bucket_acl.insert-6 -TestRetryConformance/5-[return-400]-storage.bucket_acl.insert-89 -TestRetryConformance/5-[return-400]-storage.bucket_acl.list-7 -TestRetryConformance/5-[return-400]-storage.bucket_acl.list-8 -TestRetryConformance/5-[return-400]-storage.bucket_acl.list-90 -TestRetryConformance/5-[return-400]-storage.bucket_acl.patch-10 -TestRetryConformance/5-[return-400]-storage.bucket_acl.patch-9 -TestRetryConformance/5-[return-400]-storage.bucket_acl.patch-91 -TestRetryConformance/5-[return-400]-storage.buckets.delete-11 -TestRetryConformance/5-[return-400]-storage.buckets.delete-92 -TestRetryConformance/5-[return-400]-storage.buckets.get-12 -TestRetryConformance/5-[return-400]-storage.buckets.get-94 -TestRetryConformance/5-[return-400]-storage.buckets.get-96 -TestRetryConformance/5-[return-400]-storage.buckets.getIamPolicy-13 -TestRetryConformance/5-[return-400]-storage.buckets.insert-14 -TestRetryConformance/5-[return-400]-storage.buckets.list-15 -TestRetryConformance/5-[return-400]-storage.buckets.patch-17 -TestRetryConformance/5-[return-400]-storage.buckets.patch-243 -TestRetryConformance/5-[return-400]-storage.buckets.setIamPolicy-18 -TestRetryConformance/5-[return-400]-storage.buckets.testIamPermissions-19 -TestRetryConformance/5-[return-400]-storage.default_object_acl.delete-102 -TestRetryConformance/5-[return-400]-storage.default_object_acl.delete-20 -TestRetryConformance/5-[return-400]-storage.default_object_acl.get-103 -TestRetryConformance/5-[return-400]-storage.default_object_acl.get-21 -TestRetryConformance/5-[return-400]-storage.default_object_acl.insert-104 -TestRetryConformance/5-[return-400]-storage.default_object_acl.insert-22 -TestRetryConformance/5-[return-400]-storage.default_object_acl.list-105 -TestRetryConformance/5-[return-400]-storage.default_object_acl.list-23 -TestRetryConformance/5-[return-400]-storage.default_object_acl.patch-106 -TestRetryConformance/5-[return-400]-storage.default_object_acl.patch-24 -TestRetryConformance/5-[return-400]-storage.hmacKey.create-25 -TestRetryConformance/5-[return-400]-storage.hmacKey.delete-26 -TestRetryConformance/5-[return-400]-storage.hmacKey.get-27 -TestRetryConformance/5-[return-400]-storage.hmacKey.list-28 -TestRetryConformance/5-[return-400]-storage.hmacKey.update-29 -TestRetryConformance/5-[return-400]-storage.object_acl.delete-30 -TestRetryConformance/5-[return-400]-storage.object_acl.delete-62 -TestRetryConformance/5-[return-400]-storage.object_acl.get-31 -TestRetryConformance/5-[return-400]-storage.object_acl.get-63 -TestRetryConformance/5-[return-400]-storage.object_acl.insert-32 -TestRetryConformance/5-[return-400]-storage.object_acl.insert-64 -TestRetryConformance/5-[return-400]-storage.object_acl.list-33 -TestRetryConformance/5-[return-400]-storage.object_acl.list-65 -TestRetryConformance/5-[return-400]-storage.object_acl.patch-34 -TestRetryConformance/5-[return-400]-storage.object_acl.patch-66 -TestRetryConformance/5-[return-400]-storage.objects.compose-241 -TestRetryConformance/5-[return-400]-storage.objects.delete-36 -TestRetryConformance/5-[return-400]-storage.objects.delete-67 -TestRetryConformance/5-[return-400]-storage.objects.get-107 -TestRetryConformance/5-[return-400]-storage.objects.get-39 -TestRetryConformance/5-[return-400]-storage.objects.get-40 -TestRetryConformance/5-[return-400]-storage.objects.get-41 -TestRetryConformance/5-[return-400]-storage.objects.get-42 -TestRetryConformance/5-[return-400]-storage.objects.get-43 -TestRetryConformance/5-[return-400]-storage.objects.get-44 -TestRetryConformance/5-[return-400]-storage.objects.get-45 -TestRetryConformance/5-[return-400]-storage.objects.get-60 -TestRetryConformance/5-[return-400]-storage.objects.get-69 -TestRetryConformance/5-[return-400]-storage.objects.get-70 -TestRetryConformance/5-[return-400]-storage.objects.get-71 -TestRetryConformance/5-[return-400]-storage.objects.get-72 -TestRetryConformance/5-[return-400]-storage.objects.get-73 -TestRetryConformance/5-[return-400]-storage.objects.get-74 -TestRetryConformance/5-[return-400]-storage.objects.get-75 -TestRetryConformance/5-[return-400]-storage.objects.get-76 -TestRetryConformance/5-[return-400]-storage.objects.insert-108 -TestRetryConformance/5-[return-400]-storage.objects.insert-109 -TestRetryConformance/5-[return-400]-storage.objects.insert-110 -TestRetryConformance/5-[return-400]-storage.objects.insert-111 -TestRetryConformance/5-[return-400]-storage.objects.insert-112 -TestRetryConformance/5-[return-400]-storage.objects.insert-113 -TestRetryConformance/5-[return-400]-storage.objects.insert-114 -TestRetryConformance/5-[return-400]-storage.objects.insert-115 -TestRetryConformance/5-[return-400]-storage.objects.insert-116 -TestRetryConformance/5-[return-400]-storage.objects.insert-117 -TestRetryConformance/5-[return-400]-storage.objects.insert-120 -TestRetryConformance/5-[return-400]-storage.objects.insert-121 -TestRetryConformance/5-[return-400]-storage.objects.insert-48 -TestRetryConformance/5-[return-400]-storage.objects.insert-52 -TestRetryConformance/5-[return-400]-storage.objects.insert-54 -TestRetryConformance/5-[return-400]-storage.objects.insert-77 -TestRetryConformance/5-[return-400]-storage.objects.list-55 -TestRetryConformance/5-[return-400]-storage.objects.patch-56 -TestRetryConformance/5-[return-400]-storage.objects.patch-79 -TestRetryConformance/5-[return-400]-storage.objects.rewrite-242 -TestRetryConformance/5-[return-400]-storage.objects.rewrite-81 -TestRetryConformance/5-[return-400]-storage.objects.rewrite-82 -TestRetryConformance/5-[return-400]-storage.objects.rewrite-83 -TestRetryConformance/5-[return-400]-storage.objects.rewrite-84 -TestRetryConformance/5-[return-400]-storage.objects.rewrite-85 -TestRetryConformance/5-[return-400]-storage.objects.rewrite-86 -TestRetryConformance/5-[return-400]-storage.serviceaccount.get-59 -TestRetryConformance/5-[return-401]-storage.bucket_acl.delete-1 -TestRetryConformance/5-[return-401]-storage.bucket_acl.delete-2 -TestRetryConformance/5-[return-401]-storage.bucket_acl.delete-87 -TestRetryConformance/5-[return-401]-storage.bucket_acl.get-3 -TestRetryConformance/5-[return-401]-storage.bucket_acl.get-4 -TestRetryConformance/5-[return-401]-storage.bucket_acl.get-88 -TestRetryConformance/5-[return-401]-storage.bucket_acl.insert-5 -TestRetryConformance/5-[return-401]-storage.bucket_acl.insert-6 -TestRetryConformance/5-[return-401]-storage.bucket_acl.insert-89 -TestRetryConformance/5-[return-401]-storage.bucket_acl.list-7 -TestRetryConformance/5-[return-401]-storage.bucket_acl.list-8 -TestRetryConformance/5-[return-401]-storage.bucket_acl.list-90 -TestRetryConformance/5-[return-401]-storage.bucket_acl.patch-10 -TestRetryConformance/5-[return-401]-storage.bucket_acl.patch-9 -TestRetryConformance/5-[return-401]-storage.bucket_acl.patch-91 -TestRetryConformance/5-[return-401]-storage.buckets.delete-11 -TestRetryConformance/5-[return-401]-storage.buckets.delete-92 -TestRetryConformance/5-[return-401]-storage.buckets.get-12 -TestRetryConformance/5-[return-401]-storage.buckets.get-94 -TestRetryConformance/5-[return-401]-storage.buckets.get-96 -TestRetryConformance/5-[return-401]-storage.buckets.getIamPolicy-13 -TestRetryConformance/5-[return-401]-storage.buckets.insert-14 -TestRetryConformance/5-[return-401]-storage.buckets.list-15 -TestRetryConformance/5-[return-401]-storage.buckets.patch-17 -TestRetryConformance/5-[return-401]-storage.buckets.patch-243 -TestRetryConformance/5-[return-401]-storage.buckets.setIamPolicy-18 -TestRetryConformance/5-[return-401]-storage.buckets.testIamPermissions-19 -TestRetryConformance/5-[return-401]-storage.default_object_acl.delete-102 -TestRetryConformance/5-[return-401]-storage.default_object_acl.delete-20 -TestRetryConformance/5-[return-401]-storage.default_object_acl.get-103 -TestRetryConformance/5-[return-401]-storage.default_object_acl.get-21 -TestRetryConformance/5-[return-401]-storage.default_object_acl.insert-104 -TestRetryConformance/5-[return-401]-storage.default_object_acl.insert-22 -TestRetryConformance/5-[return-401]-storage.default_object_acl.list-105 -TestRetryConformance/5-[return-401]-storage.default_object_acl.list-23 -TestRetryConformance/5-[return-401]-storage.default_object_acl.patch-106 -TestRetryConformance/5-[return-401]-storage.default_object_acl.patch-24 -TestRetryConformance/5-[return-401]-storage.hmacKey.create-25 -TestRetryConformance/5-[return-401]-storage.hmacKey.delete-26 -TestRetryConformance/5-[return-401]-storage.hmacKey.get-27 -TestRetryConformance/5-[return-401]-storage.hmacKey.list-28 -TestRetryConformance/5-[return-401]-storage.hmacKey.update-29 -TestRetryConformance/5-[return-401]-storage.object_acl.delete-30 -TestRetryConformance/5-[return-401]-storage.object_acl.delete-62 -TestRetryConformance/5-[return-401]-storage.object_acl.get-31 -TestRetryConformance/5-[return-401]-storage.object_acl.get-63 -TestRetryConformance/5-[return-401]-storage.object_acl.insert-32 -TestRetryConformance/5-[return-401]-storage.object_acl.insert-64 -TestRetryConformance/5-[return-401]-storage.object_acl.list-33 -TestRetryConformance/5-[return-401]-storage.object_acl.list-65 -TestRetryConformance/5-[return-401]-storage.object_acl.patch-34 -TestRetryConformance/5-[return-401]-storage.object_acl.patch-66 -TestRetryConformance/5-[return-401]-storage.objects.compose-241 -TestRetryConformance/5-[return-401]-storage.objects.delete-36 -TestRetryConformance/5-[return-401]-storage.objects.delete-67 -TestRetryConformance/5-[return-401]-storage.objects.get-107 -TestRetryConformance/5-[return-401]-storage.objects.get-39 -TestRetryConformance/5-[return-401]-storage.objects.get-40 -TestRetryConformance/5-[return-401]-storage.objects.get-41 -TestRetryConformance/5-[return-401]-storage.objects.get-42 -TestRetryConformance/5-[return-401]-storage.objects.get-43 -TestRetryConformance/5-[return-401]-storage.objects.get-44 -TestRetryConformance/5-[return-401]-storage.objects.get-45 -TestRetryConformance/5-[return-401]-storage.objects.get-60 -TestRetryConformance/5-[return-401]-storage.objects.get-69 -TestRetryConformance/5-[return-401]-storage.objects.get-70 -TestRetryConformance/5-[return-401]-storage.objects.get-71 -TestRetryConformance/5-[return-401]-storage.objects.get-72 -TestRetryConformance/5-[return-401]-storage.objects.get-73 -TestRetryConformance/5-[return-401]-storage.objects.get-74 -TestRetryConformance/5-[return-401]-storage.objects.get-75 -TestRetryConformance/5-[return-401]-storage.objects.get-76 -TestRetryConformance/5-[return-401]-storage.objects.insert-108 -TestRetryConformance/5-[return-401]-storage.objects.insert-109 -TestRetryConformance/5-[return-401]-storage.objects.insert-110 -TestRetryConformance/5-[return-401]-storage.objects.insert-111 -TestRetryConformance/5-[return-401]-storage.objects.insert-112 -TestRetryConformance/5-[return-401]-storage.objects.insert-113 -TestRetryConformance/5-[return-401]-storage.objects.insert-114 -TestRetryConformance/5-[return-401]-storage.objects.insert-115 -TestRetryConformance/5-[return-401]-storage.objects.insert-116 -TestRetryConformance/5-[return-401]-storage.objects.insert-117 -TestRetryConformance/5-[return-401]-storage.objects.insert-120 -TestRetryConformance/5-[return-401]-storage.objects.insert-121 -TestRetryConformance/5-[return-401]-storage.objects.insert-48 -TestRetryConformance/5-[return-401]-storage.objects.insert-52 -TestRetryConformance/5-[return-401]-storage.objects.insert-54 -TestRetryConformance/5-[return-401]-storage.objects.insert-77 -TestRetryConformance/5-[return-401]-storage.objects.list-55 -TestRetryConformance/5-[return-401]-storage.objects.patch-56 -TestRetryConformance/5-[return-401]-storage.objects.patch-79 -TestRetryConformance/5-[return-401]-storage.objects.rewrite-242 -TestRetryConformance/5-[return-401]-storage.objects.rewrite-81 -TestRetryConformance/5-[return-401]-storage.objects.rewrite-82 -TestRetryConformance/5-[return-401]-storage.objects.rewrite-83 -TestRetryConformance/5-[return-401]-storage.objects.rewrite-84 -TestRetryConformance/5-[return-401]-storage.objects.rewrite-85 -TestRetryConformance/5-[return-401]-storage.objects.rewrite-86 -TestRetryConformance/5-[return-401]-storage.serviceaccount.get-59 -TestRetryConformance/6-[return-503_return-400]-storage.bucket_acl.get-3 -TestRetryConformance/6-[return-503_return-400]-storage.bucket_acl.get-4 -TestRetryConformance/6-[return-503_return-400]-storage.bucket_acl.get-88 -TestRetryConformance/6-[return-503_return-400]-storage.bucket_acl.list-7 -TestRetryConformance/6-[return-503_return-400]-storage.bucket_acl.list-8 -TestRetryConformance/6-[return-503_return-400]-storage.bucket_acl.list-90 -TestRetryConformance/6-[return-503_return-400]-storage.buckets.delete-11 -TestRetryConformance/6-[return-503_return-400]-storage.buckets.delete-92 -TestRetryConformance/6-[return-503_return-400]-storage.buckets.delete-93 -TestRetryConformance/6-[return-503_return-400]-storage.buckets.get-12 -TestRetryConformance/6-[return-503_return-400]-storage.buckets.get-95 -TestRetryConformance/6-[return-503_return-400]-storage.buckets.get-97 -TestRetryConformance/6-[return-503_return-400]-storage.buckets.getIamPolicy-13 -TestRetryConformance/6-[return-503_return-400]-storage.buckets.list-15 -TestRetryConformance/6-[return-503_return-400]-storage.buckets.lockRetentionPolicy-100 -TestRetryConformance/6-[return-503_return-400]-storage.buckets.lockRetentionPolicy-16 -TestRetryConformance/6-[return-503_return-400]-storage.buckets.patch-101 -TestRetryConformance/6-[return-503_return-400]-storage.buckets.patch-122 -TestRetryConformance/6-[return-503_return-400]-storage.buckets.setIamPolicy-240 -TestRetryConformance/6-[return-503_return-400]-storage.buckets.testIamPermissions-19 -TestRetryConformance/6-[return-503_return-400]-storage.default_object_acl.get-103 -TestRetryConformance/6-[return-503_return-400]-storage.default_object_acl.get-21 -TestRetryConformance/6-[return-503_return-400]-storage.default_object_acl.list-105 -TestRetryConformance/6-[return-503_return-400]-storage.default_object_acl.list-23 -TestRetryConformance/6-[return-503_return-400]-storage.hmacKey.delete-26 -TestRetryConformance/6-[return-503_return-400]-storage.hmacKey.get-27 -TestRetryConformance/6-[return-503_return-400]-storage.hmacKey.list-28 -TestRetryConformance/6-[return-503_return-400]-storage.object_acl.get-31 -TestRetryConformance/6-[return-503_return-400]-storage.object_acl.get-63 -TestRetryConformance/6-[return-503_return-400]-storage.object_acl.list-33 -TestRetryConformance/6-[return-503_return-400]-storage.object_acl.list-65 -TestRetryConformance/6-[return-503_return-400]-storage.objects.compose-35 -TestRetryConformance/6-[return-503_return-400]-storage.objects.delete-37 -TestRetryConformance/6-[return-503_return-400]-storage.objects.delete-38 -TestRetryConformance/6-[return-503_return-400]-storage.objects.delete-68 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-239 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-40 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-41 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-42 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-43 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-44 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-45 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-61 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-69 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-70 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-71 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-72 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-73 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-74 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-75 -TestRetryConformance/6-[return-503_return-400]-storage.objects.get-76 -TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-118 -TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-119 -TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-46 -TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-47 -TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-49 -TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-50 -TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-51 -TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-53 -TestRetryConformance/6-[return-503_return-400]-storage.objects.insert-78 -TestRetryConformance/6-[return-503_return-400]-storage.objects.list-55 -TestRetryConformance/6-[return-503_return-400]-storage.objects.patch-57 -TestRetryConformance/6-[return-503_return-400]-storage.objects.patch-80 -TestRetryConformance/6-[return-503_return-400]-storage.objects.rewrite-58 -TestRetryConformance/6-[return-503_return-400]-storage.serviceaccount.get-59 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.bucket_acl.get-3 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.bucket_acl.get-4 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.bucket_acl.get-88 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.bucket_acl.list-7 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.bucket_acl.list-8 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.bucket_acl.list-90 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.delete-11 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.delete-92 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.delete-93 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.get-12 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.get-95 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.get-97 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.getIamPolicy-13 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.list-15 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.lockRetentionPolicy-100 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.lockRetentionPolicy-16 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.patch-101 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.patch-122 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.setIamPolicy-240 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.buckets.testIamPermissions-19 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.default_object_acl.get-103 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.default_object_acl.get-21 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.default_object_acl.list-105 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.default_object_acl.list-23 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.hmacKey.delete-26 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.hmacKey.get-27 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.hmacKey.list-28 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.object_acl.get-31 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.object_acl.get-63 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.object_acl.list-33 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.object_acl.list-65 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.compose-35 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.delete-37 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.delete-38 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.delete-68 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-239 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-40 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-41 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-42 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-43 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-44 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-45 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-61 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-69 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-70 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-71 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-72 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-73 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-74 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-75 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.get-76 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.insert-118 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.insert-119 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.insert-46 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.insert-47 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.insert-49 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.insert-50 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.insert-51 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.insert-53 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.insert-78 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.list-55 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.patch-57 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.patch-80 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.objects.rewrite-58 -TestRetryConformance/6-[return-reset-connection_return-401]-storage.serviceaccount.get-59 From cdb86dcca17636ff7be59208361f8d42ab0858ba Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 13 Oct 2021 17:36:13 +0200 Subject: [PATCH 25/28] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.1.0 (#1104) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.0.3` -> `1.1.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.1.0/compatibility-slim/1.0.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.1.0/confidence-slim/1.0.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes

googleapis/java-shared-config ### [`v1.1.0`](https://togithub.com/googleapis/java-shared-config/blob/master/CHANGELOG.md#​110-httpswwwgithubcomgoogleapisjava-shared-configcomparev103v110-2021-10-12) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.0.3...v1.1.0) ##### Features - introduce Maven configuration for GraalVM testing ([#​314](https://www.togithub.com/googleapis/java-shared-config/issues/314)) ([28fbeb8](https://www.github.com/googleapis/java-shared-config/commit/28fbeb86c4466a58a05d6933584564dbf3352e79)) ##### Bug Fixes - update doclet version ([#​332](https://www.togithub.com/googleapis/java-shared-config/issues/332)) ([3fd0350](https://www.github.com/googleapis/java-shared-config/commit/3fd035030e4f0954dd1f62f7b8ea62583685880c)) ##### Dependencies - update dependency com.puppycrawl.tools:checkstyle to v9.0.1 ([#​327](https://www.togithub.com/googleapis/java-shared-config/issues/327)) ([b6c9b65](https://www.github.com/googleapis/java-shared-config/commit/b6c9b657550db2dee6b36edbb9a6084baee125e2)) - update dependency org.graalvm.buildtools:junit-platform-native to v0.9.6 ([#​330](https://www.togithub.com/googleapis/java-shared-config/issues/330)) ([271ed7d](https://www.github.com/googleapis/java-shared-config/commit/271ed7dba35623e22fc8a7f7d477e6043e772014)) - update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.6 ([#​331](https://www.togithub.com/googleapis/java-shared-config/issues/331)) ([4f9ba15](https://www.github.com/googleapis/java-shared-config/commit/4f9ba1551df0a2d4fc8c9acca8a951afbe8cb78a)) - update dependency org.junit.vintage:junit-vintage-engine to v5.8.1 ([#​329](https://www.togithub.com/googleapis/java-shared-config/issues/329)) ([4a8789e](https://www.github.com/googleapis/java-shared-config/commit/4a8789ee814ba8a3480beecc76c16fd1cb4e5f12)) ##### [1.0.3](https://www.github.com/googleapis/java-shared-config/compare/v1.0.2...v1.0.3) (2021-09-21) ##### Bug Fixes - update java-docfx-doclet version ([#​315](https://www.togithub.com/googleapis/java-shared-config/issues/315)) ([07af07c](https://www.github.com/googleapis/java-shared-config/commit/07af07c188447ea5728ecd2700121ff477d1c58a)) ##### [1.0.2](https://www.github.com/googleapis/java-shared-config/compare/v1.0.1...v1.0.2) (2021-09-13) ##### Bug Fixes - specify animal-sniffer-maven-plugin version ([#​308](https://www.togithub.com/googleapis/java-shared-config/issues/308)) ([378bf43](https://www.github.com/googleapis/java-shared-config/commit/378bf431383306c1cdd0a4f922956c87edf321b5)) - update java docfx doclet version ([#​312](https://www.togithub.com/googleapis/java-shared-config/issues/312)) ([dd7f6e0](https://www.github.com/googleapis/java-shared-config/commit/dd7f6e0c1a7cc73831b74b4475457611a8c097d3)) ##### Dependencies - update dependency com.puppycrawl.tools:checkstyle to v9 ([#​303](https://www.togithub.com/googleapis/java-shared-config/issues/303)) ([71faea3](https://www.github.com/googleapis/java-shared-config/commit/71faea38d4132407598550e2bb4c77f9d4a4d83d)) ##### [1.0.1](https://www.github.com/googleapis/java-shared-config/compare/v1.0.0...v1.0.1) (2021-08-18) ##### Dependencies - update dependency com.puppycrawl.tools:checkstyle to v8.45.1 ([#​292](https://www.togithub.com/googleapis/java-shared-config/issues/292)) ([66bf6e6](https://www.github.com/googleapis/java-shared-config/commit/66bf6e6fb95997b9eb4b34268b8d20c2fbe9ed5a))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-storage). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 68bd96ef1..4da24992a 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.0.3 + 1.1.0 From ada8d94bc0bb666b7f04e2eac6f53ecc3d4f802e Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Fri, 15 Oct 2021 15:42:28 -0400 Subject: [PATCH 26/28] test(retry): add validation to ensure at least one test case is resolved (#1109) * If an overly specific allowed filter can prevent any test cases from being passed to the runner, add validation to ensure there is at least one test case. --- .../storage/conformance/retry/ITRetryConformanceTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java index 40dcd2afa..cacc0d557 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java @@ -20,6 +20,7 @@ import static com.google.cloud.storage.PackagePrivateMethodWorkarounds.bucketCopyWithStorage; import static com.google.cloud.storage.conformance.retry.Ctx.ctx; import static com.google.cloud.storage.conformance.retry.State.empty; +import static com.google.common.truth.Truth.assertThat; import static java.util.Objects.requireNonNull; import static org.junit.Assert.assertNotNull; @@ -151,7 +152,9 @@ public static Collection testCases() throws IOException { .setTestAllowFilter(RetryTestCaseResolver.includeAll()) .build(); - return resolver.getRetryTestCases().stream() + List retryTestCases = resolver.getRetryTestCases(); + assertThat(retryTestCases).isNotEmpty(); + return retryTestCases.stream() .map(rtc -> new Object[] {rtc.testRetryConformance, rtc.rpcMethodMapping}) .collect(ImmutableList.toImmutableList()); } From a7e3b94e4a3e03599b0dbe51fbe574ed4ea1a0d8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 18 Oct 2021 09:31:20 -0700 Subject: [PATCH 27/28] fix: regenerate google.cloud.storage.v2 protos * fix!: rename committed_size to persisted_size * fix!: replace string key_sha256 with bytes key_sha256_bytes * fix: deprecate zone_affinity field * fix: add INHERITED to PublicAccessPrevention enum PiperOrigin-RevId: 402986756 Source-Author: Google APIs Source-Date: Wed Oct 13 20:18:42 2021 -0700 Source-Repo: googleapis/googleapis Source-Sha: 877d3d9d02591ad612a2c8654b42c37ba09ff9ec Source-Link: https://github.com/googleapis/googleapis/commit/877d3d9d02591ad612a2c8654b42c37ba09ff9ec * chore: add clirr rules to allow field renaming in alpha protos Co-authored-by: BenWhitehead --- .../com/google/storage/v2/StorageClient.java | 14 +- .../com/google/storage/v2/StorageGrpc.java | 20 +- .../clirr-ignored-differences.xml | 56 ++++ .../java/com/google/storage/v2/Bucket.java | 97 +++++-- .../google/storage/v2/BucketOrBuilder.java | 20 +- .../java/com/google/storage/v2/Object.java | 168 +++--------- .../storage/v2/QueryWriteStatusResponse.java | 50 ++-- .../v2/QueryWriteStatusResponseOrBuilder.java | 12 +- .../com/google/storage/v2/StorageProto.java | 259 +++++++++--------- .../google/storage/v2/WriteObjectRequest.java | 8 +- .../v2/WriteObjectRequestOrBuilder.java | 2 +- .../storage/v2/WriteObjectResponse.java | 50 ++-- .../v2/WriteObjectResponseOrBuilder.java | 12 +- .../proto/google/storage/v2/storage.proto | 28 +- synth.metadata | 6 +- 15 files changed, 422 insertions(+), 380 deletions(-) create mode 100644 proto-google-cloud-storage-v2/clirr-ignored-differences.xml diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java index 78b7fd7e0..41da80132 100644 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java @@ -190,7 +190,7 @@ public final ServerStreamingCallable read * that method an `WriteObjectSpec.` They should then attach the returned `upload_id` to the first * message of each following call to `Create`. If there is an error or the connection is broken * during the resumable `Create()`, the client should check the status of the `Create()` by - * calling `QueryWriteStatus()` and continue writing from the returned `committed_size`. This may + * calling `QueryWriteStatus()` and continue writing from the returned `persisted_size`. This may * be less than the amount of data the client previously sent. * *

The service will not view the object as complete until the client has sent a @@ -294,7 +294,7 @@ public final StartResumableWriteResponse startResumableWrite(StartResumableWrite // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Determines the `committed_size` for an object that is being written, which can then be used as + * Determines the `persisted_size` for an object that is being written, which can then be used as * the `write_offset` for the next `Write()` call. * *

If the object does not exist (i.e., the object has been deleted, or the first `Write()` has @@ -303,7 +303,7 @@ public final StartResumableWriteResponse startResumableWrite(StartResumableWrite *

The client **may** call `QueryWriteStatus()` at any time to determine how * much data has been processed for this object. This is useful if the client is buffering data * and needs to know which data can be safely evicted. For any sequence of `QueryWriteStatus()` - * calls for a given object name, the sequence of returned `committed_size` values will be + * calls for a given object name, the sequence of returned `persisted_size` values will be * non-decreasing. * *

Sample code: @@ -327,7 +327,7 @@ public final QueryWriteStatusResponse queryWriteStatus(String uploadId) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Determines the `committed_size` for an object that is being written, which can then be used as + * Determines the `persisted_size` for an object that is being written, which can then be used as * the `write_offset` for the next `Write()` call. * *

If the object does not exist (i.e., the object has been deleted, or the first `Write()` has @@ -336,7 +336,7 @@ public final QueryWriteStatusResponse queryWriteStatus(String uploadId) { *

The client **may** call `QueryWriteStatus()` at any time to determine how * much data has been processed for this object. This is useful if the client is buffering data * and needs to know which data can be safely evicted. For any sequence of `QueryWriteStatus()` - * calls for a given object name, the sequence of returned `committed_size` values will be + * calls for a given object name, the sequence of returned `persisted_size` values will be * non-decreasing. * *

Sample code: @@ -362,7 +362,7 @@ public final QueryWriteStatusResponse queryWriteStatus(QueryWriteStatusRequest r // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Determines the `committed_size` for an object that is being written, which can then be used as + * Determines the `persisted_size` for an object that is being written, which can then be used as * the `write_offset` for the next `Write()` call. * *

If the object does not exist (i.e., the object has been deleted, or the first `Write()` has @@ -371,7 +371,7 @@ public final QueryWriteStatusResponse queryWriteStatus(QueryWriteStatusRequest r *

The client **may** call `QueryWriteStatus()` at any time to determine how * much data has been processed for this object. This is useful if the client is buffering data * and needs to know which data can be safely evicted. For any sequence of `QueryWriteStatus()` - * calls for a given object name, the sequence of returned `committed_size` values will be + * calls for a given object name, the sequence of returned `persisted_size` values will be * non-decreasing. * *

Sample code: diff --git a/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java b/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java index c0add7579..0875e1a65 100644 --- a/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java +++ b/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java @@ -287,7 +287,7 @@ public void readObject( * each following call to `Create`. If there is an error or the connection is * broken during the resumable `Create()`, the client should check the status * of the `Create()` by calling `QueryWriteStatus()` and continue writing from - * the returned `committed_size`. This may be less than the amount of data the + * the returned `persisted_size`. This may be less than the amount of data the * client previously sent. * The service will not view the object as complete until the client has * sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any @@ -324,7 +324,7 @@ public void startResumableWrite( * * *

-     * Determines the `committed_size` for an object that is being written, which
+     * Determines the `persisted_size` for an object that is being written, which
      * can then be used as the `write_offset` for the next `Write()` call.
      * If the object does not exist (i.e., the object has been deleted, or the
      * first `Write()` has not yet reached the service), this method returns the
@@ -333,7 +333,7 @@ public void startResumableWrite(
      * much data has been processed for this object. This is useful if the
      * client is buffering data and needs to know which data can be safely
      * evicted. For any sequence of `QueryWriteStatus()` calls for a given
-     * object name, the sequence of returned `committed_size` values will be
+     * object name, the sequence of returned `persisted_size` values will be
      * non-decreasing.
      * 
*/ @@ -426,7 +426,7 @@ public void readObject( * each following call to `Create`. If there is an error or the connection is * broken during the resumable `Create()`, the client should check the status * of the `Create()` by calling `QueryWriteStatus()` and continue writing from - * the returned `committed_size`. This may be less than the amount of data the + * the returned `persisted_size`. This may be less than the amount of data the * client previously sent. * The service will not view the object as complete until the client has * sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any @@ -465,7 +465,7 @@ public void startResumableWrite( * * *
-     * Determines the `committed_size` for an object that is being written, which
+     * Determines the `persisted_size` for an object that is being written, which
      * can then be used as the `write_offset` for the next `Write()` call.
      * If the object does not exist (i.e., the object has been deleted, or the
      * first `Write()` has not yet reached the service), this method returns the
@@ -474,7 +474,7 @@ public void startResumableWrite(
      * much data has been processed for this object. This is useful if the
      * client is buffering data and needs to know which data can be safely
      * evicted. For any sequence of `QueryWriteStatus()` calls for a given
-     * object name, the sequence of returned `committed_size` values will be
+     * object name, the sequence of returned `persisted_size` values will be
      * non-decreasing.
      * 
*/ @@ -539,7 +539,7 @@ public com.google.storage.v2.StartResumableWriteResponse startResumableWrite( * * *
-     * Determines the `committed_size` for an object that is being written, which
+     * Determines the `persisted_size` for an object that is being written, which
      * can then be used as the `write_offset` for the next `Write()` call.
      * If the object does not exist (i.e., the object has been deleted, or the
      * first `Write()` has not yet reached the service), this method returns the
@@ -548,7 +548,7 @@ public com.google.storage.v2.StartResumableWriteResponse startResumableWrite(
      * much data has been processed for this object. This is useful if the
      * client is buffering data and needs to know which data can be safely
      * evicted. For any sequence of `QueryWriteStatus()` calls for a given
-     * object name, the sequence of returned `committed_size` values will be
+     * object name, the sequence of returned `persisted_size` values will be
      * non-decreasing.
      * 
*/ @@ -597,7 +597,7 @@ protected StorageFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c * * *
-     * Determines the `committed_size` for an object that is being written, which
+     * Determines the `persisted_size` for an object that is being written, which
      * can then be used as the `write_offset` for the next `Write()` call.
      * If the object does not exist (i.e., the object has been deleted, or the
      * first `Write()` has not yet reached the service), this method returns the
@@ -606,7 +606,7 @@ protected StorageFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c
      * much data has been processed for this object. This is useful if the
      * client is buffering data and needs to know which data can be safely
      * evicted. For any sequence of `QueryWriteStatus()` calls for a given
-     * object name, the sequence of returned `committed_size` values will be
+     * object name, the sequence of returned `persisted_size` values will be
      * non-decreasing.
      * 
*/ diff --git a/proto-google-cloud-storage-v2/clirr-ignored-differences.xml b/proto-google-cloud-storage-v2/clirr-ignored-differences.xml new file mode 100644 index 000000000..7aa1b87fd --- /dev/null +++ b/proto-google-cloud-storage-v2/clirr-ignored-differences.xml @@ -0,0 +1,56 @@ + + + + + + + + 6001 + com/google/storage/v2/* + COMMITTED_SIZE + + + 6011 + com/google/storage/v2/* + COMMITTED_SIZE_FIELD_NUMBER + + + 7002 + com/google/storage/v2/* + * *CommittedSize(*) + + + + 7012 + com/google/storage/v2/* + * *PersistedSize(*) + + + + + + + + 6011 + com/google/storage/v2/Object$CustomerEncryption* + KEY_SHA256_FIELD_NUMBER + + + 7002 + com/google/storage/v2/Object$CustomerEncryption* + * *KeySha256(*) + + + + 7012 + com/google/storage/v2/Object$CustomerEncryption* + * *KeySha256Bytes(*) + + diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Bucket.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Bucket.java index ebe211fd8..39842b0a0 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Bucket.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Bucket.java @@ -3475,9 +3475,7 @@ public enum PublicAccessPrevention implements com.google.protobuf.ProtocolMessag * * *
-       * Does not prevent access from being granted to public members 'allUsers'
-       * or 'allAuthenticatedUsers'. This setting may be enforced by Org Policy
-       * at the project/folder/organization level.
+       * No specified PublicAccessPrevention.
        * 
* * PUBLIC_ACCESS_PREVENTION_UNSPECIFIED = 0; @@ -3495,6 +3493,17 @@ public enum PublicAccessPrevention implements com.google.protobuf.ProtocolMessag * ENFORCED = 1; */ ENFORCED(1), + /** + * + * + *
+       * This setting is inherited from Org Policy. Does not prevent access from
+       * being granted to public members 'allUsers' or 'allAuthenticatedUsers'.
+       * 
+ * + * INHERITED = 2; + */ + INHERITED(2), UNRECOGNIZED(-1), ; @@ -3502,9 +3511,7 @@ public enum PublicAccessPrevention implements com.google.protobuf.ProtocolMessag * * *
-       * Does not prevent access from being granted to public members 'allUsers'
-       * or 'allAuthenticatedUsers'. This setting may be enforced by Org Policy
-       * at the project/folder/organization level.
+       * No specified PublicAccessPrevention.
        * 
* * PUBLIC_ACCESS_PREVENTION_UNSPECIFIED = 0; @@ -3522,6 +3529,17 @@ public enum PublicAccessPrevention implements com.google.protobuf.ProtocolMessag * ENFORCED = 1; */ public static final int ENFORCED_VALUE = 1; + /** + * + * + *
+       * This setting is inherited from Org Policy. Does not prevent access from
+       * being granted to public members 'allUsers' or 'allAuthenticatedUsers'.
+       * 
+ * + * INHERITED = 2; + */ + public static final int INHERITED_VALUE = 2; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -3551,6 +3569,8 @@ public static PublicAccessPrevention forNumber(int value) { return PUBLIC_ACCESS_PREVENTION_UNSPECIFIED; case 1: return ENFORCED; + case 2: + return INHERITED; default: return null; } @@ -15664,10 +15684,13 @@ public com.google.storage.v2.Bucket.IamConfigOrBuilder getIamConfigOrBuilder() { * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @return A list containing the zoneAffinity. */ + @java.lang.Deprecated public com.google.protobuf.ProtocolStringList getZoneAffinityList() { return zoneAffinity_; } @@ -15682,10 +15705,13 @@ public com.google.protobuf.ProtocolStringList getZoneAffinityList() { * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @return The count of zoneAffinity. */ + @java.lang.Deprecated public int getZoneAffinityCount() { return zoneAffinity_.size(); } @@ -15700,11 +15726,14 @@ public int getZoneAffinityCount() { * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @param index The index of the element to return. * @return The zoneAffinity at the given index. */ + @java.lang.Deprecated public java.lang.String getZoneAffinity(int index) { return zoneAffinity_.get(index); } @@ -15719,11 +15748,14 @@ public java.lang.String getZoneAffinity(int index) { * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @param index The index of the value to return. * @return The bytes of the zoneAffinity at the given index. */ + @java.lang.Deprecated public com.google.protobuf.ByteString getZoneAffinityBytes(int index) { return zoneAffinity_.getByteString(index); } @@ -21168,10 +21200,13 @@ private void ensureZoneAffinityIsMutable() { * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @return A list containing the zoneAffinity. */ + @java.lang.Deprecated public com.google.protobuf.ProtocolStringList getZoneAffinityList() { return zoneAffinity_.getUnmodifiableView(); } @@ -21186,10 +21221,13 @@ public com.google.protobuf.ProtocolStringList getZoneAffinityList() { * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @return The count of zoneAffinity. */ + @java.lang.Deprecated public int getZoneAffinityCount() { return zoneAffinity_.size(); } @@ -21204,11 +21242,14 @@ public int getZoneAffinityCount() { * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @param index The index of the element to return. * @return The zoneAffinity at the given index. */ + @java.lang.Deprecated public java.lang.String getZoneAffinity(int index) { return zoneAffinity_.get(index); } @@ -21223,11 +21264,14 @@ public java.lang.String getZoneAffinity(int index) { * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @param index The index of the value to return. * @return The bytes of the zoneAffinity at the given index. */ + @java.lang.Deprecated public com.google.protobuf.ByteString getZoneAffinityBytes(int index) { return zoneAffinity_.getByteString(index); } @@ -21242,12 +21286,15 @@ public com.google.protobuf.ByteString getZoneAffinityBytes(int index) { * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @param index The index to set the value at. * @param value The zoneAffinity to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setZoneAffinity(int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); @@ -21268,11 +21315,14 @@ public Builder setZoneAffinity(int index, java.lang.String value) { * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @param value The zoneAffinity to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addZoneAffinity(java.lang.String value) { if (value == null) { throw new NullPointerException(); @@ -21293,11 +21343,14 @@ public Builder addZoneAffinity(java.lang.String value) { * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @param values The zoneAffinity to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addAllZoneAffinity(java.lang.Iterable values) { ensureZoneAffinityIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, zoneAffinity_); @@ -21315,10 +21368,13 @@ public Builder addAllZoneAffinity(java.lang.Iterable values) { * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearZoneAffinity() { zoneAffinity_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000010); @@ -21336,11 +21392,14 @@ public Builder clearZoneAffinity() { * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @param value The bytes of the zoneAffinity to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addZoneAffinityBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketOrBuilder.java index 5ca0553c4..9cfd286d1 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketOrBuilder.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketOrBuilder.java @@ -946,10 +946,13 @@ public interface BucketOrBuilder * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @return A list containing the zoneAffinity. */ + @java.lang.Deprecated java.util.List getZoneAffinityList(); /** * @@ -962,10 +965,13 @@ public interface BucketOrBuilder * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @return The count of zoneAffinity. */ + @java.lang.Deprecated int getZoneAffinityCount(); /** * @@ -978,11 +984,14 @@ public interface BucketOrBuilder * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @param index The index of the element to return. * @return The zoneAffinity at the given index. */ + @java.lang.Deprecated java.lang.String getZoneAffinity(int index); /** * @@ -995,11 +1004,14 @@ public interface BucketOrBuilder * error. * * - * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * repeated string zone_affinity = 24 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE]; + * * * @param index The index of the value to return. * @return The bytes of the zoneAffinity at the given index. */ + @java.lang.Deprecated com.google.protobuf.ByteString getZoneAffinityBytes(int index); /** diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Object.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Object.java index 368eaf510..b63778579 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Object.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Object.java @@ -417,23 +417,12 @@ public interface CustomerEncryptionOrBuilder * *
      * SHA256 hash value of the encryption key.
+     * In raw bytes format (not base64-encoded).
      * 
* - * string key_sha256 = 2; + * bytes key_sha256_bytes = 3; * - * @return The keySha256. - */ - java.lang.String getKeySha256(); - /** - * - * - *
-     * SHA256 hash value of the encryption key.
-     * 
- * - * string key_sha256 = 2; - * - * @return The bytes for keySha256. + * @return The keySha256Bytes. */ com.google.protobuf.ByteString getKeySha256Bytes(); } @@ -458,7 +447,7 @@ private CustomerEncryption(com.google.protobuf.GeneratedMessageV3.Builder bui private CustomerEncryption() { encryptionAlgorithm_ = ""; - keySha256_ = ""; + keySha256Bytes_ = com.google.protobuf.ByteString.EMPTY; } @java.lang.Override @@ -497,11 +486,9 @@ private CustomerEncryption( encryptionAlgorithm_ = s; break; } - case 18: + case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - keySha256_ = s; + keySha256Bytes_ = input.readBytes(); break; } default: @@ -587,53 +574,23 @@ public com.google.protobuf.ByteString getEncryptionAlgorithmBytes() { } } - public static final int KEY_SHA256_FIELD_NUMBER = 2; - private volatile java.lang.Object keySha256_; + public static final int KEY_SHA256_BYTES_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString keySha256Bytes_; /** * * *
      * SHA256 hash value of the encryption key.
+     * In raw bytes format (not base64-encoded).
      * 
* - * string key_sha256 = 2; + * bytes key_sha256_bytes = 3; * - * @return The keySha256. - */ - @java.lang.Override - public java.lang.String getKeySha256() { - java.lang.Object ref = keySha256_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - keySha256_ = s; - return s; - } - } - /** - * - * - *
-     * SHA256 hash value of the encryption key.
-     * 
- * - * string key_sha256 = 2; - * - * @return The bytes for keySha256. + * @return The keySha256Bytes. */ @java.lang.Override public com.google.protobuf.ByteString getKeySha256Bytes() { - java.lang.Object ref = keySha256_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - keySha256_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + return keySha256Bytes_; } private byte memoizedIsInitialized = -1; @@ -653,8 +610,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getEncryptionAlgorithmBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, encryptionAlgorithm_); } - if (!getKeySha256Bytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, keySha256_); + if (!keySha256Bytes_.isEmpty()) { + output.writeBytes(3, keySha256Bytes_); } unknownFields.writeTo(output); } @@ -668,8 +625,8 @@ public int getSerializedSize() { if (!getEncryptionAlgorithmBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, encryptionAlgorithm_); } - if (!getKeySha256Bytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, keySha256_); + if (!keySha256Bytes_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, keySha256Bytes_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -688,7 +645,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.storage.v2.Object.CustomerEncryption) obj; if (!getEncryptionAlgorithm().equals(other.getEncryptionAlgorithm())) return false; - if (!getKeySha256().equals(other.getKeySha256())) return false; + if (!getKeySha256Bytes().equals(other.getKeySha256Bytes())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -702,8 +659,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ENCRYPTION_ALGORITHM_FIELD_NUMBER; hash = (53 * hash) + getEncryptionAlgorithm().hashCode(); - hash = (37 * hash) + KEY_SHA256_FIELD_NUMBER; - hash = (53 * hash) + getKeySha256().hashCode(); + hash = (37 * hash) + KEY_SHA256_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getKeySha256Bytes().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -853,7 +810,7 @@ public Builder clear() { super.clear(); encryptionAlgorithm_ = ""; - keySha256_ = ""; + keySha256Bytes_ = com.google.protobuf.ByteString.EMPTY; return this; } @@ -883,7 +840,7 @@ public com.google.storage.v2.Object.CustomerEncryption buildPartial() { com.google.storage.v2.Object.CustomerEncryption result = new com.google.storage.v2.Object.CustomerEncryption(this); result.encryptionAlgorithm_ = encryptionAlgorithm_; - result.keySha256_ = keySha256_; + result.keySha256Bytes_ = keySha256Bytes_; onBuilt(); return result; } @@ -940,9 +897,8 @@ public Builder mergeFrom(com.google.storage.v2.Object.CustomerEncryption other) encryptionAlgorithm_ = other.encryptionAlgorithm_; onChanged(); } - if (!other.getKeySha256().isEmpty()) { - keySha256_ = other.keySha256_; - onChanged(); + if (other.getKeySha256Bytes() != com.google.protobuf.ByteString.EMPTY) { + setKeySha256Bytes(other.getKeySha256Bytes()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -1080,86 +1036,42 @@ public Builder setEncryptionAlgorithmBytes(com.google.protobuf.ByteString value) return this; } - private java.lang.Object keySha256_ = ""; - /** - * - * - *
-       * SHA256 hash value of the encryption key.
-       * 
- * - * string key_sha256 = 2; - * - * @return The keySha256. - */ - public java.lang.String getKeySha256() { - java.lang.Object ref = keySha256_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - keySha256_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } + private com.google.protobuf.ByteString keySha256Bytes_ = com.google.protobuf.ByteString.EMPTY; /** * * *
        * SHA256 hash value of the encryption key.
+       * In raw bytes format (not base64-encoded).
        * 
* - * string key_sha256 = 2; + * bytes key_sha256_bytes = 3; * - * @return The bytes for keySha256. + * @return The keySha256Bytes. */ + @java.lang.Override public com.google.protobuf.ByteString getKeySha256Bytes() { - java.lang.Object ref = keySha256_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - keySha256_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + return keySha256Bytes_; } /** * * *
        * SHA256 hash value of the encryption key.
+       * In raw bytes format (not base64-encoded).
        * 
* - * string key_sha256 = 2; + * bytes key_sha256_bytes = 3; * - * @param value The keySha256 to set. + * @param value The keySha256Bytes to set. * @return This builder for chaining. */ - public Builder setKeySha256(java.lang.String value) { + public Builder setKeySha256Bytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - keySha256_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * SHA256 hash value of the encryption key.
-       * 
- * - * string key_sha256 = 2; - * - * @return This builder for chaining. - */ - public Builder clearKeySha256() { - - keySha256_ = getDefaultInstance().getKeySha256(); + keySha256Bytes_ = value; onChanged(); return this; } @@ -1168,20 +1080,16 @@ public Builder clearKeySha256() { * *
        * SHA256 hash value of the encryption key.
+       * In raw bytes format (not base64-encoded).
        * 
* - * string key_sha256 = 2; + * bytes key_sha256_bytes = 3; * - * @param value The bytes for keySha256 to set. * @return This builder for chaining. */ - public Builder setKeySha256Bytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public Builder clearKeySha256Bytes() { - keySha256_ = value; + keySha256Bytes_ = getDefaultInstance().getKeySha256Bytes(); onChanged(); return this; } diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponse.java index 3deb1d541..73b684dbe 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponse.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponse.java @@ -130,7 +130,7 @@ public enum WriteStatusCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { - COMMITTED_SIZE(1), + PERSISTED_SIZE(1), RESOURCE(2), WRITESTATUS_NOT_SET(0); private final int value; @@ -151,7 +151,7 @@ public static WriteStatusCase valueOf(int value) { public static WriteStatusCase forNumber(int value) { switch (value) { case 1: - return COMMITTED_SIZE; + return PERSISTED_SIZE; case 2: return RESOURCE; case 0: @@ -170,7 +170,7 @@ public WriteStatusCase getWriteStatusCase() { return WriteStatusCase.forNumber(writeStatusCase_); } - public static final int COMMITTED_SIZE_FIELD_NUMBER = 1; + public static final int PERSISTED_SIZE_FIELD_NUMBER = 1; /** * * @@ -181,12 +181,12 @@ public WriteStatusCase getWriteStatusCase() { * Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * - * @return Whether the committedSize field is set. + * @return Whether the persistedSize field is set. */ @java.lang.Override - public boolean hasCommittedSize() { + public boolean hasPersistedSize() { return writeStatusCase_ == 1; } /** @@ -199,12 +199,12 @@ public boolean hasCommittedSize() { * Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * - * @return The committedSize. + * @return The persistedSize. */ @java.lang.Override - public long getCommittedSize() { + public long getPersistedSize() { if (writeStatusCase_ == 1) { return (java.lang.Long) writeStatus_; } @@ -323,7 +323,7 @@ public boolean equals(final java.lang.Object obj) { if (!getWriteStatusCase().equals(other.getWriteStatusCase())) return false; switch (writeStatusCase_) { case 1: - if (getCommittedSize() != other.getCommittedSize()) return false; + if (getPersistedSize() != other.getPersistedSize()) return false; break; case 2: if (!getResource().equals(other.getResource())) return false; @@ -344,8 +344,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); switch (writeStatusCase_) { case 1: - hash = (37 * hash) + COMMITTED_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCommittedSize()); + hash = (37 * hash) + PERSISTED_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPersistedSize()); break; case 2: hash = (37 * hash) + RESOURCE_FIELD_NUMBER; @@ -589,9 +589,9 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.storage.v2.QueryWriteStatusResponse other) { if (other == com.google.storage.v2.QueryWriteStatusResponse.getDefaultInstance()) return this; switch (other.getWriteStatusCase()) { - case COMMITTED_SIZE: + case PERSISTED_SIZE: { - setCommittedSize(other.getCommittedSize()); + setPersistedSize(other.getPersistedSize()); break; } case RESOURCE: @@ -657,11 +657,11 @@ public Builder clearWriteStatus() { * Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * - * @return Whether the committedSize field is set. + * @return Whether the persistedSize field is set. */ - public boolean hasCommittedSize() { + public boolean hasPersistedSize() { return writeStatusCase_ == 1; } /** @@ -674,11 +674,11 @@ public boolean hasCommittedSize() { * Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * - * @return The committedSize. + * @return The persistedSize. */ - public long getCommittedSize() { + public long getPersistedSize() { if (writeStatusCase_ == 1) { return (java.lang.Long) writeStatus_; } @@ -694,12 +694,12 @@ public long getCommittedSize() { * Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * - * @param value The committedSize to set. + * @param value The persistedSize to set. * @return This builder for chaining. */ - public Builder setCommittedSize(long value) { + public Builder setPersistedSize(long value) { writeStatusCase_ = 1; writeStatus_ = value; onChanged(); @@ -715,11 +715,11 @@ public Builder setCommittedSize(long value) { * Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * * @return This builder for chaining. */ - public Builder clearCommittedSize() { + public Builder clearPersistedSize() { if (writeStatusCase_ == 1) { writeStatusCase_ = 0; writeStatus_ = null; diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponseOrBuilder.java index d700c3165..27f5c79b5 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponseOrBuilder.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponseOrBuilder.java @@ -33,11 +33,11 @@ public interface QueryWriteStatusResponseOrBuilder * Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * - * @return Whether the committedSize field is set. + * @return Whether the persistedSize field is set. */ - boolean hasCommittedSize(); + boolean hasPersistedSize(); /** * * @@ -48,11 +48,11 @@ public interface QueryWriteStatusResponseOrBuilder * Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * - * @return The committedSize. + * @return The persistedSize. */ - long getCommittedSize(); + long getPersistedSize(); /** * diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java index a4db7e2ed..1e0a060dc 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java @@ -235,7 +235,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "Params\022E\n\025common_request_params\030\t \001(\0132&." + "google.storage.v2.CommonRequestParamsB\017\n" + "\rfirst_messageB\006\n\004data\"n\n\023WriteObjectRes" - + "ponse\022\030\n\016committed_size\030\001 \001(\003H\000\022-\n\010resou" + + "ponse\022\030\n\016persisted_size\030\001 \001(\003H\000\022-\n\010resou" + "rce\030\002 \001(\0132\031.google.storage.v2.ObjectH\000B\016" + "\n\014write_status\"\314\001\n\027QueryWriteStatusReque" + "st\022\026\n\tupload_id\030\001 \001(\tB\003\340A\002\022R\n\034common_obj" @@ -243,7 +243,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "e.v2.CommonObjectRequestParams\022E\n\025common" + "_request_params\030\003 \001(\0132&.google.storage.v" + "2.CommonRequestParams\"s\n\030QueryWriteStatu" - + "sResponse\022\030\n\016committed_size\030\001 \001(\003H\000\022-\n\010r" + + "sResponse\022\030\n\016persisted_size\030\001 \001(\003H\000\022-\n\010r" + "esource\030\002 \001(\0132\031.google.storage.v2.Object" + "H\000B\016\n\014write_status\"\366\001\n\032StartResumableWri" + "teRequest\022=\n\021write_object_spec\030\001 \001(\0132\".g" @@ -276,7 +276,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "LS_KEY_VALUE_LENGTH\020?\022\037\n\032MAX_LABELS_KEY_" + "VALUE_BYTES\020\200\001\022.\n)MAX_OBJECT_IDS_PER_DEL" + "ETE_OBJECTS_REQUEST\020\350\007\022\036\n\032SPLIT_TOKEN_MA" - + "X_VALID_DAYS\020\016\032\002\020\001\"\204\026\n\006Bucket\022\021\n\004name\030\001 " + + "X_VALID_DAYS\020\016\032\002\020\001\"\225\026\n\006Bucket\022\021\n\004name\030\001 " + "\001(\tB\003\340A\005\022\026\n\tbucket_id\030\002 \001(\tB\003\340A\003\022D\n\007proj" + "ect\030\003 \001(\tB3\340A\005\372A-\n+cloudresourcemanager." + "googleapis.com/Project\022\033\n\016metageneration" @@ -303,129 +303,130 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "orage.v2.Bucket.Billing\022C\n\020retention_pol" + "icy\030\026 \001(\0132).google.storage.v2.Bucket.Ret" + "entionPolicy\0227\n\niam_config\030\027 \001(\0132#.googl" - + "e.storage.v2.Bucket.IamConfig\022\032\n\rzone_af" - + "finity\030\030 \003(\tB\003\340A\005\022\025\n\rsatisfies_pzs\030\031 \001(\010" - + "\032!\n\007Billing\022\026\n\016requester_pays\030\001 \001(\010\032X\n\004C" - + "ors\022\016\n\006origin\030\001 \003(\t\022\016\n\006method\030\002 \003(\t\022\027\n\017r" - + "esponse_header\030\003 \003(\t\022\027\n\017max_age_seconds\030" - + "\004 \001(\005\032M\n\nEncryption\022?\n\017default_kms_key\030\001" - + " \001(\tB&\372A#\n!cloudkms.googleapis.com/Crypt" - + "oKey\032\372\002\n\tIamConfig\022a\n\033uniform_bucket_lev" - + "el_access\030\001 \001(\0132<.google.storage.v2.Buck" - + "et.IamConfig.UniformBucketLevelAccess\022\\\n" - + "\030public_access_prevention\030\002 \001(\0162:.google" - + ".storage.v2.Bucket.IamConfig.PublicAcces" - + "sPrevention\032Z\n\030UniformBucketLevelAccess\022" - + "\017\n\007enabled\030\001 \001(\010\022-\n\tlock_time\030\002 \001(\0132\032.go" - + "ogle.protobuf.Timestamp\"P\n\026PublicAccessP" - + "revention\022(\n$PUBLIC_ACCESS_PREVENTION_UN" - + "SPECIFIED\020\000\022\014\n\010ENFORCED\020\001\032\303\005\n\tLifecycle\022" - + "6\n\004rule\030\001 \003(\0132(.google.storage.v2.Bucket" - + ".Lifecycle.Rule\032\375\004\n\004Rule\022?\n\006action\030\001 \001(\013" - + "2/.google.storage.v2.Bucket.Lifecycle.Ru" - + "le.Action\022E\n\tcondition\030\002 \001(\01322.google.st" - + "orage.v2.Bucket.Lifecycle.Rule.Condition" - + "\032-\n\006Action\022\014\n\004type\030\001 \001(\t\022\025\n\rstorage_clas" - + "s\030\002 \001(\t\032\275\003\n\tCondition\022\025\n\010age_days\030\001 \001(\005H" - + "\000\210\001\001\022)\n\016created_before\030\002 \001(\0132\021.google.ty" - + "pe.Date\022\024\n\007is_live\030\003 \001(\010H\001\210\001\001\022\037\n\022num_new" - + "er_versions\030\004 \001(\005H\002\210\001\001\022\035\n\025matches_storag" - + "e_class\030\005 \003(\t\022#\n\026days_since_custom_time\030" - + "\007 \001(\005H\003\210\001\001\022-\n\022custom_time_before\030\010 \001(\0132\021" - + ".google.type.Date\022\'\n\032days_since_noncurre" - + "nt_time\030\t \001(\005H\004\210\001\001\0221\n\026noncurrent_time_be" - + "fore\030\n \001(\0132\021.google.type.DateB\013\n\t_age_da" - + "ysB\n\n\010_is_liveB\025\n\023_num_newer_versionsB\031\n" - + "\027_days_since_custom_timeB\035\n\033_days_since_" - + "noncurrent_time\0328\n\007Logging\022\022\n\nlog_bucket" - + "\030\001 \001(\t\022\031\n\021log_object_prefix\030\002 \001(\t\032r\n\017Ret" - + "entionPolicy\0222\n\016effective_time\030\001 \001(\0132\032.g" - + "oogle.protobuf.Timestamp\022\021\n\tis_locked\030\002 " - + "\001(\010\022\030\n\020retention_period\030\003 \001(\003\032\035\n\nVersion" - + "ing\022\017\n\007enabled\030\001 \001(\010\032;\n\007Website\022\030\n\020main_" - + "page_suffix\030\001 \001(\t\022\026\n\016not_found_page\030\002 \001(" - + "\t\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002" - + " \001(\t:\0028\001:G\352AD\n\035storage.googleapis.com/Bu" - + "cket\022#projects/{project}/buckets/{bucket" - + "}\"\247\001\n\023BucketAccessControl\022\014\n\004role\030\001 \001(\t\022" - + "\n\n\002id\030\002 \001(\t\022\016\n\006entity\030\003 \001(\t\022\021\n\tentity_id" - + "\030\004 \001(\t\022\r\n\005email\030\005 \001(\t\022\016\n\006domain\030\006 \001(\t\0224\n" - + "\014project_team\030\007 \001(\0132\036.google.storage.v2." - + "ProjectTeam\"B\n\017ChecksummedData\022\017\n\007conten" - + "t\030\001 \001(\014\022\023\n\006crc32c\030\002 \001(\007H\000\210\001\001B\t\n\007_crc32c\"" - + "C\n\017ObjectChecksums\022\023\n\006crc32c\030\001 \001(\007H\000\210\001\001\022" - + "\020\n\010md5_hash\030\002 \001(\014B\t\n\007_crc32c\"\303\t\n\006Object\022" - + "\021\n\004name\030\001 \001(\tB\003\340A\005\0225\n\006bucket\030\002 \001(\tB%\340A\005\372" - + "A\037\n\035storage.googleapis.com/Bucket\022\027\n\ngen" - + "eration\030\003 \001(\003B\003\340A\005\022\033\n\016metageneration\030\004 \001" - + "(\003B\003\340A\003\022\025\n\rstorage_class\030\005 \001(\t\022\021\n\004size\030\006" - + " \001(\003B\003\340A\003\022\030\n\020content_encoding\030\007 \001(\t\022\033\n\023c" - + "ontent_disposition\030\010 \001(\t\022\025\n\rcache_contro" - + "l\030\t \001(\t\0223\n\003acl\030\n \003(\0132&.google.storage.v2" - + ".ObjectAccessControl\022\030\n\020content_language" - + "\030\013 \001(\t\0224\n\013delete_time\030\014 \001(\0132\032.google.pro" - + "tobuf.TimestampB\003\340A\003\022\024\n\014content_type\030\r \001" - + "(\t\0224\n\013create_time\030\016 \001(\0132\032.google.protobu" - + "f.TimestampB\003\340A\003\022\034\n\017component_count\030\017 \001(" - + "\005B\003\340A\003\022:\n\tchecksums\030\020 \001(\0132\".google.stora" - + "ge.v2.ObjectChecksumsB\003\340A\003\0224\n\013update_tim" - + "e\030\021 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" - + "\0227\n\007kms_key\030\022 \001(\tB&\372A#\n!cloudkms.googlea" - + "pis.com/CryptoKey\022B\n\031update_storage_clas" - + "s_time\030\023 \001(\0132\032.google.protobuf.Timestamp" - + "B\003\340A\003\022\026\n\016temporary_hold\030\024 \001(\010\0229\n\025retenti" - + "on_expire_time\030\025 \001(\0132\032.google.protobuf.T" - + "imestamp\0229\n\010metadata\030\026 \003(\0132\'.google.stor" - + "age.v2.Object.MetadataEntry\022\035\n\020event_bas" - + "ed_hold\030\027 \001(\010H\000\210\001\001\022,\n\005owner\030\030 \001(\0132\030.goog" - + "le.storage.v2.OwnerB\003\340A\003\022I\n\023customer_enc" - + "ryption\030\031 \001(\0132,.google.storage.v2.Object" - + ".CustomerEncryption\022/\n\013custom_time\030\032 \001(\013" - + "2\032.google.protobuf.Timestamp\032F\n\022Customer" - + "Encryption\022\034\n\024encryption_algorithm\030\001 \001(\t" - + "\022\022\n\nkey_sha256\030\002 \001(\t\032/\n\rMetadataEntry\022\013\n" - + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\023\n\021_event_" - + "based_hold\"\247\001\n\023ObjectAccessControl\022\014\n\004ro" - + "le\030\001 \001(\t\022\n\n\002id\030\002 \001(\t\022\016\n\006entity\030\003 \001(\t\022\021\n\t" - + "entity_id\030\004 \001(\t\022\r\n\005email\030\005 \001(\t\022\016\n\006domain" - + "\030\006 \001(\t\0224\n\014project_team\030\007 \001(\0132\036.google.st" - + "orage.v2.ProjectTeam\"3\n\013ProjectTeam\022\026\n\016p" - + "roject_number\030\001 \001(\t\022\014\n\004team\030\002 \001(\t\"*\n\005Own" - + "er\022\016\n\006entity\030\001 \001(\t\022\021\n\tentity_id\030\002 \001(\t\"C\n" - + "\014ContentRange\022\r\n\005start\030\001 \001(\003\022\013\n\003end\030\002 \001(" - + "\003\022\027\n\017complete_length\030\003 \001(\003*\377\001\n\023Predefine" - + "dObjectAcl\022%\n!PREDEFINED_OBJECT_ACL_UNSP" - + "ECIFIED\020\000\022!\n\035OBJECT_ACL_AUTHENTICATED_RE" - + "AD\020\001\022(\n$OBJECT_ACL_BUCKET_OWNER_FULL_CON" - + "TROL\020\002\022 \n\034OBJECT_ACL_BUCKET_OWNER_READ\020\003" - + "\022\026\n\022OBJECT_ACL_PRIVATE\020\004\022\036\n\032OBJECT_ACL_P" - + "ROJECT_PRIVATE\020\005\022\032\n\026OBJECT_ACL_PUBLIC_RE" - + "AD\020\0062\223\006\n\007Storage\022\210\001\n\nReadObject\022$.google" - + ".storage.v2.ReadObjectRequest\032%.google.s" - + "torage.v2.ReadObjectResponse\"+\332A\rbucket," - + "object\332A\030bucket,object,generation0\001\022`\n\013W" - + "riteObject\022%.google.storage.v2.WriteObje" - + "ctRequest\032&.google.storage.v2.WriteObjec" - + "tResponse\"\000(\001\022v\n\023StartResumableWrite\022-.g" - + "oogle.storage.v2.StartResumableWriteRequ" - + "est\032..google.storage.v2.StartResumableWr" - + "iteResponse\"\000\022y\n\020QueryWriteStatus\022*.goog" - + "le.storage.v2.QueryWriteStatusRequest\032+." - + "google.storage.v2.QueryWriteStatusRespon" - + "se\"\014\332A\tupload_id\032\247\002\312A\026storage.googleapis" - + ".com\322A\212\002https://www.googleapis.com/auth/" - + "cloud-platform,https://www.googleapis.co" - + "m/auth/cloud-platform.read-only,https://" - + "www.googleapis.com/auth/devstorage.full_" - + "control,https://www.googleapis.com/auth/" - + "devstorage.read_only,https://www.googlea" - + "pis.com/auth/devstorage.read_writeB\334\001\n\025c" - + "om.google.storage.v2B\014StorageProtoP\001Z8go" - + "ogle.golang.org/genproto/googleapis/stor" - + "age/v2;storage\352Ax\n!cloudkms.googleapis.c" - + "om/CryptoKey\022Sprojects/{project}/locatio" - + "ns/{location}/keyRings/{key_ring}/crypto" - + "Keys/{crypto_key}b\006proto3" + + "e.storage.v2.Bucket.IamConfig\022\034\n\rzone_af" + + "finity\030\030 \003(\tB\005\030\001\340A\005\022\025\n\rsatisfies_pzs\030\031 \001" + + "(\010\032!\n\007Billing\022\026\n\016requester_pays\030\001 \001(\010\032X\n" + + "\004Cors\022\016\n\006origin\030\001 \003(\t\022\016\n\006method\030\002 \003(\t\022\027\n" + + "\017response_header\030\003 \003(\t\022\027\n\017max_age_second" + + "s\030\004 \001(\005\032M\n\nEncryption\022?\n\017default_kms_key" + + "\030\001 \001(\tB&\372A#\n!cloudkms.googleapis.com/Cry" + + "ptoKey\032\211\003\n\tIamConfig\022a\n\033uniform_bucket_l" + + "evel_access\030\001 \001(\0132<.google.storage.v2.Bu" + + "cket.IamConfig.UniformBucketLevelAccess\022" + + "\\\n\030public_access_prevention\030\002 \001(\0162:.goog" + + "le.storage.v2.Bucket.IamConfig.PublicAcc" + + "essPrevention\032Z\n\030UniformBucketLevelAcces" + + "s\022\017\n\007enabled\030\001 \001(\010\022-\n\tlock_time\030\002 \001(\0132\032." + + "google.protobuf.Timestamp\"_\n\026PublicAcces" + + "sPrevention\022(\n$PUBLIC_ACCESS_PREVENTION_" + + "UNSPECIFIED\020\000\022\014\n\010ENFORCED\020\001\022\r\n\tINHERITED" + + "\020\002\032\303\005\n\tLifecycle\0226\n\004rule\030\001 \003(\0132(.google." + + "storage.v2.Bucket.Lifecycle.Rule\032\375\004\n\004Rul" + + "e\022?\n\006action\030\001 \001(\0132/.google.storage.v2.Bu" + + "cket.Lifecycle.Rule.Action\022E\n\tcondition\030" + + "\002 \001(\01322.google.storage.v2.Bucket.Lifecyc" + + "le.Rule.Condition\032-\n\006Action\022\014\n\004type\030\001 \001(" + + "\t\022\025\n\rstorage_class\030\002 \001(\t\032\275\003\n\tCondition\022\025" + + "\n\010age_days\030\001 \001(\005H\000\210\001\001\022)\n\016created_before\030" + + "\002 \001(\0132\021.google.type.Date\022\024\n\007is_live\030\003 \001(" + + "\010H\001\210\001\001\022\037\n\022num_newer_versions\030\004 \001(\005H\002\210\001\001\022" + + "\035\n\025matches_storage_class\030\005 \003(\t\022#\n\026days_s" + + "ince_custom_time\030\007 \001(\005H\003\210\001\001\022-\n\022custom_ti" + + "me_before\030\010 \001(\0132\021.google.type.Date\022\'\n\032da" + + "ys_since_noncurrent_time\030\t \001(\005H\004\210\001\001\0221\n\026n" + + "oncurrent_time_before\030\n \001(\0132\021.google.typ" + + "e.DateB\013\n\t_age_daysB\n\n\010_is_liveB\025\n\023_num_" + + "newer_versionsB\031\n\027_days_since_custom_tim" + + "eB\035\n\033_days_since_noncurrent_time\0328\n\007Logg" + + "ing\022\022\n\nlog_bucket\030\001 \001(\t\022\031\n\021log_object_pr" + + "efix\030\002 \001(\t\032r\n\017RetentionPolicy\0222\n\016effecti" + + "ve_time\030\001 \001(\0132\032.google.protobuf.Timestam" + + "p\022\021\n\tis_locked\030\002 \001(\010\022\030\n\020retention_period" + + "\030\003 \001(\003\032\035\n\nVersioning\022\017\n\007enabled\030\001 \001(\010\032;\n" + + "\007Website\022\030\n\020main_page_suffix\030\001 \001(\t\022\026\n\016no" + + "t_found_page\030\002 \001(\t\032-\n\013LabelsEntry\022\013\n\003key" + + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:G\352AD\n\035storage." + + "googleapis.com/Bucket\022#projects/{project" + + "}/buckets/{bucket}\"\247\001\n\023BucketAccessContr" + + "ol\022\014\n\004role\030\001 \001(\t\022\n\n\002id\030\002 \001(\t\022\016\n\006entity\030\003" + + " \001(\t\022\021\n\tentity_id\030\004 \001(\t\022\r\n\005email\030\005 \001(\t\022\016" + + "\n\006domain\030\006 \001(\t\0224\n\014project_team\030\007 \001(\0132\036.g" + + "oogle.storage.v2.ProjectTeam\"B\n\017Checksum" + + "medData\022\017\n\007content\030\001 \001(\014\022\023\n\006crc32c\030\002 \001(\007" + + "H\000\210\001\001B\t\n\007_crc32c\"C\n\017ObjectChecksums\022\023\n\006c" + + "rc32c\030\001 \001(\007H\000\210\001\001\022\020\n\010md5_hash\030\002 \001(\014B\t\n\007_c" + + "rc32c\"\311\t\n\006Object\022\021\n\004name\030\001 \001(\tB\003\340A\005\0225\n\006b" + + "ucket\030\002 \001(\tB%\340A\005\372A\037\n\035storage.googleapis." + + "com/Bucket\022\027\n\ngeneration\030\003 \001(\003B\003\340A\005\022\033\n\016m" + + "etageneration\030\004 \001(\003B\003\340A\003\022\025\n\rstorage_clas" + + "s\030\005 \001(\t\022\021\n\004size\030\006 \001(\003B\003\340A\003\022\030\n\020content_en" + + "coding\030\007 \001(\t\022\033\n\023content_disposition\030\010 \001(" + + "\t\022\025\n\rcache_control\030\t \001(\t\0223\n\003acl\030\n \003(\0132&." + + "google.storage.v2.ObjectAccessControl\022\030\n" + + "\020content_language\030\013 \001(\t\0224\n\013delete_time\030\014" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\024\n" + + "\014content_type\030\r \001(\t\0224\n\013create_time\030\016 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\022\034\n\017com" + + "ponent_count\030\017 \001(\005B\003\340A\003\022:\n\tchecksums\030\020 \001" + + "(\0132\".google.storage.v2.ObjectChecksumsB\003" + + "\340A\003\0224\n\013update_time\030\021 \001(\0132\032.google.protob" + + "uf.TimestampB\003\340A\003\0227\n\007kms_key\030\022 \001(\tB&\372A#\n" + + "!cloudkms.googleapis.com/CryptoKey\022B\n\031up" + + "date_storage_class_time\030\023 \001(\0132\032.google.p" + + "rotobuf.TimestampB\003\340A\003\022\026\n\016temporary_hold" + + "\030\024 \001(\010\0229\n\025retention_expire_time\030\025 \001(\0132\032." + + "google.protobuf.Timestamp\0229\n\010metadata\030\026 " + + "\003(\0132\'.google.storage.v2.Object.MetadataE" + + "ntry\022\035\n\020event_based_hold\030\027 \001(\010H\000\210\001\001\022,\n\005o" + + "wner\030\030 \001(\0132\030.google.storage.v2.OwnerB\003\340A" + + "\003\022I\n\023customer_encryption\030\031 \001(\0132,.google." + + "storage.v2.Object.CustomerEncryption\022/\n\013" + + "custom_time\030\032 \001(\0132\032.google.protobuf.Time" + + "stamp\032L\n\022CustomerEncryption\022\034\n\024encryptio" + + "n_algorithm\030\001 \001(\t\022\030\n\020key_sha256_bytes\030\003 " + + "\001(\014\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005val" + + "ue\030\002 \001(\t:\0028\001B\023\n\021_event_based_hold\"\247\001\n\023Ob" + + "jectAccessControl\022\014\n\004role\030\001 \001(\t\022\n\n\002id\030\002 " + + "\001(\t\022\016\n\006entity\030\003 \001(\t\022\021\n\tentity_id\030\004 \001(\t\022\r" + + "\n\005email\030\005 \001(\t\022\016\n\006domain\030\006 \001(\t\0224\n\014project" + + "_team\030\007 \001(\0132\036.google.storage.v2.ProjectT" + + "eam\"3\n\013ProjectTeam\022\026\n\016project_number\030\001 \001" + + "(\t\022\014\n\004team\030\002 \001(\t\"*\n\005Owner\022\016\n\006entity\030\001 \001(" + + "\t\022\021\n\tentity_id\030\002 \001(\t\"C\n\014ContentRange\022\r\n\005" + + "start\030\001 \001(\003\022\013\n\003end\030\002 \001(\003\022\027\n\017complete_len" + + "gth\030\003 \001(\003*\377\001\n\023PredefinedObjectAcl\022%\n!PRE" + + "DEFINED_OBJECT_ACL_UNSPECIFIED\020\000\022!\n\035OBJE" + + "CT_ACL_AUTHENTICATED_READ\020\001\022(\n$OBJECT_AC" + + "L_BUCKET_OWNER_FULL_CONTROL\020\002\022 \n\034OBJECT_" + + "ACL_BUCKET_OWNER_READ\020\003\022\026\n\022OBJECT_ACL_PR" + + "IVATE\020\004\022\036\n\032OBJECT_ACL_PROJECT_PRIVATE\020\005\022" + + "\032\n\026OBJECT_ACL_PUBLIC_READ\020\0062\223\006\n\007Storage\022" + + "\210\001\n\nReadObject\022$.google.storage.v2.ReadO" + + "bjectRequest\032%.google.storage.v2.ReadObj" + + "ectResponse\"+\332A\rbucket,object\332A\030bucket,o" + + "bject,generation0\001\022`\n\013WriteObject\022%.goog" + + "le.storage.v2.WriteObjectRequest\032&.googl" + + "e.storage.v2.WriteObjectResponse\"\000(\001\022v\n\023" + + "StartResumableWrite\022-.google.storage.v2." + + "StartResumableWriteRequest\032..google.stor" + + "age.v2.StartResumableWriteResponse\"\000\022y\n\020" + + "QueryWriteStatus\022*.google.storage.v2.Que" + + "ryWriteStatusRequest\032+.google.storage.v2" + + ".QueryWriteStatusResponse\"\014\332A\tupload_id\032" + + "\247\002\312A\026storage.googleapis.com\322A\212\002https://w" + + "ww.googleapis.com/auth/cloud-platform,ht" + + "tps://www.googleapis.com/auth/cloud-plat" + + "form.read-only,https://www.googleapis.co" + + "m/auth/devstorage.full_control,https://w" + + "ww.googleapis.com/auth/devstorage.read_o" + + "nly,https://www.googleapis.com/auth/devs" + + "torage.read_writeB\334\001\n\025com.google.storage" + + ".v2B\014StorageProtoP\001Z8google.golang.org/g" + + "enproto/googleapis/storage/v2;storage\352Ax" + + "\n!cloudkms.googleapis.com/CryptoKey\022Spro" + + "jects/{project}/locations/{location}/key" + + "Rings/{key_ring}/cryptoKeys/{crypto_key}" + + "b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -513,7 +514,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_WriteObjectResponse_descriptor, new java.lang.String[] { - "CommittedSize", "Resource", "WriteStatus", + "PersistedSize", "Resource", "WriteStatus", }); internal_static_google_storage_v2_QueryWriteStatusRequest_descriptor = getDescriptor().getMessageTypes().get(5); @@ -529,7 +530,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_QueryWriteStatusResponse_descriptor, new java.lang.String[] { - "CommittedSize", "Resource", "WriteStatus", + "PersistedSize", "Resource", "WriteStatus", }); internal_static_google_storage_v2_StartResumableWriteRequest_descriptor = getDescriptor().getMessageTypes().get(7); @@ -788,7 +789,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_Object_CustomerEncryption_descriptor, new java.lang.String[] { - "EncryptionAlgorithm", "KeySha256", + "EncryptionAlgorithm", "KeySha256Bytes", }); internal_static_google_storage_v2_Object_MetadataEntry_descriptor = internal_static_google_storage_v2_Object_descriptor.getNestedTypes().get(1); diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequest.java index 34f53ff18..d7ec58b07 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequest.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequest.java @@ -427,7 +427,7 @@ public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilde * written. * In the first `WriteObjectRequest` of a `WriteObject()` action, it * indicates the initial offset for the `Write()` call. The value **must** be - * equal to the `committed_size` that a call to `QueryWriteStatus()` would + * equal to the `persisted_size` that a call to `QueryWriteStatus()` would * return (0 if this is the first write to the object). * On subsequent calls, this value **must** be no larger than the sum of the * first `write_offset` and the sizes of all `data` chunks sent previously on @@ -1599,7 +1599,7 @@ public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilde * written. * In the first `WriteObjectRequest` of a `WriteObject()` action, it * indicates the initial offset for the `Write()` call. The value **must** be - * equal to the `committed_size` that a call to `QueryWriteStatus()` would + * equal to the `persisted_size` that a call to `QueryWriteStatus()` would * return (0 if this is the first write to the object). * On subsequent calls, this value **must** be no larger than the sum of the * first `write_offset` and the sizes of all `data` chunks sent previously on @@ -1623,7 +1623,7 @@ public long getWriteOffset() { * written. * In the first `WriteObjectRequest` of a `WriteObject()` action, it * indicates the initial offset for the `Write()` call. The value **must** be - * equal to the `committed_size` that a call to `QueryWriteStatus()` would + * equal to the `persisted_size` that a call to `QueryWriteStatus()` would * return (0 if this is the first write to the object). * On subsequent calls, this value **must** be no larger than the sum of the * first `write_offset` and the sizes of all `data` chunks sent previously on @@ -1650,7 +1650,7 @@ public Builder setWriteOffset(long value) { * written. * In the first `WriteObjectRequest` of a `WriteObject()` action, it * indicates the initial offset for the `Write()` call. The value **must** be - * equal to the `committed_size` that a call to `QueryWriteStatus()` would + * equal to the `persisted_size` that a call to `QueryWriteStatus()` would * return (0 if this is the first write to the object). * On subsequent calls, this value **must** be no larger than the sum of the * first `write_offset` and the sizes of all `data` chunks sent previously on diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequestOrBuilder.java index 2e787f95c..175e2c48a 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequestOrBuilder.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequestOrBuilder.java @@ -109,7 +109,7 @@ public interface WriteObjectRequestOrBuilder * written. * In the first `WriteObjectRequest` of a `WriteObject()` action, it * indicates the initial offset for the `Write()` call. The value **must** be - * equal to the `committed_size` that a call to `QueryWriteStatus()` would + * equal to the `persisted_size` that a call to `QueryWriteStatus()` would * return (0 if this is the first write to the object). * On subsequent calls, this value **must** be no larger than the sum of the * first `write_offset` and the sizes of all `data` chunks sent previously on diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponse.java index 4c3b8c4cf..06576899b 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponse.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponse.java @@ -130,7 +130,7 @@ public enum WriteStatusCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { - COMMITTED_SIZE(1), + PERSISTED_SIZE(1), RESOURCE(2), WRITESTATUS_NOT_SET(0); private final int value; @@ -151,7 +151,7 @@ public static WriteStatusCase valueOf(int value) { public static WriteStatusCase forNumber(int value) { switch (value) { case 1: - return COMMITTED_SIZE; + return PERSISTED_SIZE; case 2: return RESOURCE; case 0: @@ -170,7 +170,7 @@ public WriteStatusCase getWriteStatusCase() { return WriteStatusCase.forNumber(writeStatusCase_); } - public static final int COMMITTED_SIZE_FIELD_NUMBER = 1; + public static final int PERSISTED_SIZE_FIELD_NUMBER = 1; /** * * @@ -179,12 +179,12 @@ public WriteStatusCase getWriteStatusCase() { * from all `WriteObject` calls. Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * - * @return Whether the committedSize field is set. + * @return Whether the persistedSize field is set. */ @java.lang.Override - public boolean hasCommittedSize() { + public boolean hasPersistedSize() { return writeStatusCase_ == 1; } /** @@ -195,12 +195,12 @@ public boolean hasCommittedSize() { * from all `WriteObject` calls. Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * - * @return The committedSize. + * @return The persistedSize. */ @java.lang.Override - public long getCommittedSize() { + public long getPersistedSize() { if (writeStatusCase_ == 1) { return (java.lang.Long) writeStatus_; } @@ -319,7 +319,7 @@ public boolean equals(final java.lang.Object obj) { if (!getWriteStatusCase().equals(other.getWriteStatusCase())) return false; switch (writeStatusCase_) { case 1: - if (getCommittedSize() != other.getCommittedSize()) return false; + if (getPersistedSize() != other.getPersistedSize()) return false; break; case 2: if (!getResource().equals(other.getResource())) return false; @@ -340,8 +340,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); switch (writeStatusCase_) { case 1: - hash = (37 * hash) + COMMITTED_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCommittedSize()); + hash = (37 * hash) + PERSISTED_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPersistedSize()); break; case 2: hash = (37 * hash) + RESOURCE_FIELD_NUMBER; @@ -585,9 +585,9 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.storage.v2.WriteObjectResponse other) { if (other == com.google.storage.v2.WriteObjectResponse.getDefaultInstance()) return this; switch (other.getWriteStatusCase()) { - case COMMITTED_SIZE: + case PERSISTED_SIZE: { - setCommittedSize(other.getCommittedSize()); + setPersistedSize(other.getPersistedSize()); break; } case RESOURCE: @@ -651,11 +651,11 @@ public Builder clearWriteStatus() { * from all `WriteObject` calls. Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * - * @return Whether the committedSize field is set. + * @return Whether the persistedSize field is set. */ - public boolean hasCommittedSize() { + public boolean hasPersistedSize() { return writeStatusCase_ == 1; } /** @@ -666,11 +666,11 @@ public boolean hasCommittedSize() { * from all `WriteObject` calls. Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * - * @return The committedSize. + * @return The persistedSize. */ - public long getCommittedSize() { + public long getPersistedSize() { if (writeStatusCase_ == 1) { return (java.lang.Long) writeStatus_; } @@ -684,12 +684,12 @@ public long getCommittedSize() { * from all `WriteObject` calls. Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * - * @param value The committedSize to set. + * @param value The persistedSize to set. * @return This builder for chaining. */ - public Builder setCommittedSize(long value) { + public Builder setPersistedSize(long value) { writeStatusCase_ = 1; writeStatus_ = value; onChanged(); @@ -703,11 +703,11 @@ public Builder setCommittedSize(long value) { * from all `WriteObject` calls. Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * * @return This builder for chaining. */ - public Builder clearCommittedSize() { + public Builder clearPersistedSize() { if (writeStatusCase_ == 1) { writeStatusCase_ = 0; writeStatus_ = null; diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponseOrBuilder.java index e587777b3..fe718a776 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponseOrBuilder.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponseOrBuilder.java @@ -31,11 +31,11 @@ public interface WriteObjectResponseOrBuilder * from all `WriteObject` calls. Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * - * @return Whether the committedSize field is set. + * @return Whether the persistedSize field is set. */ - boolean hasCommittedSize(); + boolean hasPersistedSize(); /** * * @@ -44,11 +44,11 @@ public interface WriteObjectResponseOrBuilder * from all `WriteObject` calls. Only set if the upload has not finalized. * * - * int64 committed_size = 1; + * int64 persisted_size = 1; * - * @return The committedSize. + * @return The persistedSize. */ - long getCommittedSize(); + long getPersistedSize(); /** * diff --git a/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto b/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto index a5fca6984..46170df1c 100644 --- a/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto +++ b/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto @@ -66,7 +66,7 @@ service Storage { // each following call to `Create`. If there is an error or the connection is // broken during the resumable `Create()`, the client should check the status // of the `Create()` by calling `QueryWriteStatus()` and continue writing from - // the returned `committed_size`. This may be less than the amount of data the + // the returned `persisted_size`. This may be less than the amount of data the // client previously sent. // // The service will not view the object as complete until the client has @@ -84,7 +84,7 @@ service Storage { rpc StartResumableWrite(StartResumableWriteRequest) returns (StartResumableWriteResponse) { } - // Determines the `committed_size` for an object that is being written, which + // Determines the `persisted_size` for an object that is being written, which // can then be used as the `write_offset` for the next `Write()` call. // // If the object does not exist (i.e., the object has been deleted, or the @@ -95,7 +95,7 @@ service Storage { // much data has been processed for this object. This is useful if the // client is buffering data and needs to know which data can be safely // evicted. For any sequence of `QueryWriteStatus()` calls for a given - // object name, the sequence of returned `committed_size` values will be + // object name, the sequence of returned `persisted_size` values will be // non-decreasing. rpc QueryWriteStatus(QueryWriteStatusRequest) returns (QueryWriteStatusResponse) { option (google.api.method_signature) = "upload_id"; @@ -236,7 +236,7 @@ message WriteObjectRequest { // // In the first `WriteObjectRequest` of a `WriteObject()` action, it // indicates the initial offset for the `Write()` call. The value **must** be - // equal to the `committed_size` that a call to `QueryWriteStatus()` would + // equal to the `persisted_size` that a call to `QueryWriteStatus()` would // return (0 if this is the first write to the object). // // On subsequent calls, this value **must** be no larger than the sum of the @@ -280,7 +280,7 @@ message WriteObjectResponse { oneof write_status { // The total number of bytes that have been processed for the given object // from all `WriteObject` calls. Only set if the upload has not finalized. - int64 committed_size = 1; + int64 persisted_size = 1; // A resource containing the metadata for the uploaded object. Only set if // the upload has finalized. @@ -309,7 +309,7 @@ message QueryWriteStatusResponse { // from all `WriteObject` calls. This is the correct value for the // 'write_offset' field to use when resuming the `WriteObject` operation. // Only set if the upload has not finalized. - int64 committed_size = 1; + int64 persisted_size = 1; // A resource containing the metadata for the uploaded object. Only set if // the upload has finalized. @@ -512,15 +512,17 @@ message Bucket { // Public Access Prevention config values. enum PublicAccessPrevention { - // Does not prevent access from being granted to public members 'allUsers' - // or 'allAuthenticatedUsers'. This setting may be enforced by Org Policy - // at the project/folder/organization level. + // No specified PublicAccessPrevention. PUBLIC_ACCESS_PREVENTION_UNSPECIFIED = 0; // Prevents access from being granted to public members 'allUsers' and // 'allAuthenticatedUsers'. Prevents attempts to grant new access to // public members. ENFORCED = 1; + + // This setting is inherited from Org Policy. Does not prevent access from + // being granted to public members 'allUsers' or 'allAuthenticatedUsers'. + INHERITED = 2; } // Bucket restriction options currently enforced on the bucket. @@ -796,7 +798,10 @@ message Bucket { // but won't be able to use zonal quota. The values are case-insensitive. // Attempting to update this field after bucket is created will result in an // error. - repeated string zone_affinity = 24 [(google.api.field_behavior) = IMMUTABLE]; + repeated string zone_affinity = 24 [ + deprecated = true, + (google.api.field_behavior) = IMMUTABLE + ]; // Reserved for future use. bool satisfies_pzs = 25; @@ -876,7 +881,8 @@ message Object { string encryption_algorithm = 1; // SHA256 hash value of the encryption key. - string key_sha256 = 2; + // In raw bytes format (not base64-encoded). + bytes key_sha256_bytes = 3; } // Immutable. The name of this object. Nearly any sequence of unicode characters is diff --git a/synth.metadata b/synth.metadata index 40a98002e..962316f57 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-storage.git", - "sha": "2e7f041ef7873ede8c2d1ebb526639d1aff61963" + "sha": "cdb86dcca17636ff7be59208361f8d42ab0858ba" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e1738ee972b49fd0c4d4718b035444495142b781", - "internalRef": "391407209" + "sha": "877d3d9d02591ad612a2c8654b42c37ba09ff9ec", + "internalRef": "402986756" } }, { From 88c03a2069a46767f10d533775db6d83662c3cf0 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 18 Oct 2021 13:31:30 -0400 Subject: [PATCH 28/28] chore: release 2.1.8 (#1068) * chore: release 2.1.8 * chore: fix changelog Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: BenWhitehead --- CHANGELOG.md | 12 ++++++++++++ gapic-google-cloud-storage-v2/pom.xml | 4 ++-- google-cloud-storage/pom.xml | 4 ++-- grpc-google-cloud-storage-v2/pom.xml | 4 ++-- pom.xml | 8 ++++---- proto-google-cloud-storage-v2/pom.xml | 4 ++-- versions.txt | 8 ++++---- 7 files changed, 28 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a5853102..a76a9b83b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +### [2.1.8](https://www.github.com/googleapis/java-storage/compare/v2.1.7...v2.1.8) (2021-10-18) + + +### Bug Fixes + +* regenerate google.cloud.storage.v2 protos ([a7e3b94](https://www.github.com/googleapis/java-storage/commit/a7e3b94e4a3e03599b0dbe51fbe574ed4ea1a0d8)) + + +### Dependencies + +* update kms.version to v0.93.1 ([#1079](https://www.github.com/googleapis/java-storage/issues/1079)) ([1c52b3d](https://www.github.com/googleapis/java-storage/commit/1c52b3db6699c2ad325853e95231e1a908da069f)) + ### [2.1.7](https://www.github.com/googleapis/java-storage/compare/v2.1.6...v2.1.7) (2021-10-04) diff --git a/gapic-google-cloud-storage-v2/pom.xml b/gapic-google-cloud-storage-v2/pom.xml index be01056bf..05e23b11f 100644 --- a/gapic-google-cloud-storage-v2/pom.xml +++ b/gapic-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc gapic-google-cloud-storage-v2 - 2.1.8-alpha-SNAPSHOT + 2.1.8-alpha gapic-google-cloud-storage-v2 GRPC library for gapic-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.1.8-SNAPSHOT + 2.1.8 diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml index 31550b59b..753acf5cb 100644 --- a/google-cloud-storage/pom.xml +++ b/google-cloud-storage/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-storage - 2.1.8-SNAPSHOT + 2.1.8 jar Google Cloud Storage https://github.com/googleapis/java-storage @@ -12,7 +12,7 @@ com.google.cloud google-cloud-storage-parent - 2.1.8-SNAPSHOT + 2.1.8 google-cloud-storage diff --git a/grpc-google-cloud-storage-v2/pom.xml b/grpc-google-cloud-storage-v2/pom.xml index cc1b8ef68..bdc7049c4 100644 --- a/grpc-google-cloud-storage-v2/pom.xml +++ b/grpc-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-storage-v2 - 2.1.8-alpha-SNAPSHOT + 2.1.8-alpha grpc-google-cloud-storage-v2 GRPC library for grpc-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.1.8-SNAPSHOT + 2.1.8 diff --git a/pom.xml b/pom.xml index 4da24992a..38902adfd 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-storage-parent pom - 2.1.8-SNAPSHOT + 2.1.8 Storage Parent https://github.com/googleapis/java-storage @@ -100,17 +100,17 @@ com.google.api.grpc proto-google-cloud-storage-v2 - 2.1.8-alpha-SNAPSHOT + 2.1.8-alpha com.google.api.grpc grpc-google-cloud-storage-v2 - 2.1.8-alpha-SNAPSHOT + 2.1.8-alpha com.google.api.grpc gapic-google-cloud-storage-v2 - 2.1.8-alpha-SNAPSHOT + 2.1.8-alpha com.google.cloud diff --git a/proto-google-cloud-storage-v2/pom.xml b/proto-google-cloud-storage-v2/pom.xml index 750d9d68e..cc632df4c 100644 --- a/proto-google-cloud-storage-v2/pom.xml +++ b/proto-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-storage-v2 - 2.1.8-alpha-SNAPSHOT + 2.1.8-alpha proto-google-cloud-storage-v2 PROTO library for proto-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.1.8-SNAPSHOT + 2.1.8 diff --git a/versions.txt b/versions.txt index 0c0a68da5..dc504597f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,7 +1,7 @@ # Format: # module:released-version:current-version -google-cloud-storage:2.1.7:2.1.8-SNAPSHOT -gapic-google-cloud-storage-v2:2.1.7-alpha:2.1.8-alpha-SNAPSHOT -grpc-google-cloud-storage-v2:2.1.7-alpha:2.1.8-alpha-SNAPSHOT -proto-google-cloud-storage-v2:2.1.7-alpha:2.1.8-alpha-SNAPSHOT +google-cloud-storage:2.1.8:2.1.8 +gapic-google-cloud-storage-v2:2.1.8-alpha:2.1.8-alpha +grpc-google-cloud-storage-v2:2.1.8-alpha:2.1.8-alpha +proto-google-cloud-storage-v2:2.1.8-alpha:2.1.8-alpha