From 86fb58f61720e3634f8579588c8d4d1482c61a0a Mon Sep 17 00:00:00 2001 From: MV Shiva Prasad Date: Mon, 1 Jun 2026 22:51:23 +0530 Subject: [PATCH 1/4] buildscripts: add regional td config for psm-interop --- buildscripts/kokoro/psm-regional_td.cfg | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 buildscripts/kokoro/psm-regional_td.cfg diff --git a/buildscripts/kokoro/psm-regional_td.cfg b/buildscripts/kokoro/psm-regional_td.cfg new file mode 100644 index 00000000000..80351d86b94 --- /dev/null +++ b/buildscripts/kokoro/psm-regional_td.cfg @@ -0,0 +1,17 @@ +# Config file for internal CI + +# Location of the continuous shell script in repository. +build_file: "grpc-java/buildscripts/kokoro/psm-interop-test-java.sh" +timeout_mins: 30 + +action { + define_artifacts { + regex: "artifacts/**/*sponge_log.xml" + regex: "artifacts/**/*.log" + strip_prefix: "artifacts" + } +} +env_vars { + key: "PSM_TEST_SUITE" + value: "regional-td" +} From b3b3e1eddc1aa426b2646f15a273a82ec6e09e1a Mon Sep 17 00:00:00 2001 From: MV Shiva Date: Tue, 2 Jun 2026 09:01:52 +0530 Subject: [PATCH 2/4] Rename PSM_TEST_SUITE value from 'regional-td' to 'regional_td' --- buildscripts/kokoro/psm-regional_td.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildscripts/kokoro/psm-regional_td.cfg b/buildscripts/kokoro/psm-regional_td.cfg index 80351d86b94..60c7258e2da 100644 --- a/buildscripts/kokoro/psm-regional_td.cfg +++ b/buildscripts/kokoro/psm-regional_td.cfg @@ -13,5 +13,5 @@ action { } env_vars { key: "PSM_TEST_SUITE" - value: "regional-td" + value: "regional_td" } From eb6265c585a2a6bc4b7a83ee1d4174fe6e831890 Mon Sep 17 00:00:00 2001 From: MV Shiva Prasad Date: Thu, 11 Jun 2026 14:07:35 +0530 Subject: [PATCH 3/4] drop the whole query --- .../GoogleCloudToProdNameResolver.java | 16 +++------------- .../GoogleCloudToProdNameResolverTest.java | 12 ++++++------ 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/googleapis/src/main/java/io/grpc/googleapis/GoogleCloudToProdNameResolver.java b/googleapis/src/main/java/io/grpc/googleapis/GoogleCloudToProdNameResolver.java index 10ba586ab47..488eaa8c75f 100644 --- a/googleapis/src/main/java/io/grpc/googleapis/GoogleCloudToProdNameResolver.java +++ b/googleapis/src/main/java/io/grpc/googleapis/GoogleCloudToProdNameResolver.java @@ -135,8 +135,6 @@ private static synchronized BootstrapInfo getBootstrapInfo(boolean isForcedXds) QueryParams queryParams = QueryParams.fromRawQuery(grpcUri.getRawQuery()); this.forceXds = checkForceXds(queryParams); this.schemeOverride = (forceXds || isOnGcp) ? "xds" : "dns"; - stripForceXds(queryParams); - String newQuery = queryParams.toRawQuery(); Preconditions.checkArgument( targetPath.startsWith("/"), @@ -147,7 +145,7 @@ private static synchronized BootstrapInfo getBootstrapInfo(boolean isForcedXds) syncContext = checkNotNull(args, "args").getSynchronizationContext(); Uri.Builder modifiedTargetBuilder = grpcUri.toBuilder().setScheme(schemeOverride); - modifiedTargetBuilder.setRawQuery(newQuery); + modifiedTargetBuilder.setRawQuery(null); if (schemeOverride.equals("xds")) { modifiedTargetBuilder.setRawAuthority(C2P_AUTHORITY); } @@ -180,8 +178,6 @@ private static synchronized BootstrapInfo getBootstrapInfo(boolean isForcedXds) QueryParams queryParams = QueryParams.fromRawQuery(targetUri.getRawQuery()); this.forceXds = checkForceXds(queryParams); this.schemeOverride = (forceXds || isOnGcp) ? "xds" : "dns"; - stripForceXds(queryParams); - String newQuery = queryParams.toRawQuery(); Preconditions.checkArgument( targetUri.isPathAbsolute(), @@ -195,11 +191,7 @@ private static synchronized BootstrapInfo getBootstrapInfo(boolean isForcedXds) authority = GrpcUtil.checkAuthority(pathSegments.get(0)); syncContext = checkNotNull(args, "args").getSynchronizationContext(); Uri.Builder modifiedTargetBuilder = targetUri.toBuilder().setScheme(schemeOverride); - if (newQuery != null) { - modifiedTargetBuilder.setRawQuery(newQuery); - } else { - modifiedTargetBuilder.setRawQuery(null); - } + modifiedTargetBuilder.setRawQuery(null); if (schemeOverride.equals("xds")) { modifiedTargetBuilder.setRawAuthority(C2P_AUTHORITY); @@ -411,9 +403,7 @@ private static boolean checkForceXds(QueryParams params) { return false; } - private static void stripForceXds(QueryParams params) { - params.asList().removeIf(entry -> "force-xds".equals(entry.getKey())); - } + private enum HttpConnectionFactory implements HttpConnectionProvider { INSTANCE; diff --git a/googleapis/src/test/java/io/grpc/googleapis/GoogleCloudToProdNameResolverTest.java b/googleapis/src/test/java/io/grpc/googleapis/GoogleCloudToProdNameResolverTest.java index bbd3ba3ef05..e48f9ad5716 100644 --- a/googleapis/src/test/java/io/grpc/googleapis/GoogleCloudToProdNameResolverTest.java +++ b/googleapis/src/test/java/io/grpc/googleapis/GoogleCloudToProdNameResolverTest.java @@ -252,11 +252,11 @@ public void notOnGcpButForceXds_WithMultipleParams_DelegateToXds() { if (enableRfc3986UrisParam) { Uri delegatedRfcUriValue = delegatedRfcUri.get("xds"); assertThat(delegatedRfcUriValue).isNotNull(); - assertThat(delegatedRfcUriValue.getRawQuery()).isEqualTo("foo=bar&baz=qux"); + assertThat(delegatedRfcUriValue.getRawQuery()).isNull(); } else { URI delegatedUriValue = delegatedUri.get("xds"); assertThat(delegatedUriValue).isNotNull(); - assertThat(delegatedUriValue.getQuery()).isEqualTo("foo=bar&baz=qux"); + assertThat(delegatedUriValue.getQuery()).isNull(); } } @@ -276,11 +276,11 @@ public void notOnGcpButForceXds_WithEncodedAmpersand_DelegateToXds() { if (enableRfc3986UrisParam) { Uri delegatedRfcUriValue = delegatedRfcUri.get("xds"); assertThat(delegatedRfcUriValue).isNotNull(); - assertThat(delegatedRfcUriValue.getRawQuery()).isEqualTo("foo=bar%26baz"); + assertThat(delegatedRfcUriValue.getRawQuery()).isNull(); } else { URI delegatedUriValue = delegatedUri.get("xds"); assertThat(delegatedUriValue).isNotNull(); - assertThat(delegatedUriValue.getRawQuery()).isEqualTo("foo=bar%26baz"); + assertThat(delegatedUriValue.getRawQuery()).isNull(); } } @@ -299,11 +299,11 @@ public void notOnGcpButForceXds_CaseSensitive_DelegateToDns() { if (enableRfc3986UrisParam) { Uri delegatedRfcUriValue = delegatedRfcUri.get("dns"); assertThat(delegatedRfcUriValue).isNotNull(); - assertThat(delegatedRfcUriValue.getRawQuery()).isEqualTo("FORCE-XDS"); + assertThat(delegatedRfcUriValue.getRawQuery()).isNull(); } else { URI delegatedUriValue = delegatedUri.get("dns"); assertThat(delegatedUriValue).isNotNull(); - assertThat(delegatedUriValue.getQuery()).isEqualTo("FORCE-XDS"); + assertThat(delegatedUriValue.getQuery()).isNull(); } } From 2c0d77874d368629cb504b7dbdc79b7e8a0dffec Mon Sep 17 00:00:00 2001 From: MV Shiva Prasad Date: Thu, 11 Jun 2026 14:26:01 +0530 Subject: [PATCH 4/4] add test to verify ignore multiple dups and support ?force-xds=foo --- .../GoogleCloudToProdNameResolverTest.java | 51 ++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/googleapis/src/test/java/io/grpc/googleapis/GoogleCloudToProdNameResolverTest.java b/googleapis/src/test/java/io/grpc/googleapis/GoogleCloudToProdNameResolverTest.java index e48f9ad5716..0251b3477b5 100644 --- a/googleapis/src/test/java/io/grpc/googleapis/GoogleCloudToProdNameResolverTest.java +++ b/googleapis/src/test/java/io/grpc/googleapis/GoogleCloudToProdNameResolverTest.java @@ -212,9 +212,9 @@ public void notOnGcpButForceXds_DelegateToXds() { } @Test - public void notOnGcpButForceXds_KeyValueTrue_DelegateToXds() { + public void notOnGcpButForceXds_WithValue_DelegateToXds() { GoogleCloudToProdNameResolver.isOnGcp = false; - String target = TARGET_URI + "?force-xds=true"; + String target = TARGET_URI + "?force-xds=foo"; resolver = enableRfc3986UrisParam ? new GoogleCloudToProdNameResolver( Uri.create(target), args, fakeExecutorResource, nsRegistry.asFactory()) @@ -235,6 +235,53 @@ public void notOnGcpButForceXds_KeyValueTrue_DelegateToXds() { } } + @Test + public void notOnGcpButForceXds_PercentEncoded_DelegateToXds() { + GoogleCloudToProdNameResolver.isOnGcp = false; + String target = TARGET_URI + "?force%2Dxds"; + resolver = enableRfc3986UrisParam + ? new GoogleCloudToProdNameResolver( + Uri.create(target), args, fakeExecutorResource, nsRegistry.asFactory()) + : new GoogleCloudToProdNameResolver( + URI.create(target), args, fakeExecutorResource, nsRegistry.asFactory()); + resolver.start(mockListener); + fakeExecutor.runDueTasks(); + assertThat(delegatedResolver.keySet()).containsExactly("xds"); + + if (enableRfc3986UrisParam) { + Uri delegatedRfcUriValue = delegatedRfcUri.get("xds"); + assertThat(delegatedRfcUriValue).isNotNull(); + assertThat(delegatedRfcUriValue.getRawQuery()).isNull(); + } else { + URI delegatedUriValue = delegatedUri.get("xds"); + assertThat(delegatedUriValue).isNotNull(); + assertThat(delegatedUriValue.getQuery()).isNull(); + } + } + + @Test + public void notOnGcpButForceXds_DuplicateKeys_DelegateToXds() { + GoogleCloudToProdNameResolver.isOnGcp = false; + String target = TARGET_URI + "?force-xds=&force-xds=true"; + resolver = enableRfc3986UrisParam + ? new GoogleCloudToProdNameResolver( + Uri.create(target), args, fakeExecutorResource, nsRegistry.asFactory()) + : new GoogleCloudToProdNameResolver( + URI.create(target), args, fakeExecutorResource, nsRegistry.asFactory()); + resolver.start(mockListener); + fakeExecutor.runDueTasks(); + assertThat(delegatedResolver.keySet()).containsExactly("xds"); + + if (enableRfc3986UrisParam) { + Uri delegatedRfcUriValue = delegatedRfcUri.get("xds"); + assertThat(delegatedRfcUriValue).isNotNull(); + assertThat(delegatedRfcUriValue.getRawQuery()).isNull(); + } else { + URI delegatedUriValue = delegatedUri.get("xds"); + assertThat(delegatedUriValue).isNotNull(); + assertThat(delegatedUriValue.getQuery()).isNull(); + } + } @Test public void notOnGcpButForceXds_WithMultipleParams_DelegateToXds() {