Skip to content

Commit 0c841f9

Browse files
chore: regenerate files from googleapis and synthtool templates (#300)
* Integrate Python GAPIC Microgenerator in googleapis. This PR uses using documentai as an example. Depends on googleapis/gapic-generator-python#402 PiperOrigin-RevId: 309824146 Source-Author: Google APIs <[email protected]> Source-Date: Mon May 4 15:06:44 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: e0f9d9e1f9de890db765be46f45ca8490723e3eb Source-Link: googleapis/googleapis@e0f9d9e * ci(java): switch to GitHub Actions * ci: switch to GitHub Actions * update based on comment Source-Author: Stephanie Wang <[email protected]> Source-Date: Mon May 11 12:54:00 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 55cdc844877d97139f25004229842624a6a86a02 Source-Link: googleapis/synthtool@55cdc84 * chore: move ci.yaml to workflows dir Source-Author: Stephanie Wang <[email protected]> Source-Date: Mon May 11 16:24:04 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 98c50772ec23295c64cf0d2ddf199ea52961fd4c Source-Link: googleapis/synthtool@98c5077 * docs: update CONTRIBUTING.md to include code formatting Co-authored-by: Jeff Ching <[email protected]> Co-authored-by: Jeffrey Rennie <[email protected]> Source-Author: Brian Chen <[email protected]> Source-Date: Tue May 12 10:24:59 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 5b48b0716a36ca069db3038da7e205c87a22ed19 Source-Link: googleapis/synthtool@5b48b07 * fix: restore GAPIC v2 retry configs Restores GAPIC v2 retry config overrides that were mistakenly removed during migration. PiperOrigin-RevId: 312088359 Source-Author: Google APIs <[email protected]> Source-Date: Mon May 18 08:57:12 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 5a90d467aa65e7f038f87585e8fbb45d74475e7c Source-Link: googleapis/googleapis@5a90d46 * bazel: update protobuf, rules_go, gazelle, and gapic-generator-go versions - protobuf v3.12.1 - rules_go v0.23.0 - gazelle v0.21.0 - gapic-generator-go v0.14.1 PiperOrigin-RevId: 313460921 Source-Author: Google APIs <[email protected]> Source-Date: Wed May 27 14:10:16 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: c4e37010d74071851ff24121f522e802231ac86e Source-Link: googleapis/googleapis@c4e3701 * firestore: add BatchWrite PiperOrigin-RevId: 314471006 Source-Author: Google APIs <[email protected]> Source-Date: Tue Jun 2 22:32:52 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: d5fe42c39cd35f95131a0267314ae108ab1bef8d Source-Link: googleapis/googleapis@d5fe42c * chore: turn on renovate-bot master issue for java repos Source-Author: Stephanie Wang <[email protected]> Source-Date: Thu Jun 4 18:23:16 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: cac9eef310652bf138dd76b716e4986e757d62ac Source-Link: googleapis/synthtool@cac9eef * build(java): skip lint on samples directory Let the samples test decide how to enforce linting Source-Author: Jeff Ching <[email protected]> Source-Date: Fri Jun 5 13:40:10 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 987270824bd26f6a8c716d5e2022057b8ae7b26e Source-Link: googleapis/synthtool@9872708 * chore: set Ruby namespace in proto options PiperOrigin-RevId: 316123861 Source-Author: Google APIs <[email protected]> Source-Date: Fri Jun 12 10:03:16 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 66f959b51c255dd6bef79ef221865e53a50df878 Source-Link: googleapis/googleapis@66f959b * ci(java): switch to secret manager from keystore * ci(java): switch to secret manager from keystore, use java-docs-samples user for samples tests * fix: we don't need to supply a service account Source-Author: Jeff Ching <[email protected]> Source-Date: Mon Jun 15 11:45:21 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: d1addcdf80aa9ddef8c932c89c919024bbad7af3 Source-Link: googleapis/synthtool@d1addcd * feat: retry CommitRequests that fail with UNAVAILABLE PiperOrigin-RevId: 316514901 Source-Author: Google APIs <[email protected]> Source-Date: Mon Jun 15 12:00:19 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 9b170a4f3beb16f7dab513520a07be48fcb88670 Source-Link: googleapis/googleapis@9b170a4 * samples(java): fix bad character in samples.cfg from copy/paste Somehow an invisible character was copy/pasted into the file and Kokoro cannot parse the file. Source-Author: Jeff Ching <[email protected]> Source-Date: Mon Jun 15 15:42:10 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 6d3eed67a45fd58f9c7bfa173c32e4fd4fed058f Source-Link: googleapis/synthtool@6d3eed6 * ci(java): run dependency test on Java 8 and 11 Redo fix in #633 with proper jinja templating format Source-Author: Jeff Ching <[email protected]> Source-Date: Fri Jun 19 16:52:15 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 4f2c9f752a94042472fc03c5bd9e06e89817d2bd Source-Link: googleapis/synthtool@4f2c9f7 * firestore: add BatchWrite to service config PiperOrigin-RevId: 318331819 Source-Author: Google APIs <[email protected]> Source-Date: Thu Jun 25 13:02:29 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 0a602be7b3835b51d59daf8f6f5dc2dc22f69d7e Source-Link: googleapis/googleapis@0a602be * firestore: add BatchWrite to gapic yaml PiperOrigin-RevId: 319105199 Source-Author: Google APIs <[email protected]> Source-Date: Tue Jun 30 14:56:36 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: cbd6f1d28bc0c461c234f9848bcbc1563126daf9 Source-Link: googleapis/googleapis@cbd6f1d * chore: update integration and samples credentials Co-authored-by: BenWhitehead <[email protected]>
1 parent 03b3705 commit 0c841f9

File tree

160 files changed

+11248
-2001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+11248
-2001
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,14 @@ jobs:
3636
JOB_TYPE: test
3737
dependencies:
3838
runs-on: ubuntu-latest
39+
strategy:
40+
matrix:
41+
java: [8, 11]
3942
steps:
4043
- uses: actions/checkout@v2
4144
- uses: actions/setup-java@v1
4245
with:
43-
java-version: 8
46+
java-version: ${{matrix.java}}
4447
- run: java -version
4548
- run: .kokoro/dependencies.sh
4649
linkage-monitor:

.kokoro/build.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ retry_with_backoff 3 10 \
3939

4040
# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it
4141
if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then
42-
export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_ROOT}/src/${GOOGLE_APPLICATION_CREDENTIALS})
42+
export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS})
4343
fi
4444

