Skip to content

Commit 52e5dfb

Browse files
chore: update common templates (googleapis#146)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/a8b4de14-bbed-43a8-a032-34b2812821a8/targets
1 parent 4fc1bb3 commit 52e5dfb

File tree

7 files changed

+89
-15
lines changed

7 files changed

+89
-15
lines changed

java-resourcemanager/.kokoro/common.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,8 @@ function retry_with_backoff {
5252

5353
return $exit_code
5454
}
55+
56+
## Helper functionss
57+
function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; }
58+
function msg() { println "$*" >&2; }
59+
function println() { printf '%s\n' "$(now) $*"; }

java-resourcemanager/.kokoro/dependencies.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,51 @@ retry_with_backoff 3 10 \
3636
-Dclirr.skip=true
3737

3838
mvn -B dependency:analyze -DfailOnWarning=true
39+
40+
echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************"
41+
## Run dependency list completeness check
42+
function completenessCheck() {
43+
# Output dep list with compile scope generated using the original pom
44+
msg "Generating dependency list using original pom..."
45+
mvn dependency:list -f pom.xml -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | grep -v ':test$' >.org-list.txt
46+
47+
# Output dep list generated using the flattened pom (test scope deps are ommitted)
48+
msg "Generating dependency list using flattened pom..."
49+
mvn dependency:list -f .flattened-pom.xml -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt
50+
51+
# Compare two dependency lists
52+
msg "Comparing dependency lists..."
53+
diff .org-list.txt .new-list.txt >.diff.txt
54+
if [[ $? == 0 ]]
55+
then
56+
msg "Success. No diff!"
57+
else
58+
msg "Diff found. See below: "
59+
msg "You can also check .diff.txt file located in $1."
60+
cat .diff.txt
61+
return 1
62+
fi
63+
}
64+
65+
# Allow failures to continue running the script
66+
set +e
67+
68+
error_count=0
69+
for path in $(find -name ".flattened-pom.xml")
70+
do
71+
# Check flattened pom in each dir that contains it for completeness
72+
dir=$(dirname "$path")
73+
pushd "$dir"
74+
completenessCheck "$dir"
75+
error_count=$(($error_count + $?))
76+
popd
77+
done
78+
79+
if [[ $error_count == 0 ]]
80+
then
81+
msg "All checks passed."
82+
exit 0
83+
else
84+
msg "Errors found. See log statements above."
85+
exit 1
86+
fi

java-resourcemanager/.kokoro/nightly/integration.cfg

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,25 @@ env_vars: {
1010
key: "JOB_TYPE"
1111
value: "integration"
1212
}
13-
13+
# TODO: remove this after we've migrated all tests and scripts
1414
env_vars: {
1515
key: "GCLOUD_PROJECT"
1616
value: "gcloud-devel"
1717
}
1818

19+
env_vars: {
20+
key: "GOOGLE_CLOUD_PROJECT"
21+
value: "gcloud-devel"
22+
}
23+
1924
env_vars: {
2025
key: "ENABLE_BUILD_COP"
2126
value: "true"
2227
}
2328

2429
env_vars: {
25-
key: "GOOGLE_APPLICATION_CREDENTIALS"
26-
value: "keystore/73713_java_it_service_account"
30+
key: "GOOGLE_APPLICATION_CREDENTIALS"
31+
value: "keystore/73713_java_it_service_account"
2732
}
2833

