From 8f9dd437270c27170c7b66876d472d936b9c2a92 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 30 Oct 2020 15:43:57 -0700 Subject: [PATCH 01/11] build: rename samples lint workflow to checkstyle to disambiguate branch protection with unit lint Source-Author: BenWhitehead Source-Date: Wed Sep 30 15:14:05 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 8a7a3021fe97aa0a3641db642fe2b767f1c8110f Source-Link: https://github.com/googleapis/synthtool/commit/8a7a3021fe97aa0a3641db642fe2b767f1c8110f --- .github/workflows/samples.yaml | 2 +- synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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/synth.metadata b/synth.metadata index 936eff1d..55a2b317 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-mediatranslation.git", - "sha": "d5b38890565a89f1594bba606db04cfade229c77" + "sha": "7ddfa2b271197a1ef02c7b11f3d4696298f8433c" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e6168630be3e31eede633ba2c6f1cd64248dec1c" + "sha": "8a7a3021fe97aa0a3641db642fe2b767f1c8110f" } } ], From 98a84854da4d444b64040850e2f03b7b04980c71 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 30 Oct 2020 15:44:23 -0700 Subject: [PATCH 02/11] build(java): readme.sh should be executable Source-Author: Jeff Ching Source-Date: Wed Sep 30 13:20:04 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 0762e8ee2ec21cdfc4d82020b985a104feb0453b Source-Link: https://github.com/googleapis/synthtool/commit/0762e8ee2ec21cdfc4d82020b985a104feb0453b --- .kokoro/readme.sh | 0 synth.metadata | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 .kokoro/readme.sh diff --git a/.kokoro/readme.sh b/.kokoro/readme.sh old mode 100644 new mode 100755 diff --git a/synth.metadata b/synth.metadata index 55a2b317..ec714327 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8a7a3021fe97aa0a3641db642fe2b767f1c8110f" + "sha": "0762e8ee2ec21cdfc4d82020b985a104feb0453b" } } ], From 7be3917bfe13aa7256ffc6ec892346a8712188dc Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 30 Oct 2020 15:45:14 -0700 Subject: [PATCH 03/11] ci(java): suggest formatting fixes GitHub action config to run the java formatter and suggest inline fixes on the pull request. This was tested in java-asset: [example PR](https://github.com/googleapis/java-asset/pull/392). Source-Author: Jeff Ching Source-Date: Tue Oct 13 09:04:08 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: b65ef07d99946d23e900ef2cc490274a16edd336 Source-Link: https://github.com/googleapis/synthtool/commit/b65ef07d99946d23e900ef2cc490274a16edd336 --- .github/workflows/formatting.yaml | 25 +++++++++++++++++++++++++ synth.metadata | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/formatting.yaml diff --git a/.github/workflows/formatting.yaml b/.github/workflows/formatting.yaml new file mode 100644 index 00000000..d4d367cf --- /dev/null +++ b/.github/workflows/formatting.yaml @@ -0,0 +1,25 @@ +on: + pull_request_target: + types: [opened, synchronize] + branches: + - master +name: format +jobs: + format-code: + runs-on: ubuntu-latest + env: + ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }} + steps: + - uses: actions/checkout@v2 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + - uses: actions/setup-java@v1 + with: + java-version: 11 + - run: "mvn com.coveo:fmt-maven-plugin:format" + - uses: googleapis/code-suggester@v1.8.0 + with: + command: review + pull_number: ${{ github.event.pull_request.number }} + git_dir: '.' diff --git a/synth.metadata b/synth.metadata index ec714327..93200c8c 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0762e8ee2ec21cdfc4d82020b985a104feb0453b" + "sha": "b65ef07d99946d23e900ef2cc490274a16edd336" } } ], @@ -45,6 +45,7 @@ ".github/trusted-contribution.yml", ".github/workflows/auto-release.yaml", ".github/workflows/ci.yaml", + ".github/workflows/formatting.yaml", ".github/workflows/samples.yaml", ".kokoro/build.bat", ".kokoro/build.sh", From 2f34ae36ca0734317437ade5cdec827cd8f6e32f Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 30 Oct 2020 15:45:40 -0700 Subject: [PATCH 04/11] ci(java): restrict presubmit samples ITs to only snapshot This is to reduce resource consumption since we often times hit resource quota limit in samples testing. e.g. https://github.com/googleapis/java-bigquerydatatransfer/issues/410 Source-Author: Stephanie Wang Source-Date: Thu Oct 15 17:16:14 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 27e0e916cbfdb3d5ff6639b686cc04f78a0b0386 Source-Link: https://github.com/googleapis/synthtool/commit/27e0e916cbfdb3d5ff6639b686cc04f78a0b0386 --- .kokoro/build.sh | 11 +++++++++-- synth.metadata | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 64abba85..f1873943 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -69,9 +69,16 @@ integration) RETURN_CODE=$? ;; samples) - if [[ -f samples/pom.xml ]] + SAMPLES_DIR=samples + # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. + if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]] then - pushd samples + SAMPLES_DIR=samples/snapshot + fi + + if [[ -f ${SAMPLES_DIR}/pom.xml ]] + then + pushd {SAMPLES_DIR} mvn -B \ -Penable-samples \ -DtrimStackTrace=false \ diff --git a/synth.metadata b/synth.metadata index 93200c8c..826a09e6 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "b65ef07d99946d23e900ef2cc490274a16edd336" + "sha": "27e0e916cbfdb3d5ff6639b686cc04f78a0b0386" } } ], From 6e90d675f141afd6372ad296ebbdd188deb87738 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 30 Oct 2020 15:45:53 -0700 Subject: [PATCH 05/11] build(java): auto-approve README regeneration Source-Author: Jeff Ching Source-Date: Thu Oct 15 16:04:06 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 7c5370937dd9ba9dcf9cd7d2af880a58b389b4f1 Source-Link: https://github.com/googleapis/synthtool/commit/7c5370937dd9ba9dcf9cd7d2af880a58b389b4f1 --- .github/workflows/approve-readme.yaml | 54 +++++++++++++++++++++++++++ synth.metadata | 3 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/approve-readme.yaml diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml new file mode 100644 index 00000000..e2d841d6 --- /dev/null +++ b/.github/workflows/approve-readme.yaml @@ -0,0 +1,54 @@ +on: + pull_request: +name: auto-merge-readme +jobs: + approve: + runs-on: ubuntu-latest + if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' + steps: + - uses: actions/github-script@v3.0.0 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + script: | + // only approve PRs from yoshi-automation + if (context.payload.pull_request.user.login !== "yoshi-automation") { + return; + } + + // only approve PRs like "chore: release " + if (!context.payload.pull_request.title === "chore: regenerate README") { + return; + } + + // only approve PRs with README.md and synth.metadata changes + const files = new Set( + ( + await github.paginate( + github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }) + ) + ).map(file => file.filename) + ); + if (files.size != 2 || !files.has("README.md") || !files.has(".github/readme/synth.metadata/synth.metadata")) { + return; + } + + // approve README regeneration PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped PR!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach automerge label + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['automerge'] + }); diff --git a/synth.metadata b/synth.metadata index 826a09e6..852fadf4 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "27e0e916cbfdb3d5ff6639b686cc04f78a0b0386" + "sha": "7c5370937dd9ba9dcf9cd7d2af880a58b389b4f1" } } ], @@ -43,6 +43,7 @@ ".github/readme/synth.py", ".github/release-please.yml", ".github/trusted-contribution.yml", + ".github/workflows/approve-readme.yaml", ".github/workflows/auto-release.yaml", ".github/workflows/ci.yaml", ".github/workflows/formatting.yaml", From 7cef5603b9f6130e83fa3ab174445f92834640b2 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 30 Oct 2020 15:46:57 -0700 Subject: [PATCH 06/11] build(java): enable snippet-bot Source-Author: Jeff Ching Source-Date: Mon Oct 19 16:13:57 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 5a506ec8765cc04f7e29f888b8e9b257d9a7ae11 Source-Link: https://github.com/googleapis/synthtool/commit/5a506ec8765cc04f7e29f888b8e9b257d9a7ae11 --- .github/snippet-bot.yml | 0 synth.metadata | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .github/snippet-bot.yml diff --git a/.github/snippet-bot.yml b/.github/snippet-bot.yml new file mode 100644 index 00000000..e69de29b diff --git a/synth.metadata b/synth.metadata index 852fadf4..98748ab3 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "7c5370937dd9ba9dcf9cd7d2af880a58b389b4f1" + "sha": "5a506ec8765cc04f7e29f888b8e9b257d9a7ae11" } } ], @@ -42,6 +42,7 @@ ".github/PULL_REQUEST_TEMPLATE.md", ".github/readme/synth.py", ".github/release-please.yml", + ".github/snippet-bot.yml", ".github/trusted-contribution.yml", ".github/workflows/approve-readme.yaml", ".github/workflows/auto-release.yaml", From be15abf8f4fc385c4c0c90123d0a8e7d220d35a5 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 30 Oct 2020 15:46:57 -0700 Subject: [PATCH 07/11] chore: clean up and update renovate.json To remove unused package groupings and add "test" commit type Source-Author: Stephanie Wang Source-Date: Tue Oct 20 18:31:45 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 6abb59097be84599a1d6091fe534a49e5c5cf948 Source-Link: https://github.com/googleapis/synthtool/commit/6abb59097be84599a1d6091fe534a49e5c5cf948 --- renovate.json | 30 +++++++++++------------------- synth.metadata | 2 +- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/renovate.json b/renovate.json index 59c908f9..a43c2748 100644 --- a/renovate.json +++ b/renovate.json @@ -17,24 +17,6 @@ ], "versionScheme": "docker" }, - { - "packagePatterns": [ - "^com.google.api:gax", - "^com.google.auth:", - "^com.google.cloud:google-cloud-core", - "^io.grpc:", - "^com.google.guava:" - ], - "groupName": "core dependencies" - }, - { - "packagePatterns": [ - "^com.google.http-client:", - "^com.google.oauth-client:", - "^com.google.api-client:" - ], - "groupName": "core transport dependencies" - }, { "packagePatterns": [ "*" @@ -63,6 +45,16 @@ "semanticCommitType": "chore", "semanticCommitScope": "deps" }, + { + "packagePatterns": [ + "^junit:junit", + "^com.google.truth:truth", + "^org.mockito:mockito-core", + "^org.objenesis:objenesis" + ], + "semanticCommitType": "test", + "semanticCommitScope": "deps" + }, { "packagePatterns": [ "^com.google.cloud:google-cloud-" @@ -78,4 +70,4 @@ ], "semanticCommits": true, "masterIssue": true -} \ No newline at end of file +} diff --git a/synth.metadata b/synth.metadata index 98748ab3..f665126d 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5a506ec8765cc04f7e29f888b8e9b257d9a7ae11" + "sha": "6abb59097be84599a1d6091fe534a49e5c5cf948" } } ], From 0ffd542a09143fd91f070749db8d77e4f5100bce Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 30 Oct 2020 15:47:23 -0700 Subject: [PATCH 08/11] Update publish_javadoc.sh We don't want quite as much and need to be in `target/devsite/reference`. Source-Author: Les Vogel Source-Date: Thu Oct 22 14:10:05 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 9593c3b5b714cc9b17c445aee8834ac2b4b9348b Source-Link: https://github.com/googleapis/synthtool/commit/9593c3b5b714cc9b17c445aee8834ac2b4b9348b --- .kokoro/release/publish_javadoc.sh | 2 +- synth.metadata | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh index b1c84dc6..8a5d0877 100755 --- a/.kokoro/release/publish_javadoc.sh +++ b/.kokoro/release/publish_javadoc.sh @@ -62,7 +62,7 @@ popd # V2 mvn clean site -B -q -Ddevsite.template="${KOKORO_GFILE_DIR}/java/" -pushd target/devsite +pushd target/devsite/reference # create metadata python3 -m docuploader create-metadata \ diff --git a/synth.metadata b/synth.metadata index f665126d..3209f81b 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6abb59097be84599a1d6091fe534a49e5c5cf948" + "sha": "9593c3b5b714cc9b17c445aee8834ac2b4b9348b" } } ], From 41069c476907224c4a2b7e0be30067b2d99ba9ec Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 30 Oct 2020 15:48:01 -0700 Subject: [PATCH 09/11] chore(docs): update code of conduct of synthtool and templates Source-Author: Christopher Wilcox Source-Date: Thu Oct 22 14:22:01 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 5f6ef0ec5501d33c4667885b37a7685a30d41a76 Source-Link: https://github.com/googleapis/synthtool/commit/5f6ef0ec5501d33c4667885b37a7685a30d41a76 --- CODE_OF_CONDUCT.md | 7 ++++--- synth.metadata | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 6b2238bb..2add2547 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,3 +1,4 @@ + # Code of Conduct ## Our Pledge @@ -69,12 +70,12 @@ dispute. If you are unable to resolve the matter for any reason, or if the behavior is threatening or harassing, report it. We are dedicated to providing an environment where participants feel welcome and safe. -Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the -Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to receive and address reported violations of the code of conduct. They will then work with a committee consisting of representatives from the Open Source Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out the Project Steward, please email +are uncomfortable reaching out to the Project Steward, please email opensource@google.com. We will investigate every complaint, but you may not receive a direct response. diff --git a/synth.metadata b/synth.metadata index 3209f81b..4ff49514 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "9593c3b5b714cc9b17c445aee8834ac2b4b9348b" + "sha": "5f6ef0ec5501d33c4667885b37a7685a30d41a76" } } ], From 2f23e133434dfc8e0b444e843d43a66b8e217148 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 30 Oct 2020 15:48:39 -0700 Subject: [PATCH 10/11] chore(ci): fix typo in restrict presubmit samples ITs to only snapshot Fixes below error in Java repos when https://github.com/googleapis/synthtool/pull/804 was merged: ``` github/java-bigquerystorage/.kokoro/build.sh: line 81: pushd: {SAMPLES_DIR}: No such file or directory ``` Thanks @kolea2 for spotting this in Fusion build logs. cc @chingor13 Source-Author: Stephanie Wang Source-Date: Mon Oct 26 13:44:04 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: f68649c5f26bcff6817c6d21e90dac0fc71fef8e Source-Link: https://github.com/googleapis/synthtool/commit/f68649c5f26bcff6817c6d21e90dac0fc71fef8e --- .kokoro/build.sh | 2 +- synth.metadata | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index f1873943..fd7a092d 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -78,7 +78,7 @@ samples) if [[ -f ${SAMPLES_DIR}/pom.xml ]] then - pushd {SAMPLES_DIR} + pushd ${SAMPLES_DIR} mvn -B \ -Penable-samples \ -DtrimStackTrace=false \ diff --git a/synth.metadata b/synth.metadata index 4ff49514..1e4548cc 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5f6ef0ec5501d33c4667885b37a7685a30d41a76" + "sha": "f68649c5f26bcff6817c6d21e90dac0fc71fef8e" } } ], From 4ed21695695215ef7534bfd6aa22f5544ed4fe37 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 30 Oct 2020 15:49:04 -0700 Subject: [PATCH 11/11] chore(java): enable generated-files-bot This bot will comment on pull requests that modify templated files. For java, we configure to read from our 2 synth.metadata files: (primary templates and README) Source-Author: Jeff Ching Source-Date: Fri Oct 30 14:22:02 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: b19b401571e77192f8dd38eab5fb2300a0de9324 Source-Link: https://github.com/googleapis/synthtool/commit/b19b401571e77192f8dd38eab5fb2300a0de9324 --- .github/generated-files-bot.yml | 7 +++++++ synth.metadata | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .github/generated-files-bot.yml diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml new file mode 100644 index 00000000..20f3acc2 --- /dev/null +++ b/.github/generated-files-bot.yml @@ -0,0 +1,7 @@ +externalManifests: +- type: json + file: 'synth.metadata' + jsonpath: '$.generatedFiles[*]' +- type: json + file: '.github/readme/synth.metadata/synth.metadata' + jsonpath: '$.generatedFiles[*]' diff --git a/synth.metadata b/synth.metadata index 1e4548cc..3269ca4c 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "f68649c5f26bcff6817c6d21e90dac0fc71fef8e" + "sha": "b19b401571e77192f8dd38eab5fb2300a0de9324" } } ], @@ -40,6 +40,7 @@ ".github/ISSUE_TEMPLATE/feature_request.md", ".github/ISSUE_TEMPLATE/support_request.md", ".github/PULL_REQUEST_TEMPLATE.md", + ".github/generated-files-bot.yml", ".github/readme/synth.py", ".github/release-please.yml", ".github/snippet-bot.yml",