From 1624d55f9864ff1253321e9bfe715e2f370cc27e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 27 Apr 2020 12:24:57 -0700 Subject: [PATCH] chore: update common templates (#1035) * 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. * 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 --- .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 ++++++--- samples/install-without-bom/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- synth.metadata | 5 ++- 11 files changed, 94 insertions(+), 19 deletions(-) diff --git a/.kokoro/common.sh b/.kokoro/common.sh index 8f09de5d3..a8d0ea04d 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 0aade871c..cf3bb4347 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 ca0274800..40c4abb7b 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 b4b051cd0..20aabd55d 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 141f90c13..522e5b101 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 fa7b493d0..1171aead0 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/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 89688c724..6d5f2e904 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.17 + 1.0.12 diff --git a/samples/pom.xml b/samples/pom.xml index 22ebf1618..a46c32cad 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -18,7 +18,7 @@ com.google.cloud.samples shared-configuration - 1.0.17 + 1.0.15 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index fa6b36800..4d9f60c98 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.17 + 1.0.12 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index cb7949972..33a9fe006 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.17 + 1.0.12 diff --git a/synth.metadata b/synth.metadata index 972287a13..45fdd9b8f 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/google-http-java-client.git", - "sha": "1f6328755fe32cacc7cfcf253493b652bb007186" + "sha": "bb4227f9daec44fc2976fa9947e2ff5ee07ed21a" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "c7e0e517d7f46f77bebd27da2e5afcaa6eee7e25", - "log": "c7e0e517d7f46f77bebd27da2e5afcaa6eee7e25\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 \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 \n" + "sha": "52638600f387deb98efb5f9c85fec39e82aa9052" } } ]