Skip to content

Commit d015cf0

Browse files
authored
Merge branch 'main' into build-deps-upgrade-grpc-1.81.0
2 parents 1e85412 + 5251219 commit d015cf0

13 files changed

Lines changed: 833 additions & 133 deletions

File tree

generation/check_non_release_please_versions.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ for pomFile in $(find . -mindepth 2 -name pom.xml | sort ); do
2222
[[ "${pomFile}" =~ .*java-storage.* ]] || \
2323
[[ "${pomFile}" =~ .*java-storage-nio.* ]] || \
2424
[[ "${pomFile}" =~ .*java-vertexai.* ]] || \
25+
[[ "${pomFile}" =~ .*java-compute.* ]] || \
2526
[[ "${pomFile}" =~ .*.github*. ]]; then
2627
continue
2728
fi

google-cloud-jar-parent/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@
7777
<version>4.13.2</version>
7878
<scope>test</scope>
7979
</dependency>
80+
<dependency>
81+
<groupId>ch.qos.logback</groupId>
82+
<artifactId>logback-classic</artifactId>
83+
<version>1.5.25</version>
84+
<scope>test</scope>
85+
</dependency>
86+
<dependency>
87+
<groupId>ch.qos.logback</groupId>
88+
<artifactId>logback-core</artifactId>
89+
<version>1.5.25</version>
90+
<scope>test</scope>
91+
</dependency>
8092
<dependency>
8193
<groupId>joda-time</groupId>
8294
<artifactId>joda-time</artifactId>

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ protected boolean removeEldestEntry(Map.Entry<String, Map<String, String>> eldes
102102
static final String OAUTH_REFRESH_TOKEN_PROPERTY_NAME = "OAuthRefreshToken";
103103
static final String OAUTH_CLIENT_ID_PROPERTY_NAME = "OAuthClientId";
104104
static final String OAUTH_CLIENT_SECRET_PROPERTY_NAME = "OAuthClientSecret";
105+
static final String DEFAULT_OAUTH_CLIENT_ID = "977385342095.apps.googleusercontent.com";
106+
static final String DEFAULT_OAUTH_CLIENT_SECRET = "wbER7576mc_1YOII0dGk7jEE";
105107
static final String ENABLE_HTAPI_PROPERTY_NAME = "EnableHighThroughputAPI";
106108
static final String PROXY_HOST_PROPERTY_NAME = "ProxyHost";
107109
static final String PROXY_PORT_PROPERTY_NAME = "ProxyPort";

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,15 +960,19 @@ public void setDestinationDatasetExpirationTime(long destinationDatasetExpiratio
960960
}
961961

962962
public String getOAuthClientId() {
963-
return oAuthClientId;
963+
return oAuthClientId != null && !oAuthClientId.trim().isEmpty()
964+
? oAuthClientId
965+
: BigQueryJdbcUrlUtility.DEFAULT_OAUTH_CLIENT_ID;
964966
}
965967

966968
public void setOAuthClientId(String oAuthClientId) {
967969
this.oAuthClientId = oAuthClientId;
968970
}
969971

970972
public String getOAuthClientSecret() {
971-
return oAuthClientSecret;
973+
return oAuthClientSecret != null && !oAuthClientSecret.trim().isEmpty()
974+
? oAuthClientSecret
975+
: BigQueryJdbcUrlUtility.DEFAULT_OAUTH_CLIENT_SECRET;
972976
}
973977

974978
public void setOAuthClientSecret(String oAuthClientSecret) {

java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,22 @@ public void testParseOAuthPropsForUserAuth() {
218218
assertThat(authProperties.get("OAuthClientSecret")).isEqualTo("secret");
219219
}
220220

221+
@Test
222+
public void testParseOAuthPropsForUserAuthDefault() {
223+
Map<String, String> authProperties =
224+
BigQueryJdbcOAuthUtility.parseOAuthProperties(
225+
DataSource.fromUrl(
226+
"jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;"
227+
+ "OAuthType=1;ProjectId=MyBigQueryProject;"),
228+
null);
229+
230+
assertThat(authProperties.get("OAuthType")).isEqualTo("GOOGLE_USER_ACCOUNT");
231+
assertThat(authProperties.get("OAuthClientId"))
232+
.isEqualTo(BigQueryJdbcUrlUtility.DEFAULT_OAUTH_CLIENT_ID);
233+
assertThat(authProperties.get("OAuthClientSecret"))
234+
.isEqualTo(BigQueryJdbcUrlUtility.DEFAULT_OAUTH_CLIENT_SECRET);
235+
}
236+
221237
@Test
222238
public void testGenerateUserAuthURL() {
223239
try {

java-compute/google-cloud-compute/pom.xml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,49 @@
9292
<artifactId>google-cloud-core</artifactId>
9393
<scope>test</scope>
9494
</dependency>
95+
<dependency>
96+
<groupId>com.google.cloud</groupId>
97+
<artifactId>google-cloud-monitoring</artifactId>
98+
<version>3.93.0-SNAPSHOT</version> <!-- {x-version-update:google-cloud-monitoring:current} -->
99+
<scope>test</scope>
100+
</dependency>
101+
<dependency>
102+
<groupId>io.opentelemetry</groupId>
103+
<artifactId>opentelemetry-sdk</artifactId>
104+
<scope>test</scope>
105+
</dependency>
106+
<dependency>
107+
<groupId>io.opentelemetry</groupId>
108+
<artifactId>opentelemetry-exporter-otlp</artifactId>
109+
<scope>test</scope>
110+
</dependency>
111+
<dependency>
112+
<groupId>io.opentelemetry</groupId>
113+
<artifactId>opentelemetry-sdk-testing</artifactId>
114+
<scope>test</scope>
115+
</dependency>
116+
<!-- Logback dependencies are used to intercept logs for validation in tests, consistent with ITActionableErrorsLogging -->
117+
<dependency>
118+
<groupId>ch.qos.logback</groupId>
119+
<artifactId>logback-classic</artifactId>
120+
<scope>test</scope>
121+
</dependency>
122+
<dependency>
123+
<groupId>ch.qos.logback</groupId>
124+
<artifactId>logback-core</artifactId>
125+
<scope>test</scope>
126+
</dependency>
127+
<dependency>
128+
<groupId>com.google.cloud</groupId>
129+
<artifactId>google-cloud-trace</artifactId>
130+
<version>2.92.0-SNAPSHOT</version><!-- {x-version-update:google-cloud-trace:current} -->
131+
<scope>test</scope>
132+
</dependency>
133+
<dependency>
134+
<groupId>com.google.truth</groupId>
135+
<artifactId>truth</artifactId>
136+
<scope>test</scope>
137+
</dependency>
95138

96139
<!-- Need testing utility classes for generated REST clients tests -->
97140
<dependency>
@@ -105,6 +148,53 @@
105148
<artifactId>gax</artifactId>
106149
<classifier>testlib</classifier>
107150
<scope>test</scope>
151+
</dependency>
152+
<!-- Needed for trace client -->
153+
<dependency>
154+
<groupId>io.grpc</groupId>
155+
<artifactId>grpc-netty-shaded</artifactId>
156+
<scope>test</scope>
157+
</dependency>
158+
<dependency>
159+
<groupId>io.grpc</groupId>
160+
<artifactId>grpc-auth</artifactId>
161+
<scope>test</scope>
108162
</dependency>
109163
</dependencies>
164+
165+
<build>
166+
<plugins>
167+
<plugin>
168+
<groupId>org.apache.maven.plugins</groupId>
169+
<artifactId>maven-surefire-plugin</artifactId>
170+
<configuration>
171+
<environmentVariables>
172+
<GOOGLE_SDK_JAVA_LOGGING>true</GOOGLE_SDK_JAVA_LOGGING>
173+
</environmentVariables>
174+
</configuration>
175+
</plugin>
176+
<plugin>
177+
<groupId>org.apache.maven.plugins</groupId>
178+
<artifactId>maven-failsafe-plugin</artifactId>
179+
<configuration>
180+
<environmentVariables>
181+
<GOOGLE_SDK_JAVA_LOGGING>true</GOOGLE_SDK_JAVA_LOGGING>
182+
</environmentVariables>
183+
</configuration>
184+
</plugin>
185+
</plugins>
186+
</build>
187+
<profiles>
188+
<profile>
189+
<id>enable-integration-tests</id>
190+
<dependencies>
191+
<dependency>
192+
<groupId>org.slf4j</groupId>
193+
<artifactId>slf4j-api</artifactId>
194+
<version>2.0.16</version>
195+
<scope>test</scope>
196+
</dependency>
197+
</dependencies>
198+
</profile>
199+
</profiles>
110200
</project>

0 commit comments

Comments
 (0)