diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 3d2f828246..dddb13b845 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:a4d7b2cfc6a9d6b378a6b2458740eae15fcab28854bd23dad3a15102d2e47c87 + digest: sha256:7f737996c88586c499f7b0c25294c760f9f5eec092289a0e08d2d3f42a069ebb diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index dcbafdd94e..cef26db6ee 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -21,7 +21,7 @@ If you are still having issues, please include as much information as possible: General, Core, and Other are also allowed as types 2. OS type and version: 3. Java version: -4. storage version(s): +4. version(s): #### Steps to reproduce diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 12069c39b4..7ac519891b 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -47,15 +47,15 @@ set +e case ${JOB_TYPE} in test) - mvn test -B -Dclirr.skip=true -Denforcer.skip=true + mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true RETURN_CODE=$? ;; lint) - mvn com.coveo:fmt-maven-plugin:check + mvn com.coveo:fmt-maven-plugin:check -B -ntp RETURN_CODE=$? ;; javadoc) - mvn javadoc:javadoc javadoc:test-javadoc + mvn javadoc:javadoc javadoc:test-javadoc -B -ntp RETURN_CODE=$? ;; integration) @@ -71,7 +71,7 @@ integration) ;; graalvm) # Run Unit and Integration Tests with Native Image - mvn -ntp -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test RETURN_CODE=$? ;; samples) @@ -104,7 +104,7 @@ samples) fi ;; clirr) - mvn -B -Denforcer.skip=true clirr:check + mvn -B -ntp -Denforcer.skip=true clirr:check RETURN_CODE=$? ;; *) diff --git a/.repo-metadata.json b/.repo-metadata.json index b258be10a6..19bef9ed4f 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -1,5 +1,5 @@ { - "name": "storage", + "api_shortname": "storage", "name_pretty": "Cloud Storage", "product_documentation": "https://cloud.google.com/storage", "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-storage/latest/history", diff --git a/CHANGELOG.md b/CHANGELOG.md index e8df0f99ac..7efbf8faf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [2.3.0](https://github.com/googleapis/java-storage/compare/v2.2.3...v2.3.0) (2022-01-12) + + +### Features + +* Add RPO metadata settings ([#1105](https://github.com/googleapis/java-storage/issues/1105)) ([6f9dfdf](https://github.com/googleapis/java-storage/commit/6f9dfdfdbf9f1466839a17ef97489f207f18bec6)) + + +### Bug Fixes + +* **java:** run Maven in plain console-friendly mode ([#1301](https://github.com/googleapis/java-storage/issues/1301)) ([#1186](https://github.com/googleapis/java-storage/issues/1186)) ([1e55dba](https://github.com/googleapis/java-storage/commit/1e55dba4cd5111472b9bb05db08ba7e47fafe762)) +* Remove all client side validation for OLM, allow nonspecific lif… ([#1160](https://github.com/googleapis/java-storage/issues/1160)) ([5a160ee](https://github.com/googleapis/java-storage/commit/5a160eee2b80e3d392df9d73dfc30ca9cd665764)) + + +### Dependencies + +* update dependency org.easymock:easymock to v4 ([#1198](https://github.com/googleapis/java-storage/issues/1198)) ([558520f](https://github.com/googleapis/java-storage/commit/558520f35ed64f0b36f7f8ada4491023a0fb759e)) +* update kms.version to v0.94.1 ([#1195](https://github.com/googleapis/java-storage/issues/1195)) ([cc999b1](https://github.com/googleapis/java-storage/commit/cc999b1ebaba051524ce6131052c824232ccb79a)) + ### [2.2.3](https://www.github.com/googleapis/java-storage/compare/v2.2.2...v2.2.3) (2022-01-07) diff --git a/README.md b/README.md index d05eed117a..74b8cdce00 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 24.1.2 + 24.2.0 pom import @@ -41,7 +41,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-storage - 2.2.2 + 2.2.3 ``` @@ -49,20 +49,20 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:24.1.2') +implementation platform('com.google.cloud:libraries-bom:24.2.0') implementation 'com.google.cloud:google-cloud-storage' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-storage:2.2.2' +implementation 'com.google.cloud:google-cloud-storage:2.2.3' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.2.2" +libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.2.3" ``` ## Authentication diff --git a/gapic-google-cloud-storage-v2/pom.xml b/gapic-google-cloud-storage-v2/pom.xml index c5ff8f7d29..cced03f789 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.2.3-alpha + 2.3.0-alpha gapic-google-cloud-storage-v2 GRPC library for gapic-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.2.3 + 2.3.0 diff --git a/google-cloud-storage/clirr-ignored-differences.xml b/google-cloud-storage/clirr-ignored-differences.xml index 85c4887d6f..c45b439cc3 100644 --- a/google-cloud-storage/clirr-ignored-differences.xml +++ b/google-cloud-storage/clirr-ignored-differences.xml @@ -1,39 +1,14 @@ - - 7012 - com/google/cloud/storage/Storage - *.Blob createFrom(*.BlobInfo, java.nio.file.Path, *.Storage$BlobWriteOption[]) - - - 7012 - com/google/cloud/storage/Storage - *.Blob createFrom(*.BlobInfo, java.io.InputStream, *.Storage$BlobWriteOption[]) - - - 7012 - com/google/cloud/storage/spi/v1/StorageRpc - *.StorageObject writeWithResponse(*.String, byte[], int, long, int, boolean) - com/google/cloud/storage/BucketInfo$Builder - com.google.cloud.storage.BucketInfo$Builder deleteLifecycleRules() + com.google.cloud.storage.BucketInfo$Builder setRpo(com.google.cloud.storage.Rpo) 7013 - com/google/cloud/storage/BucketInfo$Builder - com.google.cloud.storage.BucketInfo$Builder setUpdateTime(java.lang.Long) - 7013 - - - com/google/cloud/storage/spi/v1/StorageRpc - long getCurrentUploadOffset(java.lang.String) - 7012 - - - com/google/cloud/storage/spi/v1/StorageRpc - com.google.api.services.storage.model.StorageObject queryCompletedResumableUpload(java.lang.String, long) - 7012 + com/google/cloud/storage/BucketInfo$LifecycleRule$LifecycleAction + BucketInfo$LifecycleRule$LifecycleAction() + 7004 diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml index f222ab150b..1e2ea02f3f 100644 --- a/google-cloud-storage/pom.xml +++ b/google-cloud-storage/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-storage - 2.2.3 + 2.3.0 jar Google Cloud Storage https://github.com/googleapis/java-storage @@ -12,11 +12,11 @@ com.google.cloud google-cloud-storage-parent - 2.2.3 + 2.3.0 google-cloud-storage - 0.94.0 + 0.94.1 diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java index 3714e6e94a..95acd19d63 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java @@ -577,6 +577,12 @@ public Builder deleteLifecycleRules() { return this; } + @Override + public Builder setRpo(Rpo rpo) { + infoBuilder.setRpo(rpo); + return this; + } + @Override public Builder setStorageClass(StorageClass storageClass) { infoBuilder.setStorageClass(storageClass); diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java index 83a836f785..5e06b6ce24 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java @@ -92,6 +92,7 @@ public com.google.api.services.storage.model.Bucket apply(BucketInfo bucketInfo) private final List acl; private final List defaultAcl; private final String location; + private final Rpo rpo; private final StorageClass storageClass; private final Map labels; private final String defaultKmsKeyName; @@ -548,8 +549,13 @@ static LifecycleRule fromPb(Rule rule) { StorageClass.valueOf(action.getStorageClass())); break; default: - throw new UnsupportedOperationException( - "The specified lifecycle action " + action.getType() + " is not currently supported"); + log.warning( + "The lifecycle action " + + action.getType() + + " is not supported by this version of the library. " + + "Attempting to update with this rule may cause errors. Please " + + "update to the latest version of google-cloud-storage."); + lifecycleAction = LifecycleAction.newLifecycleAction("Unknown action"); } Rule.Condition condition = rule.getCondition(); @@ -799,13 +805,21 @@ public LifecycleCondition build() { } /** - * Base class for the Action to take when a Lifecycle Condition is met. Specific Actions are + * Base class for the Action to take when a Lifecycle Condition is met. Supported Actions are * expressed as subclasses of this class, accessed by static factory methods. */ - public abstract static class LifecycleAction implements Serializable { + public static class LifecycleAction implements Serializable { private static final long serialVersionUID = 5801228724709173284L; - public abstract String getActionType(); + private final String actionType; + + public LifecycleAction(String actionType) { + this.actionType = actionType; + } + + public String getActionType() { + return actionType; + } @Override public String toString() { @@ -830,17 +844,24 @@ public static SetStorageClassLifecycleAction newSetStorageClassAction( StorageClass storageClass) { return new SetStorageClassLifecycleAction(storageClass); } + + /** + * Creates a new {@code LifecycleAction , with no specific supported action associated with it. This + * is only intended as a "backup" for when the library doesn't recognize the type, and should + * generally not be used, instead use the supported actions, and upgrade the library if necessary + * to get new supported actions. + */ + public static LifecycleAction newLifecycleAction(String actionType) { + return new LifecycleAction(actionType); + } } public static class DeleteLifecycleAction extends LifecycleAction { public static final String TYPE = "Delete"; private static final long serialVersionUID = -2050986302222644873L; - private DeleteLifecycleAction() {} - - @Override - public String getActionType() { - return TYPE; + private DeleteLifecycleAction() { + super(TYPE); } } @@ -851,14 +872,10 @@ public static class SetStorageClassLifecycleAction extends LifecycleAction { private final StorageClass storageClass; private SetStorageClassLifecycleAction(StorageClass storageClass) { + super(TYPE); this.storageClass = storageClass; } - @Override - public String getActionType() { - return TYPE; - } - @Override public String toString() { return MoreObjects.toStringHelper(this) @@ -1007,7 +1024,11 @@ static class RawDeleteRule extends DeleteRule { @Override void populateCondition(Rule.Condition condition) { - throw new UnsupportedOperationException(); + log.warning( + "The lifecycle condition " + + condition + + " is not currently supported. Please update to the latest version of google-cloud-java." + + " Also, use LifecycleRule rather than the deprecated DeleteRule."); } private void writeObject(ObjectOutputStream out) throws IOException { @@ -1185,6 +1206,15 @@ public abstract static class Builder { /** Deletes the lifecycle rules of this bucket. */ public abstract Builder deleteLifecycleRules(); + /** + * Sets the bucket's Recovery Point Objective (RPO). This can only be set for a dual-region + * bucket, and determines the speed at which data will be replicated between regions. See the + * {@code Rpo} class for supported values, and here for additional + * details. + */ + public abstract Builder setRpo(Rpo rpo); + /** * Sets the bucket's storage class. This defines how blobs in the bucket are stored and * determines the SLA and the cost of storage. A list of supported values is available deleteRules; private List lifecycleRules; + private Rpo rpo; private StorageClass storageClass; private String location; private String etag; @@ -1317,6 +1348,7 @@ static final class BuilderImpl extends Builder { updateTime = bucketInfo.updateTime; metageneration = bucketInfo.metageneration; location = bucketInfo.location; + rpo = bucketInfo.rpo; storageClass = bucketInfo.storageClass; cors = bucketInfo.cors; acl = bucketInfo.acl; @@ -1410,6 +1442,12 @@ public Builder deleteLifecycleRules() { return this; } + @Override + public Builder setRpo(Rpo rpo) { + this.rpo = rpo; + return this; + } + @Override public Builder setStorageClass(StorageClass storageClass) { this.storageClass = storageClass; @@ -1548,6 +1586,7 @@ public BucketInfo build() { updateTime = builder.updateTime; metageneration = builder.metageneration; location = builder.location; + rpo = builder.rpo; storageClass = builder.storageClass; cors = builder.cors; acl = builder.acl; @@ -1709,6 +1748,16 @@ public String getLocationType() { return locationType; } + /** + * Returns the bucket's recovery point objective (RPO). This defines how quickly data is + * replicated between regions in a dual-region bucket. Not defined for single-region buckets. + * + * @see + */ + public Rpo getRpo() { + return rpo; + } + /** * Returns the bucket's storage class. This defines how blobs in the bucket are stored and * determines the SLA and the cost of storage. @@ -1879,6 +1928,9 @@ com.google.api.services.storage.model.Bucket toPb() { if (locationType != null) { bucketPb.setLocationType(locationType); } + if (rpo != null) { + bucketPb.setRpo(rpo.toString()); + } if (storageClass != null) { bucketPb.setStorageClass(storageClass.toString()); } @@ -2042,6 +2094,9 @@ static BucketInfo fromPb(com.google.api.services.storage.model.Bucket bucketPb) if (bucketPb.getLocation() != null) { builder.setLocation(bucketPb.getLocation()); } + if (bucketPb.getRpo() != null) { + builder.setRpo(Rpo.valueOf(bucketPb.getRpo())); + } if (bucketPb.getStorageClass() != null) { builder.setStorageClass(StorageClass.valueOf(bucketPb.getStorageClass())); } diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Rpo.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Rpo.java new file mode 100644 index 0000000000..ca6a4b0abf --- /dev/null +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Rpo.java @@ -0,0 +1,70 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.storage; + +import com.google.api.core.ApiFunction; +import com.google.cloud.StringEnumType; +import com.google.cloud.StringEnumValue; + +/** + * Enums for the Recovery Point Objective (RPO) of dual-region buckets, which determines how fast + * data is replicated between regions. + * + * @see https://cloud.google.com/storage/docs/turbo-replication + */ +public final class Rpo extends StringEnumValue { + + private static final long serialVersionUID = -3954216195295821508L; + + private Rpo(String constant) { + super(constant); + } + + private static final ApiFunction CONSTRUCTOR = Rpo::new; + + private static final StringEnumType type = new StringEnumType<>(Rpo.class, CONSTRUCTOR); + + /** + * Default recovery point objective. With this setting, there is no guarantee on the amount of + * time it takes for data to replicate between regions. + */ + public static final Rpo DEFAULT = type.createAndRegister("DEFAULT"); + + /** + * Turbo recovery point objective. With this setting, data in a dual-region bucket will replicate + * between regions within 15 minutes. + */ + public static final Rpo ASYNC_TURBO = type.createAndRegister("ASYNC_TURBO"); + + /** + * Get the Rpo for the given String constant, and throw an exception if the constant is not + * recognized. + */ + public static Rpo valueOfStrict(String constant) { + return type.valueOfStrict(constant); + } + + /** Get the Rpo for the given String constant, and allow unrecognized values. */ + public static Rpo valueOf(String constant) { + return type.valueOf(constant); + } + + /** Return the known values for Rpo. */ + public static Rpo[] values() { + return type.values(); + } +} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketInfoTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketInfoTest.java index c74625a154..2041de556a 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketInfoTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketInfoTest.java @@ -314,6 +314,10 @@ public void testDeleteRules() { for (DeleteRule delRule : rules) { assertEquals(delRule, DeleteRule.fromPb(delRule.toPb())); } + Rule unsupportedRule = + new Rule().setAction(new Rule.Action().setType("This action doesn't exist")); + DeleteRule.fromPb( + unsupportedRule); // if this doesn't throw an exception, unsupported rules work } @Test @@ -363,6 +367,17 @@ public void testLifecycleRules() { assertEquals(StorageClass.COLDLINE.toString(), lifecycleRule.getAction().getStorageClass()); assertEquals(30, lifecycleRule.getCondition().getDaysSinceCustomTime().intValue()); assertNotNull(lifecycleRule.getCondition().getCustomTimeBefore()); + + Rule unsupportedRule = + new LifecycleRule( + LifecycleAction.newLifecycleAction("This action type doesn't exist"), + LifecycleCondition.newBuilder().setAge(10).build()) + .toPb(); + unsupportedRule.setAction( + unsupportedRule.getAction().setType("This action type also doesn't exist")); + + LifecycleRule.fromPb( + unsupportedRule); // If this doesn't throw an exception, unsupported rules are working } @Test diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java index 2307f03749..ad8dc6c036 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java @@ -69,9 +69,11 @@ import com.google.cloud.storage.Cors; import com.google.cloud.storage.DataGeneration; import com.google.cloud.storage.HmacKey; +import com.google.cloud.storage.HmacKey.HmacKeyState; import com.google.cloud.storage.HttpMethod; import com.google.cloud.storage.PostPolicyV4; import com.google.cloud.storage.PostPolicyV4.PostFieldsV4; +import com.google.cloud.storage.Rpo; import com.google.cloud.storage.ServiceAccount; import com.google.cloud.storage.Storage; import com.google.cloud.storage.Storage.BlobField; @@ -2426,8 +2428,11 @@ public void testBlobAcl() { @Test public void testHmacKey() { - ServiceAccount serviceAccount = ServiceAccount.of(System.getenv("IT_SERVICE_ACCOUNT_EMAIL")); + String serviceAccountEmail = System.getenv("IT_SERVICE_ACCOUNT_EMAIL"); + assertNotNull("Unable to determine service account email", serviceAccountEmail); + ServiceAccount serviceAccount = ServiceAccount.of(serviceAccountEmail); try { + cleanUpHmacKeys(serviceAccount); HmacKey hmacKey = storage.createHmacKey(serviceAccount); String secretKey = hmacKey.getSecretKey(); @@ -2500,10 +2505,18 @@ public void testHmacKey() { assertEquals(2, Iterators.size(metadatas.getValues().iterator())); } finally { - Page metadatas = - storage.listHmacKeys(Storage.ListHmacKeysOption.serviceAccount(serviceAccount)); - for (HmacKey.HmacKeyMetadata hmacKeyMetadata : metadatas.iterateAll()) { - storage.updateHmacKeyState(hmacKeyMetadata, HmacKey.HmacKeyState.INACTIVE); + cleanUpHmacKeys(serviceAccount); + } + } + + private void cleanUpHmacKeys(ServiceAccount serviceAccount) { + Page metadatas = + storage.listHmacKeys(Storage.ListHmacKeysOption.serviceAccount(serviceAccount)); + for (HmacKey.HmacKeyMetadata hmacKeyMetadata : metadatas.iterateAll()) { + if (hmacKeyMetadata.getState() == HmacKeyState.ACTIVE) { + hmacKeyMetadata = storage.updateHmacKeyState(hmacKeyMetadata, HmacKeyState.INACTIVE); + } + if (hmacKeyMetadata.getState() == HmacKeyState.INACTIVE) { storage.deleteHmacKey(hmacKeyMetadata); } } @@ -3939,4 +3952,33 @@ protected Object handleInvocation( blobGen2.downloadTo(actualData); assertEquals(contentGen2Expected, ByteBuffer.wrap(actualData.toByteArray())); } + + @Test + public void testRpoConfig() { + String rpoBucket = RemoteStorageHelper.generateBucketName(); + try { + Bucket bucket = + storage.create( + BucketInfo.newBuilder(rpoBucket).setLocation("NAM4").setRpo(Rpo.ASYNC_TURBO).build()); + assertEquals("ASYNC_TURBO", bucket.getRpo().toString()); + + bucket.toBuilder().setRpo(Rpo.DEFAULT).build().update(); + + assertEquals("DEFAULT", storage.get(rpoBucket).getRpo().toString()); + } finally { + storage.delete(rpoBucket); + } + } + + private static String randString(Random rand, int length) { + final StringBuilder sb = new StringBuilder(); + while (sb.length() < length) { + int i = rand.nextInt('z'); + char c = (char) i; + if (Character.isLetter(c) || Character.isDigit(c)) { + sb.append(c); + } + } + return sb.toString(); + } } diff --git a/grpc-google-cloud-storage-v2/pom.xml b/grpc-google-cloud-storage-v2/pom.xml index 4c8245977b..fb06743f93 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.2.3-alpha + 2.3.0-alpha grpc-google-cloud-storage-v2 GRPC library for grpc-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.2.3 + 2.3.0 diff --git a/pom.xml b/pom.xml index dceaef1779..ac89d29e09 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-storage-parent pom - 2.2.3 + 2.3.0 Storage Parent https://github.com/googleapis/java-storage @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.2.4 + 1.2.5 @@ -70,7 +70,7 @@ com.google.cloud google-cloud-storage - 2.2.3 + 2.3.0 com.google.apis @@ -80,7 +80,7 @@ org.easymock easymock - 3.6 + 4.3 test @@ -99,28 +99,28 @@ org.objenesis objenesis - 2.6 + 3.2 test com.google.api.grpc proto-google-cloud-storage-v2 - 2.2.3-alpha + 2.3.0-alpha com.google.api.grpc grpc-google-cloud-storage-v2 - 2.2.3-alpha + 2.3.0-alpha com.google.api.grpc gapic-google-cloud-storage-v2 - 2.2.3-alpha + 2.3.0-alpha com.google.cloud google-cloud-conformance-tests - 0.2.5 + 0.2.6 test diff --git a/proto-google-cloud-storage-v2/clirr-ignored-differences.xml b/proto-google-cloud-storage-v2/clirr-ignored-differences.xml index 7aa1b87fd4..41f673887d 100644 --- a/proto-google-cloud-storage-v2/clirr-ignored-differences.xml +++ b/proto-google-cloud-storage-v2/clirr-ignored-differences.xml @@ -1,56 +1,19 @@ - + - - - - - 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(*) - + + 7012 + com/google/storage/v2/*OrBuilder + * get*(*) + + + 7012 + com/google/storage/v2/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/storage/v2/*OrBuilder + boolean has*(*) + diff --git a/proto-google-cloud-storage-v2/pom.xml b/proto-google-cloud-storage-v2/pom.xml index 36464dd78e..6699c308d8 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.2.3-alpha + 2.3.0-alpha proto-google-cloud-storage-v2 PROTO library for proto-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.2.3 + 2.3.0 diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 8718f906e7..7acbcf5f1a 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.2.2 + 2.2.3 @@ -53,7 +53,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add-snippets-source diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ad787782fb..b512cf00e7 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-storage - 2.2.2 + 2.2.3 @@ -52,7 +52,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add-snippets-source diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 16b471a39b..eab2416596 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 24.1.2 + 24.2.0 pom import diff --git a/samples/snippets/src/main/java/com/example/storage/ConfigureRetries.java b/samples/snippets/src/main/java/com/example/storage/ConfigureRetries.java index 9d037a8215..e1db27ab02 100644 --- a/samples/snippets/src/main/java/com/example/storage/ConfigureRetries.java +++ b/samples/snippets/src/main/java/com/example/storage/ConfigureRetries.java @@ -15,6 +15,7 @@ */ package com.example.storage; + // [START storage_configure_retries] import com.google.api.gax.retrying.RetrySettings; diff --git a/versions.txt b/versions.txt index 96fb7f451d..d57985b38c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,7 +1,7 @@ # Format: # module:released-version:current-version -google-cloud-storage:2.2.3:2.2.3 -gapic-google-cloud-storage-v2:2.2.3-alpha:2.2.3-alpha -grpc-google-cloud-storage-v2:2.2.3-alpha:2.2.3-alpha -proto-google-cloud-storage-v2:2.2.3-alpha:2.2.3-alpha +google-cloud-storage:2.3.0:2.3.0 +gapic-google-cloud-storage-v2:2.3.0-alpha:2.3.0-alpha +grpc-google-cloud-storage-v2:2.3.0-alpha:2.3.0-alpha +proto-google-cloud-storage-v2:2.3.0-alpha:2.3.0-alpha