Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Commit b846ba7

Browse files
committed
Merge branch 'master' into showcase-filter-metadata
2 parents 67f1c02 + b791c86 commit b846ba7

163 files changed

Lines changed: 16127 additions & 4117 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
# For syntax help see:
55
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
66

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

911
# The java-samples-reviewers team is the default owner for samples changes
10-
samples/**/*.java @googleapis/java-samples-reviewers
12+
samples/**/*.java @googleapis/java-samples-reviewers @googleapis/api-spanner-java

.github/generated-files-bot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
externalManifests:
2+
- type: json
3+
file: 'synth.metadata'
4+
jsonpath: '$.generatedFiles[*]'
5+
- type: json
6+
file: '.github/readme/synth.metadata/synth.metadata'
7+
jsonpath: '$.generatedFiles[*]'
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"sources": [
3+
{
4+
"git": {
5+
"name": ".",
6+
"remote": "https://github.com/googleapis/java-spanner.git",
7+
"sha": "447a99b9a6ccdfd3855505fca13e849fb9513943"
8+
}
9+
},
10+
{
11+
"git": {
12+
"name": "synthtool",
13+
"remote": "https://github.com/googleapis/synthtool.git",
14+
"sha": "7fcc405a579d5d53a726ff3da1b7c8c08f0f2d58"
15+
}
16+
}
17+
]
18+
}

.github/readme/synth.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""This script is used to synthesize generated the README for this library."""
16+
17+
from synthtool.languages import java
18+
19+
java.custom_templates(["java_library/README.md"])

.github/snippet-bot.yml

Whitespace-only changes.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
on:
2+
pull_request:
3+
name: auto-merge-readme
4+
jobs:
5+
approve:
6+
runs-on: ubuntu-latest
7+
if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme'
8+
steps:
9+
- uses: actions/[email protected]
10+
with:
11+
github-token: ${{secrets.YOSHI_APPROVER_TOKEN}}
12+
script: |
13+
// only approve PRs from yoshi-automation
14+
if (context.payload.pull_request.user.login !== "yoshi-automation") {
15+
return;
16+
}
17+
18+
// only approve PRs like "chore: release <release version>"
19+
if (!context.payload.pull_request.title === "chore: regenerate README") {
20+
return;
21+
}
22+
23+
// only approve PRs with README.md and synth.metadata changes
24+
const files = new Set(
25+
(
26+
await github.paginate(
27+
github.pulls.listFiles.endpoint({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
pull_number: context.payload.pull_request.number,
31+
})
32+
)
33+
).map(file => file.filename)
34+
);
35+
if (files.size != 2 || !files.has("README.md") || !files.has(".github/readme/synth.metadata/synth.metadata")) {
36+
return;
37+
}
38+
39+
// approve README regeneration PR
40+
await github.pulls.createReview({
41+
owner: context.repo.owner,
42+
repo: context.repo.repo,
43+
body: 'Rubber stamped PR!',
44+
pull_number: context.payload.pull_request.number,
45+
event: 'APPROVE'
46+
});
47+
48+
// attach automerge label
49+
await github.issues.addLabels({
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
issue_number: context.payload.pull_request.number,
53+
labels: ['automerge']
54+
});

.github/workflows/auto-release.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ name: auto-release
44
jobs:
55
approve:
66
runs-on: ubuntu-latest
7+
if: contains(github.head_ref, 'release-v')
78
steps:
89
- uses: actions/[email protected]
910
with:
@@ -20,6 +21,24 @@ jobs:
2021
return;
2122
}
2223
24+
// only approve PRs with pom.xml and versions.txt changes
25+
const filesPromise = github.pulls.listFiles.endpoint({
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
pull_number: context.payload.pull_request.number,
29+
});
30+
const changed_files = await github.paginate(filesPromise)
31+
32+
if ( changed_files.length < 1 ) {
33+
console.log( "Not proceeding since PR is empty!" )
34+
return;
35+
}
36+
37+
if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) {
38+
console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" )
39+
return;
40+
}
41+
2342
// trigger auto-release when
2443
// 1) it is a SNAPSHOT release (auto-generated post regular release)
2544
// 2) there are dependency updates only

.github/workflows/formatting.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on:
2+
pull_request_target:
3+
types: [opened, synchronize]
4+
branches:
5+
- master
6+
name: format
7+
jobs:
8+
format-code:
9+
runs-on: ubuntu-latest
10+
env:
11+
ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
ref: ${{github.event.pull_request.head.ref}}
16+
repository: ${{github.event.pull_request.head.repo.full_name}}
17+
- uses: actions/setup-java@v1
18+
with:
19+
java-version: 11
20+
- run: "mvn com.coveo:fmt-maven-plugin:format"
21+
- uses: googleapis/[email protected]
22+
with:
23+
command: review
24+
pull_number: ${{ github.event.pull_request.number }}
25+
git_dir: '.'

.github/workflows/samples.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ on:
22
pull_request:
33
name: samples
44
jobs:
5-
lint:
5+
checkstyle:
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@v2

.kokoro/build.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,16 @@ integration)
6969
RETURN_CODE=$?
7070
;;
7171
samples)
72-
if [[ -f samples/pom.xml ]]
72+
SAMPLES_DIR=samples
73+
# only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise.
74+
if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]]
7375
then
74-
pushd samples
76+
SAMPLES_DIR=samples/snapshot
77+
fi
78+
79+
if [[ -f ${SAMPLES_DIR}/pom.xml ]]
80+
then
81+
pushd ${SAMPLES_DIR}
7582
mvn -B \
7683
-Penable-samples \
7784
-DtrimStackTrace=false \

0 commit comments

Comments
 (0)