Skip to content

Commit 4c6b7e8

Browse files
chore: Re-generated to pick up changes from synthtool (googleapis#1023)
* changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * chore(java): detect sample-secrets in build.sh Fixes googleapis#904 Source-Author: Neenu Shaji <[email protected]> Source-Date: Wed Mar 24 15:50:02 2021 -0400 Source-Repo: googleapis/synthtool Source-Sha: bb854b6c048619e3be4e8b8ce8ed10aa74ea78ef Source-Link: googleapis/synthtool@bb854b6 * chore: remove staging bucket v2 not needed since we removed v2 solution - googleapis/synthtool#964 Source-Author: Emily Ball <[email protected]> Source-Date: Mon Mar 29 14:47:37 2021 -0700 Source-Repo: googleapis/synthtool Source-Sha: 572ef8f70edd9041f5bcfa71511aed6aecfc2098 Source-Link: googleapis/synthtool@572ef8f
1 parent 1e6e23f commit 4c6b7e8

9 files changed

Lines changed: 45 additions & 98 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@ jobs:
8080
- run: java -version
8181
- run: .kokoro/build.sh
8282
env:
83-
JOB_TYPE: clirr
83+
JOB_TYPE: clirr

.kokoro/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ samples)
7979

8080
if [[ -f ${SAMPLES_DIR}/pom.xml ]]
8181
then
82+
for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do
83+
[[ -f "$FILE" ]] || continue
84+
source "$FILE"
85+
done
86+
8287
pushd ${SAMPLES_DIR}
8388
mvn -B \
8489
-Penable-samples \

.kokoro/nightly/java7.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Configure the docker image for kokoro-trampoline.
4+
env_vars: {
5+
key: "TRAMPOLINE_IMAGE"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/java7"
7+
}

.kokoro/presubmit/java7.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Configure the docker image for kokoro-trampoline.
4+
env_vars: {
5+
key: "TRAMPOLINE_IMAGE"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/java7"
7+
}

.kokoro/release/publish_javadoc.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ if [[ -z "${STAGING_BUCKET}" ]]; then
2424
exit 1
2525
fi
2626

27-
if [[ -z "${STAGING_BUCKET_V2}" ]]; then
28-
echo "Need to set STAGING_BUCKET_V2 environment variable"
29-
exit 1
30-
fi
31-
3227
# work from the git root directory
3328
pushd $(dirname "$0")/../../
3429

CONTRIBUTING.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ Code Samples must be bundled in separate Maven modules, and guarded by a
5757
Maven profile with the name `enable-samples`.
5858

5959
The samples must be separate from the primary project for a few reasons:
60-
1. Many code samples depend on external GCP services and need
60+
1. Primary projects have a minimum Java version of Java 7 whereas samples have
61+
a minimum Java version of Java 8. Due to this we need the ability to
62+
selectively exclude samples from a build run.
63+
2. Many code samples depend on external GCP services and need
6164
credentials to access the service.
62-
2. Code samples are not released as Maven artifacts and must be excluded from
65+
3. Code samples are not released as Maven artifacts and must be excluded from
6366
release builds.
6467

6568
### Building

google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java

