Skip to content

Commit 1eb9799

Browse files
authored
Merge branch 'main' into test/showcase-errordetails
2 parents 5d75a81 + 50d9513 commit 1eb9799

8 files changed

Lines changed: 777 additions & 1366 deletions

File tree

.github/workflows/create_additional_release_tag.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
release:
88
types: [published]
99
workflow_dispatch:
10+
inputs:
11+
target_ref:
12+
description: 'Git ref (tag or SHA) to check out and tag. Defaults to branch HEAD if empty.'
13+
required: false
14+
default: ''
1015
jobs:
1116
build:
1217
runs-on: ubuntu-latest
@@ -18,6 +23,7 @@ jobs:
1823
- name: Checkout code
1924
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2025
with:
26+
ref: ${{ inputs.target_ref || github.ref }}
2127
token: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
2228
persist-credentials: false
2329
- name: Set up Git
@@ -38,7 +44,7 @@ jobs:
3844
continue
3945
fi
4046
git tag $TAG_NAME
41-
git push origin $TAG_NAME
47+
git push https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git $TAG_NAME
4248
if [ "${ARTIFACT_ID}" = "libraries-bom" ]; then
4349
echo "Creating GitHub Release for ${TAG_NAME}"
4450
gh release create "${TAG_NAME}" --title "GCP Libraries BOM ${VERSION}" --notes "libraries-bom release."

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

