Skip to content

Commit

Permalink
Merge branch 'master' of github.com:thiagotnunes/java-spanner into ad…
Browse files Browse the repository at this point in the history
…ds-query-optimizer-statistics-support
  • Loading branch information
thiagotnunes committed Jun 5, 2021
2 parents 5c055a4 + 8a23ad0 commit d69f217
Show file tree
Hide file tree
Showing 500 changed files with 65,122 additions and 22,885 deletions.
6 changes: 5 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -4,5 +4,9 @@
# For syntax help see:
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax

# The @googleapis/api-spanner-java is the default owner for changes in this repo
* @googleapis/yoshi-java @googleapis/api-spanner-java
**/*.java @googleapis/api-spanner-java

# The java-samples-reviewers team is the default owner for samples changes
samples/**/*.java @googleapis/java-samples-reviewers
samples/**/*.java @googleapis/java-samples-reviewers @googleapis/api-spanner-java
9 changes: 9 additions & 0 deletions .github/blunderbuss.yml
@@ -0,0 +1,9 @@
# Configuration for the Blunderbuss GitHub app. For more info see
# https://github.com/googleapis/repo-automation-bots/tree/master/packages/blunderbuss
assign_issues:
- thiagotnunes
assign_prs_by:
- labels:
- samples
to:
- googleapis/java-samples-reviewers
12 changes: 12 additions & 0 deletions .github/generated-files-bot.yml
@@ -0,0 +1,12 @@
externalManifests:
- type: json
file: 'synth.metadata'
jsonpath: '$.generatedFiles[*]'
- type: json
file: '.github/readme/synth.metadata/synth.metadata'
jsonpath: '$.generatedFiles[*]'
ignoreAuthors:
- 'renovate-bot'
- 'yoshi-automation'
- 'release-please[bot]'
- 'gcf-owl-bot[bot]'
18 changes: 18 additions & 0 deletions .github/readme/synth.metadata/synth.metadata
@@ -0,0 +1,18 @@
{
"sources": [
{
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-spanner.git",
"sha": "934e07ae5652b4d8860273116ea28798033c1ac9"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "a2de127f90799cd5bace653b1dcc5dd2ca8b19c9"
}
}
]
}
19 changes: 19 additions & 0 deletions .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"])
18 changes: 17 additions & 1 deletion .github/release-please.yml
@@ -1,2 +1,18 @@
releaseType: java-yoshi
bumpMinorPreMajor: true
bumpMinorPreMajor: true
branches:
- branch: 3.1.x
releaseType: java-yoshi
bumpMinorPreMajor: true
- branch: 3.3.x
releaseType: java-yoshi
bumpMinorPreMajor: true
- branch: 4.0.x
releaseType: java-yoshi
bumpMinorPreMajor: true
- branch: 5.2.x
releaseType: java-yoshi
bumpMinorPreMajor: true
- releaseType: java-lts
bumpMinorPreMajor: true
branch: 3.3.3-sp
Empty file added .github/snippet-bot.yml
Empty file.
95 changes: 95 additions & 0 deletions .github/sync-repo-settings.yaml
@@ -0,0 +1,95 @@
rebaseMergeAllowed: false
squashMergeAllowed: true
mergeCommitAllowed: false
branchProtectionRules:
- pattern: master
isAdminEnforced: true
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: false
requiredStatusCheckContexts:
- dependencies (8)
- dependencies (11)
- linkage-monitor
- lint
- clirr
- units (8)
- units (11)
- 'Kokoro - Test: Integration'
- cla/google
- pattern: 3.1.x
isAdminEnforced: true
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: false
requiredStatusCheckContexts:
- dependencies (8)
- dependencies (11)
- lint
- units (7)
- units (8)
- units (11)
- 'Kokoro - Test: Integration'
- cla/google
- pattern: 3.3.x
isAdminEnforced: true
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: false
requiredStatusCheckContexts:
- dependencies (8)
- dependencies (11)
- lint
- units (7)
- units (8)
- units (11)
- 'Kokoro - Test: Integration'
- cla/google
- pattern: 4.0.x
isAdminEnforced: true
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: false
requiredStatusCheckContexts:
- dependencies (8)
- dependencies (11)
- lint
- units (7)
- units (8)
- units (11)
- 'Kokoro - Test: Integration'
- cla/google
- pattern: 5.2.x
isAdminEnforced: true
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: false
requiredStatusCheckContexts:
- dependencies (8)
- dependencies (11)
- lint
- units (7)
- units (8)
- units (11)
- 'Kokoro - Test: Integration'
- cla/google
- pattern: 3.3.3-sp
isAdminEnforced: true
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: false
requiredStatusCheckContexts:
- dependencies (8)
- dependencies (11)
- lint
- units (8)
- units (11)
- 'Kokoro - Test: Integration'
- cla/google
permissionRules:
- team: yoshi-admins
permission: admin
- team: yoshi-java-admins
permission: admin
- team: yoshi-java
permission: push
54 changes: 54 additions & 0 deletions .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
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 <release version>"
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']
});
88 changes: 88 additions & 0 deletions .github/workflows/auto-release.yaml
@@ -0,0 +1,88 @@
on:
pull_request:
name: auto-release
jobs:
approve:
runs-on: ubuntu-latest
if: contains(github.head_ref, 'release-please')
steps:
- uses: actions/github-script@v3
with:
github-token: ${{secrets.YOSHI_APPROVER_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;
}
// 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
// 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: 7 additions & 7 deletions .github/workflows/ci.yaml
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [7, 8, 11]
java: [8, 11]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
Expand All @@ -19,10 +19,6 @@ jobs:
- run: .kokoro/build.sh
env:
JOB_TYPE: test
- name: coverage
uses: codecov/codecov-action@v1
with:
name: actions ${{matrix.java}}
windows:
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -54,7 +50,11 @@ jobs:
with:
java-version: 8
- run: java -version
- run: .kokoro/linkage-monitor.sh
- name: Install artifacts to local Maven repository
run: .kokoro/build.sh
shell: bash
- name: Validate any conflicts with regard to com.google.cloud:libraries-bom (latest release)
uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor
lint:
runs-on: ubuntu-latest
steps:
Expand All @@ -76,4 +76,4 @@ jobs:
- run: java -version
- run: .kokoro/build.sh
env:
JOB_TYPE: clirr
JOB_TYPE: clirr
2 changes: 1 addition & 1 deletion .github/workflows/samples.yaml
Expand Up @@ -2,7 +2,7 @@ on:
pull_request:
name: samples
jobs:
lint:
checkstyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down

0 comments on commit d69f217

Please sign in to comment.