Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
chore: regenerate common templates (#186)
Browse files Browse the repository at this point in the history
* cleanup: removes unused kokoro config files

* cleanup: removes unused kokoro config files

Removes unused kokoro files from the java library template. We have
stopped running some of these due to Github quota issues.

* fix:reverts back samples.cfg files

The files presubmit/samples.cfg and nightly/samples.cfg should remain in
the java template repository.

Co-authored-by: Jeffrey Rennie <rennie@google.com>

Source-Author: Thiago Nunes <thiagotnunes@gmail.com>
Source-Date: Thu Aug 6 09:48:58 2020 +1000
Source-Repo: googleapis/synthtool
Source-Sha: 4530cc6ff080ef8aca258c1ec92c4db10a1bbfb4
Source-Link: googleapis/synthtool@4530cc6

* build: update dependencies check to only check for runtime and compile scopes

* change:Updated dependencies check to only use runtime & compile scope

* Update dependencies.sh

* feat: update dependencies check to only check for runtime and compile
scopes

Co-authored-by: Saleh Mostafa <salehmostafa@google.com>
Co-authored-by: Jeffrey Rennie <rennie@google.com>

Source-Author: salehsquared <salehmostafamain@gmail.com>
Source-Date: Thu Aug 6 13:01:02 2020 -0400
Source-Repo: googleapis/synthtool
Source-Sha: f8823dec98277a9516f2fb6fae9f58b3a59a23e1
Source-Link: googleapis/synthtool@f8823de

* chore(java_templates): add lint/static analysis presubmit checks for samples

* chore(java_templates): add lint/static analysis presubmit checks for samples

* chore: fix trailing whitespace

Source-Author: Jeff Ching <chingor@google.com>
Source-Date: Mon Aug 17 14:29:16 2020 -0700
Source-Repo: googleapis/synthtool
Source-Sha: c3caf0704f25a0c365f1c315e804a30b87c62a75
Source-Link: googleapis/synthtool@c3caf07

* chore(java_templates): stop running pmd/spotbugs checks for samples

This was creating too much noise. We will revisit with other options and/or tune these checks.

Source-Author: Jeff Ching <chingor@google.com>
Source-Date: Wed Aug 19 12:26:49 2020 -0700
Source-Repo: googleapis/synthtool
Source-Sha: 9602086c6c5b05db77950c7f7495a2a3868f3537
Source-Link: googleapis/synthtool@9602086

* fix: temporarily disable reporting to unblock releases

Source-Author: Stephanie Wang <stephaniewang526@users.noreply.github.com>
Source-Date: Tue Aug 25 13:05:26 2020 -0400
Source-Repo: googleapis/synthtool
Source-Sha: 968465a1cad496e1292ef4584a054a35f756ff94
Source-Link: googleapis/synthtool@968465a

* build(java): switch to release-publish app for notifying GitHub of release status

Source-Author: Jeff Ching <chingor@google.com>
Source-Date: Wed Aug 26 21:48:06 2020 -0700
Source-Repo: googleapis/synthtool
Source-Sha: 019c7168faa0e56619f792693a8acdb30d6de19b
Source-Link: googleapis/synthtool@019c716

* build(ci): enable auto-release for dependency-update-only releases

Automatically perform a Java client library release when:
1. Only dependency updates are going out in the release since any releases containing bug fixes, build changes or new features should be supervised;
2. There are no outstanding/open dependency update pull requests in the repo. This is to avoid multiple/redundant releases;
3. It is a SNAPSHOT release which is automatically generated post regular release -- this requires no human supervision.

Testing done in 5 java-bigquery* client library repos. Example:
[chore: release 0.3.4 ](googleapis/java-bigqueryconnection#130)
[chore: release 0.3.5-SNAPSHOT](googleapis/java-bigqueryconnection#131)

Source-Author: Stephanie Wang <stephaniewang526@users.noreply.github.com>
Source-Date: Thu Sep 17 15:30:02 2020 -0400
Source-Repo: googleapis/synthtool
Source-Sha: 538a68019eb4a36a0cdfa4021f324dd01b784395
Source-Link: googleapis/synthtool@538a680

* chore(java): set yoshi-java as default CODEOWNER

Source-Author: Jeff Ching <chingor@google.com>
Source-Date: Mon Sep 21 09:00:06 2020 -0700
Source-Repo: googleapis/synthtool
Source-Sha: 80003a3de2d8a75f5b47cb2e77e018f7f0f776cc
Source-Link: googleapis/synthtool@80003a3
  • Loading branch information
yoshi-automation committed Sep 22, 2020
1 parent e0dcbce commit 49de213
Show file tree
Hide file tree
Showing 16 changed files with 97 additions and 198 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
# For syntax help see:
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax

* @googleapis/yoshi-java

# The java-samples-reviewers team is the default owner for samples changes
samples/**/*.java @googleapis/java-samples-reviewers
69 changes: 69 additions & 0 deletions .github/workflows/auto-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
on:
pull_request:
name: auto-release
jobs:
approve:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3.0.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
debug: true
script: |
// only approve PRs from release-please[bot]
if (context.payload.pull_request.user.login !== "release-please[bot]") {
return;
}
// only approve PRs like "chore: release <release version>"
if ( !context.payload.pull_request.title.startsWith("chore: release") ) {
return;
}
// trigger auto-release when
// 1) it is a SNAPSHOT release (auto-generated post regular release)
// 2) there are dependency updates only
// 3) there are no open dependency update PRs in this repo (to avoid multiple releases)
if (
context.payload.pull_request.body.includes("Fix") ||
context.payload.pull_request.body.includes("Build") ||
context.payload.pull_request.body.includes("Documentation") ||
context.payload.pull_request.body.includes("BREAKING CHANGES") ||
context.payload.pull_request.body.includes("Features")
) {
console.log( "Not auto-releasing since it is not a dependency-update-only release." );
return;
}
const promise = github.pulls.list.endpoint({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open'
});
const open_pulls = await github.paginate(promise)
if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) {
for ( const pull of open_pulls ) {
if ( pull.title.startsWith("deps: update dependency") ) {
console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." );
return;
}
}
}
// approve release PR
await github.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Rubber stamped release!',
pull_number: context.payload.pull_request.number,
event: 'APPROVE'
});
// attach kokoro:force-run and automerge labels
await github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: ['kokoro:force-run', 'automerge']
});
14 changes: 14 additions & 0 deletions .github/workflows/samples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on:
pull_request:
name: samples
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Run checkstyle
run: mvn -P lint --quiet --batch-mode checkstyle:check
working-directory: samples/snippets
12 changes: 0 additions & 12 deletions .kokoro/continuous/dependencies.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions .kokoro/continuous/java11.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions .kokoro/continuous/java7.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions .kokoro/continuous/java8-osx.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions .kokoro/continuous/java8-win.cfg

