From c538e8fa02391f172ccd3cb007466432ae78db51 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 16 Mar 2020 15:00:21 -0700 Subject: [PATCH] chore: update common templates (#447) --- .github/PULL_REQUEST_TEMPLATE.md | 8 +++++++- .github/trusted-contribution.yml | 2 ++ .kokoro/build.sh | 30 ++++++++++++++++++++++++++---- .kokoro/continuous/java8.cfg | 5 +++++ .kokoro/nightly/integration.cfg | 14 ++++++++++++++ .kokoro/nightly/java8.cfg | 5 +++++ .kokoro/nightly/samples.cfg | 21 +++++++++++++-------- .kokoro/presubmit/java8.cfg | 5 +++++ synth.metadata | 16 +--------------- 9 files changed, 78 insertions(+), 28 deletions(-) create mode 100644 .github/trusted-contribution.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0bd0ee062..0f4223257 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/google-oauth-java-client/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 000000000..f247d5c78 --- /dev/null +++ b/.github/trusted-contribution.yml @@ -0,0 +1,2 @@ +trustedContributors: +- renovate-bot \ No newline at end of file diff --git a/.kokoro/build.sh b/.kokoro/build.sh index d11958c5a..2341ce9a6 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -37,19 +37,23 @@ if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTI export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_ROOT}/src/${GOOGLE_APPLICATION_CREDENTIALS}) fi +RETURN_CODE=0 +set +e + case ${JOB_TYPE} in test) mvn test -B -Dclirr.skip=true -Denforcer.skip=true - bash ${KOKORO_GFILE_DIR}/codecov.sh - bash .kokoro/coerce_logs.sh + RETURN_CODE=$? ;; lint) mvn \ -Penable-samples \ com.coveo:fmt-maven-plugin:check + RETURN_CODE=$? ;; javadoc) mvn javadoc:javadoc javadoc:test-javadoc + RETURN_CODE=$? ;; integration) mvn -B ${INTEGRATION_TEST_ARGS} \ @@ -59,7 +63,7 @@ integration) -Denforcer.skip=true \ -fae \ verify - bash .kokoro/coerce_logs.sh + RETURN_CODE=$? ;; samples) if [[ -f samples/pom.xml ]] @@ -72,7 +76,7 @@ samples) -Denforcer.skip=true \ -fae \ verify - bash .kokoro/coerce_logs.sh + RETURN_CODE=$? popd else echo "no sample pom.xml found - skipping sample tests" @@ -80,7 +84,25 @@ samples) ;; clirr) mvn -B -Denforcer.skip=true clirr:check + RETURN_CODE=$? ;; *) ;; esac + +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +if [[ "${ENABLE_BUILD_COP}" == "true" ]] +then + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop + ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/google-oauth-java-client +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg index 3b017fc80..495cc7bac 100644 --- a/.kokoro/continuous/java8.cfg +++ b/.kokoro/continuous/java8.cfg @@ -5,3 +5,8 @@ env_vars: { key: "TRAMPOLINE_IMAGE" value: "gcr.io/cloud-devrel-kokoro-resources/java8" } + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg index 3b017fc80..8bf59c02e 100644 --- a/.kokoro/nightly/integration.cfg +++ b/.kokoro/nightly/integration.cfg @@ -5,3 +5,17 @@ env_vars: { key: "TRAMPOLINE_IMAGE" value: "gcr.io/cloud-devrel-kokoro-resources/java8" } + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg index 3b017fc80..495cc7bac 100644 --- a/.kokoro/nightly/java8.cfg +++ b/.kokoro/nightly/java8.cfg @@ -5,3 +5,8 @@ env_vars: { key: "TRAMPOLINE_IMAGE" value: "gcr.io/cloud-devrel-kokoro-resources/java8" } + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg index 9a9102490..b4b051cd0 100644 --- a/.kokoro/nightly/samples.cfg +++ b/.kokoro/nightly/samples.cfg @@ -2,23 +2,28 @@ # Configure the docker image for kokoro-trampoline. env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" } env_vars: { - key: "JOB_TYPE" - value: "samples" + key: "JOB_TYPE" + value: "samples" } 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_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" } before_action { diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg index 3b017fc80..495cc7bac 100644 --- a/.kokoro/presubmit/java8.cfg +++ b/.kokoro/presubmit/java8.cfg @@ -5,3 +5,8 @@ env_vars: { key: "TRAMPOLINE_IMAGE" value: "gcr.io/cloud-devrel-kokoro-resources/java8" } + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/synth.metadata b/synth.metadata index f22bb1f60..0f150a7b4 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,20 +1,6 @@ { - "updateTime": "2020-02-21T22:34:12.927328Z", + "updateTime": "2020-03-16T21:33:50.666509Z", "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/google-oauth-java-client.git", - "sha": "bcabce25df8b7dc9d3d0edfca009d47a465d1af3" - } - }, - { - "git": { - "name": "synthtool", - "remote": "rpc://devrel/cloud/libraries/tools/autosynth", - "sha": "706a38c26db42299845396cdae55db635c38794a" - } - }, { "template": { "name": "java_library",