diff --git a/.github/readme/synth.py b/.github/readme/synth.py new file mode 100644 index 00000000..7b48cc28 --- /dev/null +++ b/.github/readme/synth.py @@ -0,0 +1,19 @@ +# 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. + +"""This script is used to synthesize generated the README for this library.""" + +from synthtool.languages import java + +java.custom_templates(["java_library/README.md"]) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml new file mode 100644 index 00000000..6bddd18e --- /dev/null +++ b/.github/sync-repo-settings.yaml @@ -0,0 +1,49 @@ + +# Whether or not rebase-merging is enabled on this repository. +# Defaults to `true` +rebaseMergeAllowed: false + +# Whether or not squash-merging is enabled on this repository. +# Defaults to `true` +squashMergeAllowed: true + +# Whether or not PRs are merged with a merge commit on this repository. +# Defaults to `false` +mergeCommitAllowed: false + +# Rules for master branch protection +branchProtectionRules: +# Identifies the protection rule pattern. Name of the branch to be protected. +# Defaults to `master` +- pattern: master + # Can admins overwrite branch protection. + # Defaults to `true` + isAdminEnforced: true + # Number of approving reviews required to update matching branches. + # Defaults to `1` + requiredApprovingReviewCount: 1 + # Are reviews from code owners required to update matching branches. + # Defaults to `false` + requiresCodeOwnerReviews: true + # Require up to date branches + requiresStrictStatusChecks: false + # List of required status check contexts that must pass for commits to be accepted to matching branches. + requiredStatusCheckContexts: + - "dependencies (8)" + - "dependencies (11)" + - "linkage-monitor" + - "lint" + - "clirr" + - "units (7)" + - "units (8)" + - "units (11)" + - "Kokoro - Test: Integration" + - "cla/google" +# List of explicit permissions to add (additive only) +permissionRules: +- team: yoshi-admins + permission: admin +- team: yoshi-java-admins + permission: admin +- team: yoshi-java + permission: push \ No newline at end of file diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index d26427e4..bc1554ae 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -4,10 +4,11 @@ name: auto-release jobs: approve: runs-on: ubuntu-latest + if: contains(github.head_ref, 'release-v') steps: - uses: actions/github-script@v3.0.0 with: - github-token: ${{secrets.GITHUB_TOKEN}} + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} debug: true script: | // only approve PRs from release-please[bot] @@ -20,6 +21,24 @@ jobs: return; } + // only approve PRs with pom.xml and versions.txt changes + const filesPromise = github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }); + const changed_files = await github.paginate(filesPromise) + + if ( changed_files.length < 1 ) { + console.log( "Not proceeding since PR is empty!" ) + return; + } + + if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { + console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) + return; + } + // trigger auto-release when // 1) it is a SNAPSHOT release (auto-generated post regular release) // 2) there are dependency updates only @@ -66,4 +85,4 @@ jobs: repo: context.repo.repo, issue_number: context.payload.pull_request.number, labels: ['kokoro:force-run', 'automerge'] - }); \ No newline at end of file + }); diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml index a1d50073..c46230a7 100644 --- a/.github/workflows/samples.yaml +++ b/.github/workflows/samples.yaml @@ -2,7 +2,7 @@ on: pull_request: name: samples jobs: - lint: + checkstyle: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.kokoro/continuous/readme.cfg b/.kokoro/continuous/readme.cfg new file mode 100644 index 00000000..37eb3b32 --- /dev/null +++ b/.kokoro/continuous/readme.cfg @@ -0,0 +1,55 @@ +# 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. + +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring/.kokoro/readme.sh" +} + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.log" + } +} + +# The github token is stored here. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + # TODO(theacodes): remove this after secrets have globally propagated + backend_type: FASTCONFIGPUSH + } + } +} + +# Common env vars for all repositories and builds. +env_vars: { + key: "GITHUB_USER" + value: "yoshi-automation" +} +env_vars: { + key: "GITHUB_EMAIL" + value: "yoshi-automation@google.com" +} diff --git a/.kokoro/readme.sh b/.kokoro/readme.sh new file mode 100644 index 00000000..4fa0fcc4 --- /dev/null +++ b/.kokoro/readme.sh @@ -0,0 +1,36 @@ +#!/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 + +cd ${KOKORO_ARTIFACTS_DIR}/github/java-monitoring + +# Disable buffering, so that the logs stream through. +export PYTHONUNBUFFERED=1 + +# Kokoro exposes this as a file, but the scripts expect just a plain variable. +export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key) + +# Setup git credentials +echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials +git config --global credential.helper 'store --file ~/.git-credentials' + +python3.6 -m pip install git+https://github.com/googleapis/synthtool.git#egg=gcp-synthtool +python3.6 -m autosynth.synth \ + --repository=googleapis/java-monitoring \ + --synth-file-name=.github/readme/synth.py \ + --metadata-path=.github/readme/synth.metadata \ + --pr-title="chore: regenerate README" \ + --branch-suffix="readme" \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6217c0eb..d929cba1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.0.4](https://www.github.com/googleapis/java-monitoring/compare/v2.0.3...v2.0.4) (2020-10-08) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.2 ([#289](https://www.github.com/googleapis/java-monitoring/issues/289)) ([08edb22](https://www.github.com/googleapis/java-monitoring/commit/08edb220737f83471b3dd9bdf40b6795e30018aa)) + ### [2.0.3](https://www.github.com/googleapis/java-monitoring/compare/v2.0.2...v2.0.3) (2020-09-23) diff --git a/README.md b/README.md index d131a7fa..816ccee9 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-monitoring - 2.0.3-SNAPSHOT + 2.0.3 ``` @@ -48,11 +48,11 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-monitoring:2.0.3' +compile 'com.google.cloud:google-cloud-monitoring:2.0.4' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-monitoring" % "2.0.3" +libraryDependencies += "com.google.cloud" % "google-cloud-monitoring" % "2.0.4" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-monitoring-bom/pom.xml b/google-cloud-monitoring-bom/pom.xml index cb56402e..dc896d3d 100644 --- a/google-cloud-monitoring-bom/pom.xml +++ b/google-cloud-monitoring-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-monitoring-bom - 2.0.3 + 2.0.4 pom com.google.cloud @@ -64,17 +64,17 @@ com.google.cloud google-cloud-monitoring - 2.0.3 + 2.0.4 com.google.api.grpc grpc-google-cloud-monitoring-v3 - 2.0.3 + 2.0.4 com.google.api.grpc proto-google-cloud-monitoring-v3 - 2.0.3 + 2.0.4 diff --git a/google-cloud-monitoring/pom.xml b/google-cloud-monitoring/pom.xml index 891bb4f1..1336bf9b 100644 --- a/google-cloud-monitoring/pom.xml +++ b/google-cloud-monitoring/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-monitoring - 2.0.3 + 2.0.4 jar Google Cloud Monitoring https://github.com/googleapis/java-monitoring @@ -11,7 +11,7 @@ com.google.cloud google-cloud-monitoring-parent - 2.0.3 + 2.0.4 google-cloud-monitoring diff --git a/grpc-google-cloud-monitoring-v3/pom.xml b/grpc-google-cloud-monitoring-v3/pom.xml index 4079bae0..413e58b9 100644 --- a/grpc-google-cloud-monitoring-v3/pom.xml +++ b/grpc-google-cloud-monitoring-v3/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-monitoring-v3 - 2.0.3 + 2.0.4 grpc-google-cloud-monitoring-v3 GRPC library for grpc-google-cloud-monitoring-v3 com.google.cloud google-cloud-monitoring-parent - 2.0.3 + 2.0.4 diff --git a/pom.xml b/pom.xml index 0bf25840..d25d53cb 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-monitoring-parent pom - 2.0.3 + 2.0.4 Google Cloud Monitoring Parent https://github.com/googleapis/java-monitoring @@ -70,23 +70,23 @@ com.google.api.grpc proto-google-cloud-monitoring-v3 - 2.0.3 + 2.0.4 com.google.api.grpc grpc-google-cloud-monitoring-v3 - 2.0.3 + 2.0.4 com.google.cloud google-cloud-monitoring - 2.0.3 + 2.0.4 com.google.cloud google-cloud-shared-dependencies - 0.10.0 + 0.10.2 pom import diff --git a/proto-google-cloud-monitoring-v3/pom.xml b/proto-google-cloud-monitoring-v3/pom.xml index b59f4e3c..f975e0ce 100644 --- a/proto-google-cloud-monitoring-v3/pom.xml +++ b/proto-google-cloud-monitoring-v3/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-monitoring-v3 - 2.0.3 + 2.0.4 proto-google-cloud-monitoring-v3 PROTO library for proto-google-cloud-monitoring-v3 com.google.cloud google-cloud-monitoring-parent - 2.0.3 + 2.0.4 diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b8d0cb82..9176e3b6 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-monitoring - 2.0.3 + 2.0.4 diff --git a/samples/pom.xml b/samples/pom.xml index d9793123..17b00303 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -18,7 +18,7 @@ com.google.cloud.samples shared-configuration - 1.0.18 + 1.0.21 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5058b62b..d85bc856 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.18 + 1.0.21 @@ -28,7 +28,7 @@ com.google.cloud google-cloud-monitoring - 2.0.3 + 2.0.4 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0b06929b..b0a08aa5 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.18 + 1.0.21 @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 10.1.0 + 12.0.0 pom import diff --git a/synth.metadata b/synth.metadata index f5a9c5bf..1d768076 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-monitoring.git", - "sha": "f91c02e0b1643f255f59c0d618347623437682df" + "sha": "eb3c522ea49fb4dc4f73bdd1af70d1faa3eae7ac" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "80003a3de2d8a75f5b47cb2e77e018f7f0f776cc" + "sha": "8a7a3021fe97aa0a3641db642fe2b767f1c8110f" } } ], @@ -40,6 +40,7 @@ ".github/ISSUE_TEMPLATE/feature_request.md", ".github/ISSUE_TEMPLATE/support_request.md", ".github/PULL_REQUEST_TEMPLATE.md", + ".github/readme/synth.py", ".github/release-please.yml", ".github/trusted-contribution.yml", ".github/workflows/auto-release.yaml", @@ -52,6 +53,7 @@ ".kokoro/common.sh", ".kokoro/continuous/common.cfg", ".kokoro/continuous/java8.cfg", + ".kokoro/continuous/readme.cfg", ".kokoro/dependencies.sh", ".kokoro/linkage-monitor.sh", ".kokoro/nightly/common.cfg", @@ -75,6 +77,7 @@ ".kokoro/presubmit/linkage-monitor.cfg", ".kokoro/presubmit/lint.cfg", ".kokoro/presubmit/samples.cfg", + ".kokoro/readme.sh", ".kokoro/release/bump_snapshot.cfg", ".kokoro/release/common.cfg", ".kokoro/release/common.sh", @@ -92,7 +95,6 @@ "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "LICENSE", - "README.md", "codecov.yaml", "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java", "google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceSettings.java", diff --git a/versions.txt b/versions.txt index 6db0afbc..bd95fd5f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,6 +1,6 @@ # Format: # module:released-version:current-version -proto-google-cloud-monitoring-v3:2.0.3:2.0.3 -grpc-google-cloud-monitoring-v3:2.0.3:2.0.3 -google-cloud-monitoring:2.0.3:2.0.3 \ No newline at end of file +proto-google-cloud-monitoring-v3:2.0.4:2.0.4 +grpc-google-cloud-monitoring-v3:2.0.4:2.0.4 +google-cloud-monitoring:2.0.4:2.0.4 \ No newline at end of file