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

Commit

Permalink
chore: regenerate common templates
Browse files Browse the repository at this point in the history
  • Loading branch information
chingor13 committed Sep 22, 2020
1 parent 63aca03 commit 18af23a
Show file tree
Hide file tree
Showing 28 changed files with 158 additions and 251 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
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
@@ -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']
});
2 changes: 1 addition & 1 deletion .kokoro/build.bat
@@ -1,3 +1,3 @@
:: See documentation in type-shell-output.bat

"C:\Program Files\Git\bin\bash.exe" github/java-common-protos/.kokoro/build.sh
"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh
6 changes: 2 additions & 4 deletions .kokoro/build.sh
Expand Up @@ -39,7 +39,7 @@ retry_with_backoff 3 10 \

# 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
export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_ROOT}/src/${GOOGLE_APPLICATION_CREDENTIALS})
export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS})
fi

RETURN_CODE=0
Expand All @@ -51,9 +51,7 @@ test)
RETURN_CODE=$?
;;
lint)
mvn \
-Penable-samples \
com.coveo:fmt-maven-plugin:check
mvn com.coveo:fmt-maven-plugin:check
RETURN_CODE=$?
;;
javadoc)
Expand Down
12 changes: 0 additions & 12 deletions .kokoro/continuous/dependencies.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions .kokoro/continuous/integration.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.

11 changes: 7 additions & 4 deletions .kokoro/dependencies.sh
Expand Up @@ -41,12 +41,15 @@ echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************"
## Run dependency list completeness check
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] .*:.*:.*:.*:.*' | 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 @@ -83,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.

12 changes: 4 additions & 8 deletions .kokoro/nightly/integration.cfg
Expand Up @@ -28,14 +28,10 @@ env_vars: {

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "keystore/73713_java_it_service_account"
value: "secret_manager/java-it-service-account"
}

before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "java_it_service_account"
}
}
env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}
13 changes: 0 additions & 13 deletions .kokoro/nightly/lint.cfg

This file was deleted.

16 changes: 6 additions & 10 deletions .kokoro/nightly/samples.cfg
Expand Up @@ -24,19 +24,15 @@ env_vars: {

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "keystore/73713_java_it_service_account"
value: "secret_manager/java-docs-samples-service-account"
}

env_vars: {
key: "ENABLE_BUILD_COP"
value: "true"
key: "SECRET_MANAGER_KEYS"
value: "java-docs-samples-service-account"
}

before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "java_it_service_account"
}
}
env_vars: {
key: "ENABLE_BUILD_COP"
value: "true"
}
12 changes: 4 additions & 8 deletions .kokoro/presubmit/integration.cfg
Expand Up @@ -24,14 +24,10 @@ env_vars: {

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "keystore/73713_java_it_service_account"
value: "secret_manager/java-it-service-account"
}

before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "java_it_service_account"
}
}
env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}
14 changes: 5 additions & 9 deletions .kokoro/presubmit/samples.cfg
Expand Up @@ -24,14 +24,10 @@ env_vars: {

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "keystore/73713_java_it_service_account"
value: "secret_manager/java-docs-samples-service-account"
}

before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "java_it_service_account"
}
}
}
env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-docs-samples-service-account"
}

0 comments on commit 18af23a

Please sign in to comment.