4545
RETURN_CODE=0
@@ -51,9 +51,7 @@ test)
5151
RETURN_CODE=$?
5252
;;
5353
lint)
54-
mvn \
55-
-Penable-samples \
56-
com.coveo:fmt-maven-plugin:check
54+
mvn com.coveo:fmt-maven-plugin:check
5755
RETURN_CODE=$?
5856
;;
5957
javadoc)

.kokoro/dependencies.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************"
4141
## Run dependency list completeness check
4242
function completenessCheck() {
4343
# Output dep list with compile scope generated using the original pom
44+
# Running mvn dependency:list on Java versions that support modules will also include the module of the dependency.
45+
# This is stripped from the output as it is not present in the flattened pom.
4446
msg "Generating dependency list using original pom..."
45-
mvn dependency:list -f pom.xml -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | grep -v ':test$' >.org-list.txt
47+
mvn dependency:list -f pom.xml -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// | grep -v ':test$' >.org-list.txt
4648

4749
# Output dep list generated using the flattened pom (test scope deps are ommitted)
4850
msg "Generating dependency list using flattened pom..."

.kokoro/nightly/integration.cfg

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,25 @@ env_vars: {
1313
# TODO: remove this after we've migrated all tests and scripts
1414
env_vars: {
1515
key: "GCLOUD_PROJECT"
16-
value: "gcloud-devel"
16+
value: "java-review"
1717
}
1818

1919
env_vars: {
2020
key: "GOOGLE_CLOUD_PROJECT"
21-
value: "gcloud-devel"
21+
value: "java-review"
2222
}
2323

2424
env_vars: {
25-
key: "ENABLE_BUILD_COP"
26-
value: "true"
25+
key: "GOOGLE_APPLICATION_CREDENTIALS"
26+
value: "secret_manager/java-review_firestore-java-it"
2727
}
2828

2929
env_vars: {
30-
key: "GOOGLE_APPLICATION_CREDENTIALS"
31-
value: "keystore/73713_java_it_service_account"
30+
key: "SECRET_MANAGER_KEYS"
31+
value: "java-review_firestore-java-it"
3232
}
3333

34-
before_action {
35-
fetch_keystore {
36-
keystore_resource {
37-
keystore_config_id: 73713
38-
keyname: "java_firestore_it_service_account"
39-
}
40-
}
34+
env_vars: {
35+
key: "ENABLE_BUILD_COP"
36+
value: "true"
4137
}

.kokoro/nightly/samples.cfg

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,25 @@ env_vars: {
1414
# TODO: remove this after we've migrated all tests and scripts
1515
env_vars: {
1616
key: "GCLOUD_PROJECT"
17-
value: "java-docs-samples-testing"
17+
value: "java-review"
1818
}
1919

2020
env_vars: {
2121
key: "GOOGLE_CLOUD_PROJECT"
22-
value: "java-docs-samples-testing"
22+
value: "java-review"
2323
}
2424

2525
env_vars: {
2626
key: "GOOGLE_APPLICATION_CREDENTIALS"
27-
value: "keystore/73713_java_it_service_account"
27+
value: "secret_manager/java-firestore-samples-secrets"
2828
}
2929

3030
env_vars: {
31-
key: "ENABLE_BUILD_COP"
32-
value: "true"
31+
key: "SECRET_MANAGER_KEYS"
32+
value: "java-firestore-samples-secrets"
3333
}
3434

35-
before_action {
36-
fetch_keystore {
37-
keystore_resource {
38-
keystore_config_id: 73713
39-
keyname: "java_it_service_account"
40-
}
41-
}
35+
env_vars: {
36+
key: "ENABLE_BUILD_COP"
37+
value: "true"
4238
}

.kokoro/populate-secrets.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
# Copyright 2020 Google LLC.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;}
19+
function msg { println "$*" >&2 ;}
20+
function println { printf '%s\n' "$(now) $*" ;}
21+
22+
23+
# Populates requested secrets set in SECRET_MANAGER_KEYS from service account:
24+
# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com
25+
SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager"
26+
msg "Creating folder on disk for secrets: ${SECRET_LOCATION}"
27+
mkdir -p ${SECRET_LOCATION}
28+
for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g")
29+
do
30+
msg "Retrieving secret ${key}"
31+
docker run --entrypoint=gcloud \
32+
--volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \
33+
gcr.io/google.com/cloudsdktool/cloud-sdk \
34+
secrets versions access latest \
35+
--project cloud-devrel-kokoro-resources \
36+
--secret ${key} > \
37+
"${SECRET_LOCATION}/${key}"
38+
if [[ $? == 0 ]]; then
39+
msg "Secret written to ${SECRET_LOCATION}/${key}"
40+
else
41+
msg "Error retrieving secret ${key}"
42+
fi
43+
done

.kokoro/presubmit/integration.cfg

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,10 @@ env_vars: {
1818

1919
env_vars: {
2020
key: "GOOGLE_APPLICATION_CREDENTIALS"
21-
value: "keystore/73713_java_firestore_it_service_account"
21+
value: "secret_manager/java-review_firestore-java-it"
2222
}
2323

24-
before_action {
25-
fetch_keystore {
26-
keystore_resource {
27-
keystore_config_id: 73713
28-
keyname: "java_firestore_it_service_account"
29-
}
30-
}
24+
env_vars: {
25+
key: "SECRET_MANAGER_KEYS"
26+
value: "java-review_firestore-java-it"
3127
}

.kokoro/presubmit/samples.cfg

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,20 @@ env_vars: {
1414
# TODO: remove this after we've migrated all tests and scripts
1515
env_vars: {
1616
key: "GCLOUD_PROJECT"
17-
value: "java-docs-samples-testing"
17+
value: "java-docs-samples-firestore"
1818
}
1919

2020
env_vars: {
2121
key: "GOOGLE_CLOUD_PROJECT"
22-
value: "java-docs-samples-testing"
22+
value: "java-docs-samples-firestore"
2323
}
2424

2525
env_vars: {
2626
key: "GOOGLE_APPLICATION_CREDENTIALS"
27-
value: "keystore/73713_java_it_service_account"
27+
value: "secret_manager/java-firestore-samples-secrets"
2828
}
2929

30-
before_action {
31-
fetch_keystore {
32-
keystore_resource {
33-
keystore_config_id: 73713
34-
keyname: "java_it_service_account"
35-
}
36-
}
30+
env_vars: {
31+
key: "SECRET_MANAGER_KEYS"
32+
value: "java-firestore-samples-secrets"
3733
}

.kokoro/trampoline.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ function cleanup() {
2121
echo "cleanup";
2222
}
2323
trap cleanup EXIT
24+
25+
$(dirname $0)/populate-secrets.sh # Secret Manager secrets.
2426
python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py"

0 commit comments

Comments
 (0)