From 7882611884da06ad86ee5774a90eb433f56bc5d9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 15 Apr 2020 12:24:33 -0700 Subject: [PATCH] chore: update common templates (#45) * ci: add dependency list completeness check (#490) Source-Author: Stephanie Wang Source-Date: Mon Apr 13 18:30:27 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 3df869dd6eb546ef13beeb7a9efa6ee0226afafd Source-Link: https://github.com/googleapis/synthtool/commit/3df869dd6eb546ef13beeb7a9efa6ee0226afafd * 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 Source-Date: Mon Apr 13 16:24:21 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 52638600f387deb98efb5f9c85fec39e82aa9052 Source-Link: https://github.com/googleapis/synthtool/commit/52638600f387deb98efb5f9c85fec39e82aa9052 * chore: resolve merge conflicts * chore: restore guava version * chore: restore libraries-bom version Co-authored-by: Jeff Ching --- .kokoro/common.sh | 5 ++++ .kokoro/dependencies.sh | 48 +++++++++++++++++++++++++++++++ .kokoro/nightly/integration.cfg | 11 +++++-- .kokoro/nightly/samples.cfg | 8 +++++- .kokoro/presubmit/integration.cfg | 14 ++++++--- .kokoro/presubmit/samples.cfg | 14 ++++++--- pom.xml | 2 +- synth.metadata | 3 +- 8 files changed, 91 insertions(+), 14 deletions(-) diff --git a/.kokoro/common.sh b/.kokoro/common.sh index 8f09de5d..a8d0ea04 100644 --- a/.kokoro/common.sh +++ b/.kokoro/common.sh @@ -52,3 +52,8 @@ function retry_with_backoff { return $exit_code } + +## Helper functionss +function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } +function msg() { println "$*" >&2; } +function println() { printf '%s\n' "$(now) $*"; } \ No newline at end of file diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index 0aade871..cf3bb434 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -36,3 +36,51 @@ retry_with_backoff 3 10 \ -Dclirr.skip=true mvn -B dependency:analyze -DfailOnWarning=true + +echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" +## Run dependency list completeness check +function completenessCheck() { + # Output dep list with compile scope generated using the original pom + msg "Generating dependency list using original pom..." + mvn dependency:list -f pom.xml -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | grep -v ':test$' >.org-list.txt + + # Output dep list generated using the flattened pom (test scope deps are ommitted) + msg "Generating dependency list using flattened pom..." + mvn dependency:list -f .flattened-pom.xml -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt + + # Compare two dependency lists + msg "Comparing dependency lists..." + diff .org-list.txt .new-list.txt >.diff.txt + if [[ $? == 0 ]] + then + msg "Success. No diff!" + else + msg "Diff found. See below: " + msg "You can also check .diff.txt file located in $1." + cat .diff.txt + return 1 + fi +} + +# Allow failures to continue running the script +set +e + +error_count=0 +for path in $(find -name ".flattened-pom.xml") +do + # Check flattened pom in each dir that contains it for completeness + dir=$(dirname "$path") + pushd "$dir" + completenessCheck "$dir" + error_count=$(($error_count + $?)) + popd +done + +if [[ $error_count == 0 ]] +then + msg "All checks passed." + exit 0 +else + msg "Errors found. See log statements above." + exit 1 +fi diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg index ca027480..40c4abb7 100644 --- a/.kokoro/nightly/integration.cfg +++ b/.kokoro/nightly/integration.cfg @@ -10,20 +10,25 @@ env_vars: { key: "JOB_TYPE" value: "integration" } - +# TODO: remove this after we've migrated all tests and scripts env_vars: { key: "GCLOUD_PROJECT" value: "gcloud-devel" } +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + env_vars: { key: "ENABLE_BUILD_COP" value: "true" } env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "keystore/73713_java_it_service_account" + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" } before_action { diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg index b4b051cd..20aabd55 100644 --- a/.kokoro/nightly/samples.cfg +++ b/.kokoro/nightly/samples.cfg @@ -11,9 +11,15 @@ env_vars: { value: "samples" } +# TODO: remove this after we've migrated all tests and scripts env_vars: { key: "GCLOUD_PROJECT" - value: "gcloud-devel" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" } env_vars: { diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg index 141f90c1..522e5b10 100644 --- a/.kokoro/presubmit/integration.cfg +++ b/.kokoro/presubmit/integration.cfg @@ -11,14 +11,20 @@ env_vars: { value: "integration" } +# TODO: remove this after we've migrated all tests and scripts env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" + key: "GCLOUD_PROJECT" + value: "gcloud-devel" } env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "keystore/73713_java_it_service_account" + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" } before_action { diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg index fa7b493d..1171aead 100644 --- a/.kokoro/presubmit/samples.cfg +++ b/.kokoro/presubmit/samples.cfg @@ -11,14 +11,20 @@ env_vars: { value: "samples" } +# TODO: remove this after we've migrated all tests and scripts env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" } env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "keystore/73713_java_it_service_account" + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" } before_action { diff --git a/pom.xml b/pom.xml index 1c56d006..15838786 100644 --- a/pom.xml +++ b/pom.xml @@ -259,4 +259,4 @@ - \ No newline at end of file + diff --git a/synth.metadata b/synth.metadata index 2000d206..a4f1c849 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,7 +19,8 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "7f8e62aa3edd225f76347a16f92e400661fdfb52" + "sha": "85cbc7f954f4c4c3534f0caafbaed22a8f80f602", + "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 \n8eff3790f88b50706a0c4b6a20b385f24e9ac4e7\nfeat: common postprocessing for node libraries (#485)\n\nCo-authored-by: Justin Beckwith \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" } } ],