Lines changed: 735 additions & 1255 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
import com.google.api.gax.paging.Page;
3333
import com.google.cloud.bigquery.*;
34-
import com.google.cloud.bigquery.BigQuery.RoutineListOption;
3534
import com.google.cloud.bigquery.exception.BigQueryJdbcException;
3635
import com.google.cloud.bigquery.jdbc.BigQueryJdbcTypeMappings.ColumnTypeInfo;
3736
import io.opentelemetry.api.common.AttributeKey;
@@ -49,11 +48,8 @@
4948
import java.sql.Statement;
5049
import java.sql.Types;
5150
import java.util.*;
52-
import java.util.concurrent.Callable;
53-
import java.util.concurrent.ExecutionException;
5451
import java.util.concurrent.ExecutorService;
5552
import java.util.concurrent.Executors;
56-
import java.util.concurrent.Future;
5753
import java.util.regex.Pattern;
5854
import java.util.stream.Stream;
5955
import org.junit.jupiter.api.AfterEach;
@@ -761,7 +757,7 @@ public void testProcessSchemaInfo() {
761757
String schemaName = "dataset_beta";
762758
Dataset dataset = mockBigQueryDataset(catalog, schemaName);
763759

764-
dbMetadata.processSchemaInfo(dataset, collectedResults, resultSchemaFields);
760+
dbMetadata.processSchemaInfo(dataset.getDatasetId(), collectedResults, resultSchemaFields);
765761

766762
assertEquals(1, collectedResults.size());
767763
FieldValueList row = collectedResults.get(0);
@@ -1614,96 +1610,6 @@ public void testDefineGetProcedureColumnsComparator() {
16141610
assertEquals("param_a", results.get(4).get("COLUMN_NAME").getStringValue());
16151611
}
16161612

1617-
@Test
1618-
public void testListMatchingProcedureIdsFromDatasets() throws Exception {
1619-
String catalog = "test-proj";
1620-
String schema1Name = "dataset1";
1621-
String schema2Name = "dataset2";
1622-
Dataset dataset1 = mockBigQueryDataset(catalog, schema1Name);
1623-
Dataset dataset2 = mockBigQueryDataset(catalog, schema2Name);
1624-
List<Dataset> datasetsToScan = Arrays.asList(dataset1, dataset2);
1625-
1626-
Routine proc1_ds1 = mockBigQueryRoutine(catalog, schema1Name, "proc_a", "PROCEDURE", "desc a");
1627-
Routine func1_ds1 = mockBigQueryRoutine(catalog, schema1Name, "func_b", "FUNCTION", "desc b");
1628-
Routine proc2_ds2 = mockBigQueryRoutine(catalog, schema2Name, "proc_c", "PROCEDURE", "desc c");
1629-
1630-
Page<Routine> page1 = mock(Page.class, withSettings().withoutAnnotations());
1631-
when(page1.iterateAll()).thenReturn(Arrays.asList(proc1_ds1, func1_ds1));
1632-
when(bigqueryClient.listRoutines(eq(dataset1.getDatasetId()), any(RoutineListOption.class)))
1633-
.thenReturn(page1);
1634-
1635-
Page<Routine> page2 = mock(Page.class, withSettings().withoutAnnotations());
1636-
when(page2.iterateAll()).thenReturn(Collections.singletonList(proc2_ds2));
1637-
when(bigqueryClient.listRoutines(eq(dataset2.getDatasetId()), any(RoutineListOption.class)))
1638-
.thenReturn(page2);
1639-
1640-
ExecutorService mockExecutor = mock(ExecutorService.class);
1641-
doAnswer(
1642-
invocation -> {
1643-
Callable<?> callable = invocation.getArgument(0);
1644-
@SuppressWarnings("unchecked") // Suppress warning for raw Future mock
1645-
Future<Object> mockedFuture = mock(Future.class);
1646-
1647-
try {
1648-
Object result = callable.call();
1649-
doReturn(result).when(mockedFuture).get();
1650-
} catch (InterruptedException interruptedException) {
1651-
doThrow(interruptedException).when(mockedFuture).get();
1652-
} catch (Exception e) {
1653-
doThrow(new ExecutionException(e)).when(mockedFuture).get();
1654-
}
1655-
return mockedFuture;
1656-
})
1657-
.when(mockExecutor)
1658-
.submit(any(Callable.class));
1659-
1660-
List<RoutineId> resultIds =
1661-
dbMetadata.listMatchingProcedureIdsFromDatasets(
1662-
datasetsToScan, null, null, mockExecutor, catalog, dbMetadata.LOG);
1663-
1664-
assertEquals(2, resultIds.size());
1665-
assertTrue(resultIds.contains(proc1_ds1.getRoutineId()));
1666-
assertTrue(resultIds.contains(proc2_ds2.getRoutineId()));
1667-
assertFalse(resultIds.contains(func1_ds1.getRoutineId())); // Should not contain functions
1668-
1669-
verify(mockExecutor, times(2)).submit(any(Callable.class));
1670-
}
1671-
1672-
@Test
1673-
public void testProcessProcedureArgumentsSequentially_Basic() throws InterruptedException {
1674-
String catalog = "p";
1675-
String schemaName = "d";
1676-
RoutineArgument arg1 = mockRoutineArgument("arg1_name", StandardSQLTypeName.STRING, "IN");
1677-
Routine proc1 =
1678-
mockBigQueryRoutineWithArgs(
1679-
catalog, schemaName, "proc1", "PROCEDURE", "desc1", Collections.singletonList(arg1));
1680-
Routine func1 =
1681-
mockBigQueryRoutineWithArgs(
1682-
catalog,
1683-
schemaName,
1684-
"func1",
1685-
"FUNCTION",
1686-
"desc_func",
1687-
Collections.emptyList()); // Should be skipped
1688-
Routine proc2 =
1689-
mockBigQueryRoutineWithArgs(
1690-
catalog, schemaName, "proc2", "PROCEDURE", "desc2", Collections.emptyList());
1691-
1692-
List<Routine> fullRoutines = Arrays.asList(proc1, func1, proc2);
1693-
Pattern columnNameRegex = null;
1694-
List<FieldValueList> collectedResults = Collections.synchronizedList(new ArrayList<>());
1695-
Schema resultSchema = dbMetadata.defineGetProcedureColumnsSchema();
1696-
FieldList resultSchemaFields = resultSchema.getFields();
1697-
1698-
dbMetadata.processProcedureArgumentsSequentially(
1699-
fullRoutines, columnNameRegex, collectedResults, resultSchemaFields, dbMetadata.LOG);
1700-
1701-
// Only proc1 has arguments, so collectedResults should contain 1 row.
1702-
assertEquals(1, collectedResults.size());
1703-
FieldValueList row = collectedResults.get(0);
1704-
assertEquals("arg1_name", row.get("COLUMN_NAME").getStringValue());
1705-
}
1706-
17071613
@Test
17081614
public void testDefineGetTableTypesSchema() {
17091615
Schema schema = BigQueryDatabaseMetaData.defineGetTableTypesSchema();

java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,10 @@ public Routine apply(com.google.api.services.bigquery.model.Routine routinePb) {
16591659

16601660
@Override
16611661
public InsertAllResponse insertAll(InsertAllRequest request) {
1662+
// This API inserts the specified rows into a table using the BigQuery insertAll API.
1663+
// Note: To prevent duplicate rows, this method does not perform automatic retries unless
1664+
// insert IDs are provided. Transient service errors (such as UNAVAILABLE) may be thrown and
1665+
// should be handled by the caller.
16621666
final TableId tableId =
16631667
request
16641668
.getTable()

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@
8787
<artifactId>google-cloud-core</artifactId>
8888
<scope>test</scope>
8989
</dependency>
90+
<dependency>
91+
<groupId>org.awaitility</groupId>
92+
<artifactId>awaitility</artifactId>
93+
<scope>test</scope>
94+
</dependency>
9095
<!-- {x-generated-grpc-dependencies-start} -->
9196
<dependency>
9297
<groupId>com.google.api.grpc</groupId>

java-dialogflow/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/it/ITSystemTest.java

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
*/
1616
package com.google.cloud.dialogflow.v2.it;
1717

18+
import static com.google.common.collect.Streams.stream;
19+
import static org.awaitility.Awaitility.await;
1820
import static org.junit.Assert.assertEquals;
21+
import static org.junit.Assert.assertTrue;
1922

2023
import com.google.cloud.ServiceOptions;
2124
import com.google.cloud.dialogflow.v2.Agent;
@@ -54,10 +57,10 @@
5457
import com.google.protobuf.Struct;
5558
import com.google.protobuf.Value;
5659
import java.io.IOException;
60+
import java.time.Duration;
5761
import java.util.UUID;
5862
import org.junit.AfterClass;
5963
import org.junit.BeforeClass;
60-
import org.junit.Ignore;
6164
import org.junit.Test;
6265

6366
public class ITSystemTest {
@@ -259,7 +262,6 @@ public void getIntentTest() {
259262
}
260263

261264
@Test
262-
@Ignore("b/423958346")
263265
public void detectIntentTest() {
264266
QueryInput queryInput =
265267
QueryInput.newBuilder()
@@ -279,22 +281,28 @@ public void detectIntentTest() {
279281
.setSession(SESSION_NAME.toString())
280282
.setQueryInput(queryInput)
281283
.build();
282-
DetectIntentResponse response = sessionsClient.detectIntent(request);
283-
QueryResult result = response.getQueryResult();
284-
assertEquals(EVENT_NAME, result.getQueryText());
285-
assertEquals(ACTION_NAME, result.getAction());
286-
assertEquals(DEFAULT_LANGUAGE_CODE, result.getLanguageCode());
287-
assertEquals(intent.getDisplayName(), result.getIntent().getDisplayName());
284+
await()
285+
.atMost(Duration.ofSeconds(30))
286+
.pollInterval(Duration.ofSeconds(2))
287+
.untilAsserted(
288+
() -> {
289+
DetectIntentResponse response = sessionsClient.detectIntent(request);
290+
QueryResult result = response.getQueryResult();
291+
assertEquals(EVENT_NAME, result.getQueryText());
292+
assertEquals(ACTION_NAME, result.getAction());
293+
assertEquals(DEFAULT_LANGUAGE_CODE, result.getLanguageCode());
294+
assertEquals(intent.getDisplayName(), result.getIntent().getDisplayName());
295+
});
288296
}
289297

290298
@Test
291-
@Ignore("b/423958346")
292299
public void listContextsTest() {
293300
ListContextsRequest request =
294301
ListContextsRequest.newBuilder().setParent(SESSION_NAME.toString()).build();
295-
for (Context actualContext : contextsClient.listContexts(request).iterateAll()) {
296-
assertEquals(context.getName(), actualContext.getName());
297-
}
302+
boolean contextNameInActualContext =
303+
stream(contextsClient.listContexts(request).iterateAll())
304+
.anyMatch(actualContext -> context.getName().equals(actualContext.getName()));
305+
assertTrue(contextNameInActualContext);
298306
}
299307

300308
@Test

librarian.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ default:
4949
google/analytics: com.google.analytics
5050
google/maps: com.google.maps
5151
google/shopping: com.google.shopping
52-
libraries_bom_version: 26.83.0
52+
libraries_bom_version: 26.86.0
5353
libraries:
5454
- name: accessapproval
5555
version: 2.97.0-SNAPSHOT

sdk-platform-java/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonConscryptUtils.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ private static Provider createProvider() {
8989
return Conscrypt.newProvider();
9090
} catch (SecurityException | LinkageError t) {
9191
LOG.log(
92-
Level.WARNING, "Conscrypt native libraries not available. Falling back to JDK TLS.", t);
92+
Level.FINE,
93+
"Conscrypt native library unavailable. Falling back to default JDK TLS.",
94+
t);
9395
return null;
9496
}
9597
}
@@ -124,7 +126,7 @@ public static NetHttpTransport.Builder configureConscryptSecurityProvider(
124126
// intercepts runtime socket configuration errors (e.g. unsupported groups or
125127
// closed socket) without swallowing JVM errors like OutOfMemoryError.
126128
LOG.log(
127-
Level.WARNING,
129+
Level.FINE,
128130
"Failed to set PQC named groups on Conscrypt socket. Falling back to Conscrypt"
129131
+ " default TLS groups.",
130132
e);

0 commit comments

Comments
 (0)