2934
before_action {

java-resourcemanager/.kokoro/nightly/samples.cfg

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ env_vars: {
1111
value: "samples"
1212
}
1313

14+
# TODO: remove this after we've migrated all tests and scripts
1415
env_vars: {
1516
key: "GCLOUD_PROJECT"
16-
value: "gcloud-devel"
17+
value: "java-docs-samples-testing"
18+
}
19+
20+
env_vars: {
21+
key: "GOOGLE_CLOUD_PROJECT"
22+
value: "java-docs-samples-testing"
1723
}
1824

1925
env_vars: {

java-resourcemanager/.kokoro/presubmit/integration.cfg

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ env_vars: {
1111
value: "integration"
1212
}
1313

14+
# TODO: remove this after we've migrated all tests and scripts
1415
env_vars: {
15-
key: "GCLOUD_PROJECT"
16-
value: "gcloud-devel"
16+
key: "GCLOUD_PROJECT"
17+
value: "gcloud-devel"
1718
}
1819

1920
env_vars: {
20-
key: "GOOGLE_APPLICATION_CREDENTIALS"
21-
value: "keystore/73713_java_it_service_account"
21+
key: "GOOGLE_CLOUD_PROJECT"
22+
value: "gcloud-devel"
23+
}
24+
25+
env_vars: {
26+
key: "GOOGLE_APPLICATION_CREDENTIALS"
27+
value: "keystore/73713_java_it_service_account"
2228
}
2329

2430
before_action {

java-resourcemanager/.kokoro/presubmit/samples.cfg

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ env_vars: {
1111
value: "samples"
1212
}
1313

14+
# TODO: remove this after we've migrated all tests and scripts
1415
env_vars: {
15-
key: "GCLOUD_PROJECT"
16-
value: "gcloud-devel"
16+
key: "GCLOUD_PROJECT"
17+
value: "java-docs-samples-testing"
1718
}
1819

1920
env_vars: {
20-
key: "GOOGLE_APPLICATION_CREDENTIALS"
21-
value: "keystore/73713_java_it_service_account"
21+
key: "GOOGLE_CLOUD_PROJECT"
22+
value: "java-docs-samples-testing"
23+
}
24+
25+
env_vars: {
26+
key: "GOOGLE_APPLICATION_CREDENTIALS"
27+
value: "keystore/73713_java_it_service_account"
2228
}
2329

2430
before_action {

java-resourcemanager/synth.metadata

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"updateTime": "2020-04-09T02:24:34.499763Z",
32
"sources": [
43
{
54
"git": {
@@ -12,8 +11,7 @@
1211
"git": {
1312
"name": "synthtool",
1413
"remote": "https://github.com/googleapis/synthtool.git",
15-
"sha": "7f8e62aa3edd225f76347a16f92e400661fdfb52",
16-
"log": "7f8e62aa3edd225f76347a16f92e400661fdfb52\nchore(java): release-please only updates non maven versions in README (#476)\n\nPrevent release-please and synthtool from fighting over the released library version. Synthtool updates the install snippets from the samples pom.xml files so the bots fight if they are temporarily out of sync after a release.\nc7e0e517d7f46f77bebd27da2e5afcaa6eee7e25\nbuild(java): fix nightly integration test config to run integrations (#465)\n\nThis was only running the units.\nbd69a2aa7b70875f3c988e269706b22fefbef40e\nbuild(java): fix retry_with_backoff when -e option set (#475)\n\n\nd9b173c427bfa0c6cca818233562e7e8841a357c\nfix: record version of working repo in synth.metadata (#473)\n\nPartial revert of b37cf74d12e9a42b9de9e61a4f26133d7cd9c168.\nf73a541770d95a609e5be6bf6b3b220d17cefcbe\nfeat(discogapic): allow local discovery-artifact-manager (#474)\n\n\n8cf0f5d93a70c3dcb0b4999d3152c46d4d9264bf\ndoc: describe the Autosynth & Synthtool protocol (#472)\n\n* doc: describe the Autosynth & Synthtool protocol\n\n* Accommodate review comments.\n980baaa738a1ad8fa02b4fdbd56be075ee77ece5\nfix: pin sphinx to <3.0.0 as new version causes new error (#471)\n\nThe error `toctree contains reference to document changlelog that doesn't have a title: no link will be generated` occurs as of 3.0.0. Pinning to 2.x until we address the docs build issue.\n\nTowards #470\n\nI did this manually for python-datastore https://github.com/googleapis/python-datastore/pull/22\n928b2998ac5023e7c7e254ab935f9ef022455aad\nchore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.15 (#466)\n\nCo-authored-by: Jeffrey Rennie <[email protected]>\n188f1b1d53181f739b98f8aa5d40cfe99eb90c47\nfix: allow local and external deps to be specified (#469)\n\nModify noxfile.py to allow local and external dependencies for\nsystem tests to be specified.\n1df68ed6735ddce6797d0f83641a731c3c3f75b4\nfix: apache license URL (#468)\n\n\nf4a59efa54808c4b958263de87bc666ce41e415f\nfeat: Add discogapic support for GAPICBazel generation (#459)\n\n* feat: Add discogapic support for GAPICBazel generation\n\n* reformat with black\n\n* Rename source repository variable\n\nCo-authored-by: Jeffrey Rennie <[email protected]>\n99820243d348191bc9c634f2b48ddf65096285ed\nfix: update template files for Node.js libraries (#463)\n\n\n3cbe6bcd5623139ac9834c43818424ddca5430cb\nfix(ruby): remove dead troubleshooting link from generated auth guide (#462)\n\n\na003d8655d3ebec2bbbd5fc3898e91e152265c67\ndocs: remove \"install stable\" instructions (#461)\n\nThe package hasn't been released to PyPI in some time\nf5e8c88d9870d8aa4eb43fa0b39f07e02bfbe4df\nchore(python): add license headers to config files; make small tweaks to templates (#458)\n\n\n"
14+
"sha": "52638600f387deb98efb5f9c85fec39e82aa9052"
1715
}
1816
}
1917
]

0 commit comments

Comments
 (0)