From d2ea22250b9062869c469fdb4616677396b20aee Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 30 Mar 2020 14:55:51 -0700 Subject: [PATCH] regenerate common templates --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 8 ++++- .github/trusted-contribution.yml | 2 ++ .gitignore | 15 +++++++++ .kokoro/build.bat | 2 +- .kokoro/build.sh | 19 +++++++---- .kokoro/common.cfg | 4 +-- .kokoro/common.sh | 44 ++++++++++++++++++++++++++ .kokoro/continuous/common.cfg | 4 +-- .kokoro/continuous/dependencies.cfg | 2 +- .kokoro/continuous/java8-osx.cfg | 2 +- .kokoro/continuous/java8-win.cfg | 2 +- .kokoro/continuous/propose_release.cfg | 4 +-- .kokoro/dependencies.sh | 15 ++++++--- .kokoro/linkage-monitor.sh | 22 +++++++++---- .kokoro/nightly/common.cfg | 4 +-- .kokoro/nightly/dependencies.cfg | 2 +- .kokoro/nightly/java8-osx.cfg | 2 +- .kokoro/nightly/java8-win.cfg | 2 +- .kokoro/presubmit/common.cfg | 4 +-- .kokoro/presubmit/dependencies.cfg | 2 +- .kokoro/presubmit/java8-osx.cfg | 2 +- .kokoro/presubmit/java8-win.cfg | 2 +- .kokoro/presubmit/linkage-monitor.cfg | 2 +- .kokoro/release/bump_snapshot.cfg | 4 +-- .kokoro/release/common.cfg | 2 +- .kokoro/release/drop.cfg | 2 +- .kokoro/release/promote.cfg | 2 +- .kokoro/release/publish_javadoc.cfg | 2 +- .kokoro/release/snapshot.cfg | 2 +- .kokoro/release/stage.cfg | 6 ++-- .repo-metadata.json | 1 + renovate.json | 6 ++-- synth.metadata | 10 +++--- synth.py | 3 +- 35 files changed, 150 insertions(+), 59 deletions(-) create mode 100644 .github/trusted-contribution.yml create mode 100644 .gitignore create mode 100644 .kokoro/common.sh diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d8fe8a9f..8f5f1b6f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -10,7 +10,7 @@ Thanks for stopping by to let us know something could be better! Please run down the following list and make sure you've tried the usual "quick fixes": - - Search the issues already opened: https://github.com/googleapis//issues + - Search the issues already opened: https://github.com/googleapis/java-shared-dependencies/issues - Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform If you are still having issues, please include as much information as possible: diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0bd0ee06..c8581001 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1 +1,7 @@ -Fixes # (it's a good idea to open an issue first for context and/or discussion) \ No newline at end of file +Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: +- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-shared-dependencies/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea +- [ ] Ensure the tests and linter pass +- [ ] Code coverage does not decrease (if any source code was changed) +- [ ] Appropriate docs were updated (if necessary) + +Fixes # ☕️ diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml new file mode 100644 index 00000000..f247d5c7 --- /dev/null +++ b/.github/trusted-contribution.yml @@ -0,0 +1,2 @@ +trustedContributors: +- renovate-bot \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..fadd6afc --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ diff --git a/.kokoro/build.bat b/.kokoro/build.bat index 3b660d28..026581e2 100644 --- a/.kokoro/build.bat +++ b/.kokoro/build.bat @@ -1,3 +1,3 @@ :: See documentation in type-shell-output.bat -"C:\Program Files\Git\bin\bash.exe" github//.kokoro/build.sh +"C:\Program Files\Git\bin\bash.exe" github/java-shared-dependencies/.kokoro/build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 7980b59e..8d259a08 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -20,17 +20,22 @@ scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) ## cd to the parent directory, i.e. the root of the git repo cd ${scriptDir}/.. +# include common functions +source ${scriptDir}/common.sh + # Print out Java version java -version echo ${JOB_TYPE} -mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true \ - -T 1C +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C # if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg index 0acedc99..ab47c217 100644 --- a/.kokoro/common.cfg +++ b/.kokoro/common.cfg @@ -4,10 +4,10 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # All builds use the trampoline script to run in docker. -build_file: "/.kokoro/trampoline.sh" +build_file: "java-shared-dependencies/.kokoro/trampoline.sh" # Tell the trampoline which build file to use. env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/build.sh" + value: "github/java-shared-dependencies/.kokoro/build.sh" } diff --git a/.kokoro/common.sh b/.kokoro/common.sh new file mode 100644 index 00000000..a3bbc5f6 --- /dev/null +++ b/.kokoro/common.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# set -eo pipefail + +function retry_with_backoff { + attempts_left=$1 + sleep_seconds=$2 + shift 2 + command=$@ + + echo "${command}" + ${command} + exit_code=$? + + if [[ $exit_code == 0 ]] + then + return 0 + fi + + # failure + if [[ ${attempts_left} > 0 ]] + then + echo "failure (${exit_code}), sleeping ${sleep_seconds}..." + sleep ${sleep_seconds} + new_attempts=$((${attempts_left} - 1)) + new_sleep=$((${sleep_seconds} * 2)) + retry_with_backoff ${new_attempts} ${new_sleep} ${command} + fi + + return $exit_code +} diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg index 6dcad8f8..5a58be9e 100644 --- a/.kokoro/continuous/common.cfg +++ b/.kokoro/continuous/common.cfg @@ -12,11 +12,11 @@ action { gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "/.kokoro/trampoline.sh" +build_file: "java-shared-dependencies/.kokoro/trampoline.sh" env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/build.sh" + value: "github/java-shared-dependencies/.kokoro/build.sh" } env_vars: { diff --git a/.kokoro/continuous/dependencies.cfg b/.kokoro/continuous/dependencies.cfg index 423ec376..7b0df445 100644 --- a/.kokoro/continuous/dependencies.cfg +++ b/.kokoro/continuous/dependencies.cfg @@ -8,5 +8,5 @@ env_vars: { env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/dependencies.sh" + value: "github/java-shared-dependencies/.kokoro/dependencies.sh" } diff --git a/.kokoro/continuous/java8-osx.cfg b/.kokoro/continuous/java8-osx.cfg index 18d6a643..127b52fb 100644 --- a/.kokoro/continuous/java8-osx.cfg +++ b/.kokoro/continuous/java8-osx.cfg @@ -1,3 +1,3 @@ # Format: //devtools/kokoro/config/proto/build.proto -build_file: "/.kokoro/build.sh" +build_file: "java-shared-dependencies/.kokoro/build.sh" diff --git a/.kokoro/continuous/java8-win.cfg b/.kokoro/continuous/java8-win.cfg index dbd437eb..e105f6d4 100644 --- a/.kokoro/continuous/java8-win.cfg +++ b/.kokoro/continuous/java8-win.cfg @@ -1,3 +1,3 @@ # Format: //devtools/kokoro/config/proto/build.proto -build_file: "/.kokoro/build.bat" +build_file: "java-shared-dependencies/.kokoro/build.bat" diff --git a/.kokoro/continuous/propose_release.cfg b/.kokoro/continuous/propose_release.cfg index 19e852ac..3432c793 100644 --- a/.kokoro/continuous/propose_release.cfg +++ b/.kokoro/continuous/propose_release.cfg @@ -11,7 +11,7 @@ action { gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "/.kokoro/trampoline.sh" +build_file: "java-shared-dependencies/.kokoro/trampoline.sh" # Configure the docker image for kokoro-trampoline. env_vars: { @@ -21,7 +21,7 @@ env_vars: { env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/continuous/propose_release.sh" + value: "github/java-shared-dependencies/.kokoro/continuous/propose_release.sh" } # tokens used by release-please to keep an up-to-date release PR. diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index 6b0d3f47..0aade871 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -15,7 +15,13 @@ set -eo pipefail -cd github// +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh # Print out Java java -version @@ -24,8 +30,9 @@ echo $JOB_TYPE export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" # this should run maven enforcer -mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true mvn -B dependency:analyze -DfailOnWarning=true diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh index d8838fd9..759ab4e2 100755 --- a/.kokoro/linkage-monitor.sh +++ b/.kokoro/linkage-monitor.sh @@ -17,18 +17,26 @@ set -eo pipefail # Display commands being run. set -x -cd github// +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh # Print out Java version java -version echo ${JOB_TYPE} -mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true # Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR JAR=linkage-monitor-latest-all-deps.jar diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg index 6dcad8f8..5a58be9e 100644 --- a/.kokoro/nightly/common.cfg +++ b/.kokoro/nightly/common.cfg @@ -12,11 +12,11 @@ action { gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "/.kokoro/trampoline.sh" +build_file: "java-shared-dependencies/.kokoro/trampoline.sh" env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/build.sh" + value: "github/java-shared-dependencies/.kokoro/build.sh" } env_vars: { diff --git a/.kokoro/nightly/dependencies.cfg b/.kokoro/nightly/dependencies.cfg index 423ec376..7b0df445 100644 --- a/.kokoro/nightly/dependencies.cfg +++ b/.kokoro/nightly/dependencies.cfg @@ -8,5 +8,5 @@ env_vars: { env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/dependencies.sh" + value: "github/java-shared-dependencies/.kokoro/dependencies.sh" } diff --git a/.kokoro/nightly/java8-osx.cfg b/.kokoro/nightly/java8-osx.cfg index 18d6a643..127b52fb 100644 --- a/.kokoro/nightly/java8-osx.cfg +++ b/.kokoro/nightly/java8-osx.cfg @@ -1,3 +1,3 @@ # Format: //devtools/kokoro/config/proto/build.proto -build_file: "/.kokoro/build.sh" +build_file: "java-shared-dependencies/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg index dbd437eb..e105f6d4 100644 --- a/.kokoro/nightly/java8-win.cfg +++ b/.kokoro/nightly/java8-win.cfg @@ -1,3 +1,3 @@ # Format: //devtools/kokoro/config/proto/build.proto -build_file: "/.kokoro/build.bat" +build_file: "java-shared-dependencies/.kokoro/build.bat" diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg index 671a267a..dd8e9876 100644 --- a/.kokoro/presubmit/common.cfg +++ b/.kokoro/presubmit/common.cfg @@ -12,11 +12,11 @@ action { gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "/.kokoro/trampoline.sh" +build_file: "java-shared-dependencies/.kokoro/trampoline.sh" env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/build.sh" + value: "github/java-shared-dependencies/.kokoro/build.sh" } env_vars: { diff --git a/.kokoro/presubmit/dependencies.cfg b/.kokoro/presubmit/dependencies.cfg index 423ec376..7b0df445 100644 --- a/.kokoro/presubmit/dependencies.cfg +++ b/.kokoro/presubmit/dependencies.cfg @@ -8,5 +8,5 @@ env_vars: { env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/dependencies.sh" + value: "github/java-shared-dependencies/.kokoro/dependencies.sh" } diff --git a/.kokoro/presubmit/java8-osx.cfg b/.kokoro/presubmit/java8-osx.cfg index 18d6a643..127b52fb 100644 --- a/.kokoro/presubmit/java8-osx.cfg +++ b/.kokoro/presubmit/java8-osx.cfg @@ -1,3 +1,3 @@ # Format: //devtools/kokoro/config/proto/build.proto -build_file: "/.kokoro/build.sh" +build_file: "java-shared-dependencies/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg index dbd437eb..e105f6d4 100644 --- a/.kokoro/presubmit/java8-win.cfg +++ b/.kokoro/presubmit/java8-win.cfg @@ -1,3 +1,3 @@ # Format: //devtools/kokoro/config/proto/build.proto -build_file: "/.kokoro/build.bat" +build_file: "java-shared-dependencies/.kokoro/build.bat" diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg index 16afbc79..a3c32e28 100644 --- a/.kokoro/presubmit/linkage-monitor.cfg +++ b/.kokoro/presubmit/linkage-monitor.cfg @@ -8,5 +8,5 @@ env_vars: { env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/linkage-monitor.sh" + value: "github/java-shared-dependencies/.kokoro/linkage-monitor.sh" } \ No newline at end of file diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg index cb14dbc7..0258fb41 100644 --- a/.kokoro/release/bump_snapshot.cfg +++ b/.kokoro/release/bump_snapshot.cfg @@ -11,7 +11,7 @@ action { gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "/.kokoro/trampoline.sh" +build_file: "java-shared-dependencies/.kokoro/trampoline.sh" # Configure the docker image for kokoro-trampoline. env_vars: { @@ -21,7 +21,7 @@ env_vars: { env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/release/bump_snapshot.sh" + value: "github/java-shared-dependencies/.kokoro/release/bump_snapshot.sh" } # tokens used by release-please to keep an up-to-date release PR. diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index 21446d83..d1f878a7 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -4,7 +4,7 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "/.kokoro/trampoline.sh" +build_file: "java-shared-dependencies/.kokoro/trampoline.sh" # Configure the docker image for kokoro-trampoline. env_vars: { diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg index bdba5967..1595b2de 100644 --- a/.kokoro/release/drop.cfg +++ b/.kokoro/release/drop.cfg @@ -2,5 +2,5 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/release/drop.sh" + value: "github/java-shared-dependencies/.kokoro/release/drop.sh" } diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg index 02ae7be5..787a78d9 100644 --- a/.kokoro/release/promote.cfg +++ b/.kokoro/release/promote.cfg @@ -2,5 +2,5 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/release/promote.sh" + value: "github/java-shared-dependencies/.kokoro/release/promote.sh" } diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg index f82e0759..cbc7d5b7 100644 --- a/.kokoro/release/publish_javadoc.cfg +++ b/.kokoro/release/publish_javadoc.cfg @@ -6,7 +6,7 @@ env_vars: { env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/release/publish_javadoc.sh" + value: "github/java-shared-dependencies/.kokoro/release/publish_javadoc.sh" } before_action { diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg index 27bbd381..14d45d8e 100644 --- a/.kokoro/release/snapshot.cfg +++ b/.kokoro/release/snapshot.cfg @@ -2,5 +2,5 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/release/snapshot.sh" + value: "github/java-shared-dependencies/.kokoro/release/snapshot.sh" } \ No newline at end of file diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg index b4ddf69f..413d49ab 100644 --- a/.kokoro/release/stage.cfg +++ b/.kokoro/release/stage.cfg @@ -2,14 +2,14 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github//.kokoro/release/stage.sh" + value: "github/java-shared-dependencies/.kokoro/release/stage.sh" } # Need to save the properties file action { define_artifacts { - regex: "github//target/nexus-staging/staging/*.properties" - strip_prefix: "github/" + regex: "github/java-shared-dependencies/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-shared-dependencies" } } diff --git a/.repo-metadata.json b/.repo-metadata.json index 97fa421f..58d60867 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -4,5 +4,6 @@ "release_level": "beta", "language": "java", "repo": "googleapis/java-shared-dependencies", + "repo_short": "java-shared-dependencies", "distribution_name": "com.google.cloud:google-cloud-shared-dependencies" } diff --git a/renovate.json b/renovate.json index fc641270..0c8d6cf5 100644 --- a/renovate.json +++ b/renovate.json @@ -56,7 +56,9 @@ }, { "packagePatterns": [ - "^com.google.cloud:libraries-bom" + "^com.google.cloud:google-cloud-shared-dependencies", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" ], "semanticCommitType": "chore", "semanticCommitScope": "deps" @@ -75,4 +77,4 @@ } ], "semanticCommits": true -} +} \ No newline at end of file diff --git a/synth.metadata b/synth.metadata index 2fed95f1..0abd8df0 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,11 +1,11 @@ { - "updateTime": "2020-02-28T22:11:00.677306Z", + "updateTime": "2020-03-30T21:54:45.652823Z", "sources": [ { - "template": { - "name": "java_library", - "origin": "synthtool.gcp", - "version": "2020.2.4" + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "a003d8655d3ebec2bbbd5fc3898e91e152265c67" } } ] diff --git a/synth.py b/synth.py index dc69f215..0ea815a0 100644 --- a/synth.py +++ b/synth.py @@ -17,5 +17,6 @@ from synthtool.languages import java java.common_templates(excludes=[ - "README.md" + "README.md", + "samples/*" ])