Lines changed: 12 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -980,9 +980,7 @@ public final GetDatabaseDdlResponse getDatabaseDdl(GetDatabaseDdlRequest request
980980
*
981981
* <pre>{@code
982982
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
983-
* ResourceName resource =
984-
* CryptoKeyVersionName.of(
985-
* "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
983+
* ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
986984
* Policy policy = Policy.newBuilder().build();
987985
* Policy response = databaseAdminClient.setIamPolicy(resource, policy);
988986
* }
@@ -1017,10 +1015,7 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) {
10171015
*
10181016
* <pre>{@code
10191017
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
1020-
* String resource =
1021-
* CryptoKeyVersionName.of(
1022-
* "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]")
1023-
* .toString();
1018+
* String resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
10241019
* Policy policy = Policy.newBuilder().build();
10251020
* Policy response = databaseAdminClient.setIamPolicy(resource, policy);
10261021
* }
@@ -1054,14 +1049,7 @@ public final Policy setIamPolicy(String resource, Policy policy) {
10541049
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
10551050
* SetIamPolicyRequest request =
10561051
* SetIamPolicyRequest.newBuilder()
1057-
* .setResource(
1058-
* CryptoKeyVersionName.of(
1059-
* "[PROJECT]",
1060-
* "[LOCATION]",
1061-
* "[KEY_RING]",
1062-
* "[CRYPTO_KEY]",
1063-
* "[CRYPTO_KEY_VERSION]")
1064-
* .toString())
1052+
* .setResource(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
10651053
* .setPolicy(Policy.newBuilder().build())
10661054
* .build();
10671055
* Policy response = databaseAdminClient.setIamPolicy(request);
@@ -1090,14 +1078,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
10901078
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
10911079
* SetIamPolicyRequest request =
10921080
* SetIamPolicyRequest.newBuilder()
1093-
* .setResource(
1094-
* CryptoKeyVersionName.of(
1095-
* "[PROJECT]",
1096-
* "[LOCATION]",
1097-
* "[KEY_RING]",
1098-
* "[CRYPTO_KEY]",
1099-
* "[CRYPTO_KEY_VERSION]")
1100-
* .toString())
1081+
* .setResource(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
11011082
* .setPolicy(Policy.newBuilder().build())
11021083
* .build();
11031084
* ApiFuture<Policy> future = databaseAdminClient.setIamPolicyCallable().futureCall(request);
@@ -1124,9 +1105,7 @@ public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
11241105
*
11251106
* <pre>{@code
11261107
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
1127-
* ResourceName resource =
1128-
* CryptoKeyVersionName.of(
1129-
* "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
1108+
* ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
11301109
* Policy response = databaseAdminClient.getIamPolicy(resource);
11311110
* }
11321111
* }</pre>
@@ -1157,10 +1136,7 @@ public final Policy getIamPolicy(ResourceName resource) {
11571136
*
11581137
* <pre>{@code
11591138
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
1160-
* String resource =
1161-
* CryptoKeyVersionName.of(
1162-
* "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]")
1163-
* .toString();
1139+
* String resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
11641140
* Policy response = databaseAdminClient.getIamPolicy(resource);
11651141
* }
11661142
* }</pre>
@@ -1190,14 +1166,7 @@ public final Policy getIamPolicy(String resource) {
11901166
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
11911167
* GetIamPolicyRequest request =
11921168
* GetIamPolicyRequest.newBuilder()
1193-
* .setResource(
1194-
* CryptoKeyVersionName.of(
1195-
* "[PROJECT]",
1196-
* "[LOCATION]",
1197-
* "[KEY_RING]",
1198-
* "[CRYPTO_KEY]",
1199-
* "[CRYPTO_KEY_VERSION]")
1200-
* .toString())
1169+
* .setResource(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
12011170
* .setOptions(GetPolicyOptions.newBuilder().build())
12021171
* .build();
12031172
* Policy response = databaseAdminClient.getIamPolicy(request);
@@ -1227,14 +1196,7 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
12271196
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
12281197
* GetIamPolicyRequest request =
12291198
* GetIamPolicyRequest.newBuilder()
1230-
* .setResource(
1231-
* CryptoKeyVersionName.of(
1232-
* "[PROJECT]",
1233-
* "[LOCATION]",
1234-
* "[KEY_RING]",
1235-
* "[CRYPTO_KEY]",
1236-
* "[CRYPTO_KEY_VERSION]")
1237-
* .toString())
1199+
* .setResource(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
12381200
* .setOptions(GetPolicyOptions.newBuilder().build())
12391201
* .build();
12401202
* ApiFuture<Policy> future = databaseAdminClient.getIamPolicyCallable().futureCall(request);
@@ -1261,9 +1223,7 @@ public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
12611223
*
12621224
* <pre>{@code
12631225
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
1264-
* ResourceName resource =
1265-
* CryptoKeyVersionName.of(
1266-
* "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
1226+
* ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
12671227
* List<String> permissions = new ArrayList<>();
12681228
* TestIamPermissionsResponse response =
12691229
* databaseAdminClient.testIamPermissions(resource, permissions);
@@ -1301,10 +1261,7 @@ public final TestIamPermissionsResponse testIamPermissions(
13011261
*
13021262
* <pre>{@code
13031263
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
1304-
* String resource =
1305-
* CryptoKeyVersionName.of(
1306-
* "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]")
1307-
* .toString();
1264+
* String resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
13081265
* List<String> permissions = new ArrayList<>();
13091266
* TestIamPermissionsResponse response =
13101267
* databaseAdminClient.testIamPermissions(resource, permissions);
@@ -1344,14 +1301,7 @@ public final TestIamPermissionsResponse testIamPermissions(
13441301
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
13451302
* TestIamPermissionsRequest request =
13461303
* TestIamPermissionsRequest.newBuilder()
1347-
* .setResource(
1348-
* CryptoKeyVersionName.of(
1349-
* "[PROJECT]",
1350-
* "[LOCATION]",
1351-
* "[KEY_RING]",
1352-
* "[CRYPTO_KEY]",
1353-
* "[CRYPTO_KEY_VERSION]")
1354-
* .toString())
1304+
* .setResource(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
13551305
* .addAllPermissions(new ArrayList<String>())
13561306
* .build();
13571307
* TestIamPermissionsResponse response = databaseAdminClient.testIamPermissions(request);
@@ -1381,14 +1331,7 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
13811331
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
13821332
* TestIamPermissionsRequest request =
13831333
* TestIamPermissionsRequest.newBuilder()
1384-
* .setResource(
1385-
* CryptoKeyVersionName.of(
1386-
* "[PROJECT]",
1387-
* "[LOCATION]",
1388-
* "[KEY_RING]",
1389-
* "[CRYPTO_KEY]",
1390-
* "[CRYPTO_KEY_VERSION]")
1391-
* .toString())
1334+
* .setResource(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
13921335
* .addAllPermissions(new ArrayList<String>())
13931336
* .build();
13941337
* ApiFuture<TestIamPermissionsResponse> future =

google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import com.google.spanner.admin.database.v1.BackupName;
4949
import com.google.spanner.admin.database.v1.CreateBackupRequest;
5050
import com.google.spanner.admin.database.v1.CreateDatabaseRequest;
51-
import com.google.spanner.admin.database.v1.CryptoKeyVersionName;
5251
import com.google.spanner.admin.database.v1.Database;
5352
import com.google.spanner.admin.database.v1.DatabaseName;
5453
import com.google.spanner.admin.database.v1.DeleteBackupRequest;
@@ -651,9 +650,7 @@ public void setIamPolicyTest() throws Exception {
651650
.build();
652651
mockDatabaseAdmin.addResponse(expectedResponse);
653652

654-
ResourceName resource =
655-
CryptoKeyVersionName.of(
656-
"[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
653+
ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
657654
Policy policy = Policy.newBuilder().build();
658655

659656
Policy actualResponse = client.setIamPolicy(resource, policy);
@@ -677,9 +674,7 @@ public void setIamPolicyExceptionTest() throws Exception {
677674
mockDatabaseAdmin.addException(exception);
678675

679676
try {
680-
ResourceName resource =
681-
CryptoKeyVersionName.of(
682-
"[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
677+
ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
683678
Policy policy = Policy.newBuilder().build();
684679
client.setIamPolicy(resource, policy);
685680
Assert.fail("No exception raised");
@@ -741,9 +736,7 @@ public void getIamPolicyTest() throws Exception {
741736
.build();
742737
mockDatabaseAdmin.addResponse(expectedResponse);
743738

744-
ResourceName resource =
745-
CryptoKeyVersionName.of(
746-
"[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
739+
ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
747740

748741
Policy actualResponse = client.getIamPolicy(resource);
749742
Assert.assertEquals(expectedResponse, actualResponse);
@@ -765,9 +758,7 @@ public void getIamPolicyExceptionTest() throws Exception {
765758
mockDatabaseAdmin.addException(exception);
766759

767760
try {
768-
ResourceName resource =
769-
CryptoKeyVersionName.of(
770-
"[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
761+
ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
771762
client.getIamPolicy(resource);
772763
Assert.fail("No exception raised");
773764
} catch (InvalidArgumentException e) {
@@ -821,9 +812,7 @@ public void testIamPermissionsTest() throws Exception {
821812
TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList<String>()).build();
822813
mockDatabaseAdmin.addResponse(expectedResponse);
823814

824-
ResourceName resource =
825-
CryptoKeyVersionName.of(
826-
"[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
815+
ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
827816
List<String> permissions = new ArrayList<>();
828817

829818
TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions);
@@ -847,9 +836,7 @@ public void testIamPermissionsExceptionTest() throws Exception {
847836
mockDatabaseAdmin.addException(exception);
848837

849838
try {
850-
ResourceName resource =
851-
CryptoKeyVersionName.of(
852-
"[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
839+
ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
853840
List<String> permissions = new ArrayList<>();
854841
client.testIamPermissions(resource, permissions);
855842
Assert.fail("No exception raised");

synth.metadata

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/java-spanner.git",
7-
"sha": "4088981314097647e3ed79f2c748545cac6fc34e"
7+
"sha": "1e6e23f8d64cd16d5e5034c89c65283b3b0cae89"
88
}
99
},
1010
{
@@ -19,7 +19,7 @@
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "0b064d767537e0675fc053e53fca473c5c701fb8"
22+
"sha": "572ef8f70edd9041f5bcfa71511aed6aecfc2098"
2323
}
2424
}
2525
],

0 commit comments

Comments
 (0)