Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit 7882611

Browse files
chore: update common templates (#45)
* ci: add dependency list completeness check (#490) Source-Author: Stephanie Wang <[email protected]> Source-Date: Mon Apr 13 18:30:27 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 3df869dd6eb546ef13beeb7a9efa6ee0226afafd Source-Link: googleapis/synthtool@3df869d * build(java): set GOOGLE_CLOUD_PROJECT env for samples/integration tests (#484) * build(java): set GOOGLE_CLOUD_PROJECT env variable for samples/integration tests * ci: use java-docs-samples-testing for sample tests Source-Author: Jeff Ching <[email protected]> Source-Date: Mon Apr 13 16:24:21 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 52638600f387deb98efb5f9c85fec39e82aa9052 Source-Link: googleapis/synthtool@5263860 * chore: resolve merge conflicts * chore: restore guava version * chore: restore libraries-bom version Co-authored-by: Jeff Ching <[email protected]>
1 parent 1ead137 commit 7882611

File tree

8 files changed

+91
-14
lines changed

8 files changed

+91
-14
lines changed

.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) $*"; }

.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

.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 {

.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: {

.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 {

.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 {

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,4 +259,4 @@
259259
</plugin>
260260
</plugins>
261261
</reporting>
262-
</project>
262+
</project>

synth.metadata

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "7f8e62aa3edd225f76347a16f92e400661fdfb52"
22+
"sha": "85cbc7f954f4c4c3534f0caafbaed22a8f80f602",
23+
"log": "85cbc7f954f4c4c3534f0caafbaed22a8f80f602\nfix: use https vcs install for python-test-utils (#492)\n\n\n52638600f387deb98efb5f9c85fec39e82aa9052\nbuild(java): set GOOGLE_CLOUD_PROJECT env for samples/integration tests (#484)\n\n* build(java): set GOOGLE_CLOUD_PROJECT env variable for samples/integration tests\n\n* ci: use java-docs-samples-testing for sample tests\n3df869dd6eb546ef13beeb7a9efa6ee0226afafd\nci: add dependency list completeness check (#490)\n\n\n682c0c37d1054966ca662a44259e96cc7aea4413\nbuild(nodejs): update lint ignore rules (#488)\n\n\n97c7ccfdceb927db1cbe6f3bb09616aa02bafd89\ndoc: document context-aware commit flags (#481)\n\nAlso, delete obsolete blurb about cleaning up old, dead files.\n\nCo-authored-by: Jeff Ching <[email protected]>\n8eff3790f88b50706a0c4b6a20b385f24e9ac4e7\nfeat: common postprocessing for node libraries (#485)\n\nCo-authored-by: Justin Beckwith <[email protected]>\n21c3b57ae54ae9db6a3a6b48b31c970c6ab56f19\nbuild(nodejs): remove unused codecov config (#486)\n\n\n6f32150677c9784f3c3a7e1949472bd29c9d72c5\nfix: installs test_utils from its common repo (#480)\n\n\n74ce986d3b5431eb66985e9a00c4eb45295a4020\nfix: stop recording update_time in synth.metadata (#478)\n\n\n"
2324
}
2425
}
2526
],

0 commit comments

Comments
 (0)