Skip to content

Commit 553367a

Browse files
authored
Merge branch 'googleapis:main' into directpath-bound-token
2 parents 5088865 + 4fde024 commit 553367a

File tree

8 files changed

+38
-14
lines changed

8 files changed

+38
-14
lines changed

google-cloud-storage/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</parent>
1717
<properties>
1818
<site.installationModule>google-cloud-storage</site.installationModule>
19-
<pubsub-proto.version>1.118.1</pubsub-proto.version>
19+
<pubsub-proto.version>1.119.0</pubsub-proto.version>
2020
</properties>
2121
<dependencies>
2222
<dependency>

google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
import com.google.cloud.storage.UnifiedOpts.ProjectId;
7070
import com.google.cloud.storage.UnifiedOpts.UserProject;
7171
import com.google.common.annotations.VisibleForTesting;
72+
import com.google.common.base.Suppliers;
7273
import com.google.common.collect.ImmutableList;
7374
import com.google.common.collect.ImmutableSet;
7475
import com.google.common.collect.Streams;
@@ -130,6 +131,7 @@
130131
import java.util.concurrent.TimeUnit;
131132
import java.util.function.Consumer;
132133
import java.util.function.Predicate;
134+
import java.util.function.Supplier;
133135
import java.util.function.UnaryOperator;
134136
import java.util.stream.Stream;
135137
import java.util.stream.StreamSupport;
@@ -167,7 +169,7 @@ final class GrpcStorageImpl extends BaseService<StorageOptions>
167169

168170
// workaround for https://github.com/googleapis/java-storage/issues/1736
169171
private final Opts<UserProject> defaultOpts;
170-
@Deprecated private final ProjectId defaultProjectId;
172+
@Deprecated private final Supplier<ProjectId> defaultProjectId;
171173

172174
GrpcStorageImpl(
173175
GrpcStorageOptions options,
@@ -183,7 +185,7 @@ final class GrpcStorageImpl extends BaseService<StorageOptions>
183185
this.codecs = Conversions.grpc();
184186
this.retryAlgorithmManager = options.getRetryAlgorithmManager();
185187
this.syntaxDecoders = new SyntaxDecoders();
186-
this.defaultProjectId = UnifiedOpts.projectId(options.getProjectId());
188+
this.defaultProjectId = Suppliers.memoize(() -> UnifiedOpts.projectId(options.getProjectId()));
187189
}
188190

189191
@Override
@@ -443,6 +445,7 @@ public Page<Bucket> list(BucketListOption... options) {
443445
opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault());
444446
ListBucketsRequest request =
445447
defaultProjectId
448+
.get()
446449
.listBuckets()
447450
.andThen(opts.listBucketsRequest())
448451
.apply(ListBucketsRequest.newBuilder())

google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5036,6 +5036,8 @@ default BlobWriteSession blobWriteSession(BlobInfo blobInfo, BlobWriteOption...
50365036
* {@link Storage#delete(BlobId)}, however without the ability to change metadata fields for the
50375037
* target object.
50385038
*
5039+
* <p>This feature is currently only supported for HNS (Hierarchical Namespace) buckets.
5040+
*
50395041
* @since 2.48.0
50405042
*/
50415043
@TransportCompatibility({Transport.HTTP, Transport.GRPC})

google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageOptionsTest.java

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import com.google.cloud.storage.it.runner.annotations.Parameterized.ParametersProvider;
3434
import com.google.cloud.storage.it.runner.annotations.SingleBackend;
3535
import com.google.common.collect.ImmutableList;
36-
import org.junit.Ignore;
3736
import org.junit.Test;
3837
import org.junit.runner.RunWith;
3938

@@ -73,12 +72,32 @@ public void clientShouldConstructCleanly_grpc() throws Exception {
7372
}
7473

7574
@Test
76-
@Ignore("waiting on conformation from the backend team if this should even be possible")
7775
public void clientShouldConstructCleanly_directPath() throws Exception {
7876
assumeTrue(
7977
"Unable to determine environment can access directPath", TestUtils.isOnComputeEngine());
8078
StorageOptions options =
81-
StorageOptions.grpc().setCredentials(credentials).setAttemptDirectPath(true).build();
79+
StorageOptions.grpc()
80+
.setCredentials(credentials)
81+
.setAttemptDirectPath(true)
82+
.setEnableGrpcClientMetrics(false)
83+
.build();
84+
doTest(options);
85+
}
86+
87+
@Test
88+
public void lackOfProjectIdDoesNotPreventConstruction_http() throws Exception {
89+
StorageOptions options = StorageOptions.http().setCredentials(credentials).build();
90+
doTest(options);
91+
}
92+
93+
@Test
94+
public void lackOfProjectIdDoesNotPreventConstruction_grpc() throws Exception {
95+
StorageOptions options =
96+
StorageOptions.grpc()
97+
.setCredentials(credentials)
98+
.setAttemptDirectPath(false)
99+
.setEnableGrpcClientMetrics(false)
100+
.build();
82101
doTest(options);
83102
}
84103

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
<dependency>
134134
<groupId>com.google.cloud</groupId>
135135
<artifactId>google-cloud-pubsub</artifactId>
136-
<version>1.136.1</version>
136+
<version>1.137.0</version>
137137
<scope>test</scope>
138138
</dependency>
139139
<dependency>

samples/install-without-bom/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
<dependency>
3131
<groupId>com.google.cloud</groupId>
3232
<artifactId>google-cloud-storage</artifactId>
33-
<version>2.48.1</version>
33+
<version>2.48.2</version>
3434
</dependency>
3535
<dependency>
3636
<groupId>com.google.cloud</groupId>
3737
<artifactId>google-cloud-storage-control</artifactId>
38-
<version>2.48.1</version>
38+
<version>2.48.2</version>
3939
</dependency>
4040
<!-- [END storage_install_without_bom] -->
4141

@@ -66,13 +66,13 @@
6666
<dependency>
6767
<groupId>com.google.cloud</groupId>
6868
<artifactId>google-cloud-pubsub</artifactId>
69-
<version>1.136.1</version>
69+
<version>1.137.0</version>
7070
<scope>test</scope>
7171
</dependency>
7272
<dependency>
7373
<groupId>com.google.cloud</groupId>
7474
<artifactId>google-cloud-storage</artifactId>
75-
<version>2.48.1</version>
75+
<version>2.48.2</version>
7676
<classifier>tests</classifier>
7777
<scope>test</scope>
7878
</dependency>

samples/snapshot/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<dependency>
5959
<groupId>com.google.cloud</groupId>
6060
<artifactId>google-cloud-pubsub</artifactId>
61-
<version>1.136.1</version>
61+
<version>1.137.0</version>
6262
<scope>test</scope>
6363
</dependency>
6464
<dependency>

samples/snippets/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<dependency>
7777
<groupId>com.google.cloud</groupId>
7878
<artifactId>google-cloud-pubsub</artifactId>
79-
<version>1.136.1</version>
79+
<version>1.137.0</version>
8080
<scope>test</scope>
8181
</dependency>
8282
<dependency>
@@ -93,7 +93,7 @@
9393
<!-- tests jars aren't in the bom, manually include the version here -->
9494
<groupId>com.google.cloud</groupId>
9595
<artifactId>google-cloud-storage</artifactId>
96-
<version>2.48.1</version>
96+
<version>2.48.2</version>
9797
<classifier>tests</classifier>
9898
<scope>test</scope>
9999
</dependency>

0 commit comments

Comments
 (0)