This file was deleted.

13 changes: 0 additions & 13 deletions .kokoro/continuous/lint.cfg

This file was deleted.

53 changes: 0 additions & 53 deletions .kokoro/continuous/propose_release.cfg

This file was deleted.

31 changes: 0 additions & 31 deletions .kokoro/continuous/samples.cfg

This file was deleted.

9 changes: 5 additions & 4 deletions .kokoro/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ function completenessCheck() {
# Output dep list with compile scope generated using the original pom
# Running mvn dependency:list on Java versions that support modules will also include the module of the dependency.
# This is stripped from the output as it is not present in the flattened pom.
# Only dependencies with 'compile' or 'runtime' scope are included from original dependency list.
msg "Generating dependency list using original pom..."
mvn dependency:list -f pom.xml -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// | grep -v ':test$' >.org-list.txt
mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt

# Output dep list generated using the flattened pom (test scope deps are ommitted)
# Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes)
msg "Generating dependency list using flattened pom..."
mvn dependency:list -f .flattened-pom.xml -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt
mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt

# Compare two dependency lists
msg "Comparing dependency lists..."
Expand Down Expand Up @@ -85,4 +86,4 @@ then
else
msg "Errors found. See log statements above."
exit 1
fi
fi
12 changes: 0 additions & 12 deletions .kokoro/nightly/dependencies.cfg

This file was deleted.

13 changes: 0 additions & 13 deletions .kokoro/nightly/lint.cfg

This file was deleted.

31 changes: 3 additions & 28 deletions .kokoro/release/stage.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,7 @@ action {
}
}

# Fetch the token needed for reporting release status to GitHub
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "yoshi-automation-github-key"
}
}
}

# Fetch magictoken to use with Magic Github Proxy
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "releasetool-magictoken"
}
}
}

# Fetch api key to use with Magic Github Proxy
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "magic-github-proxy-api-key"
}
}
env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem"
}
16 changes: 4 additions & 12 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-redis.git",
"sha": "f3c275be0db719bb686ee7b906397c7d5622eef2"
"sha": "e0dcbce58140fa8c8cb0b974b6053f30c89dbd64"
}
},
{
Expand All @@ -27,7 +27,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "dd230c816f88d0141fcd0be83498986287220d1b"
"sha": "80003a3de2d8a75f5b47cb2e77e018f7f0f776cc"
}
}
],
Expand Down Expand Up @@ -59,32 +59,24 @@
".github/PULL_REQUEST_TEMPLATE.md",
".github/release-please.yml",
".github/trusted-contribution.yml",
".github/workflows/auto-release.yaml",
".github/workflows/ci.yaml",
".github/workflows/samples.yaml",
".kokoro/build.bat",
".kokoro/build.sh",
".kokoro/coerce_logs.sh",
".kokoro/common.cfg",
".kokoro/common.sh",
".kokoro/continuous/common.cfg",
".kokoro/continuous/dependencies.cfg",
".kokoro/continuous/java11.cfg",
".kokoro/continuous/java7.cfg",
".kokoro/continuous/java8-osx.cfg",
".kokoro/continuous/java8-win.cfg",
".kokoro/continuous/java8.cfg",
".kokoro/continuous/lint.cfg",
".kokoro/continuous/propose_release.cfg",
".kokoro/continuous/samples.cfg",
".kokoro/dependencies.sh",
".kokoro/linkage-monitor.sh",
".kokoro/nightly/common.cfg",
".kokoro/nightly/dependencies.cfg",
".kokoro/nightly/java11.cfg",
".kokoro/nightly/java7.cfg",
".kokoro/nightly/java8-osx.cfg",
".kokoro/nightly/java8-win.cfg",
".kokoro/nightly/java8.cfg",
".kokoro/nightly/lint.cfg",
".kokoro/nightly/samples.cfg",
".kokoro/populate-secrets.sh",
".kokoro/presubmit/clirr.cfg",
Expand Down

0 comments on commit 49de213

Please sign in to comment.