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

Commit a8b0cfd

Browse files
committed
feat: initial generation
0 parents  commit a8b0cfd

File tree

101 files changed

+6164
-0
lines changed

Some content is hidden

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

101 files changed

+6164
-0
lines changed

.github/.OwlBot.lock.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
docker:
2+
digest: sha256:89f1301826d54cfa5cf5b8895817a362ca5ad1fecd8f55ab051ad4df4312aeae
3+
image: gcr.io/repo-automation-bots/owlbot-java:latest

.github/.OwlBot.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2021 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+
docker:
16+
image: "gcr.io/repo-automation-bots/owlbot-java:latest"
17+
18+
deep-remove-regex:
19+
- "/grpc-google-.*/src"
20+
- "/proto-google-.*/src"
21+
- "/google-.*/src"
22+
23+
deep-copy-regex:
24+
- source: "/google/cloud/gkeconnect/gateway/(v.*)/.*-java/proto-google-.*/src"
25+
dest: "/owl-bot-staging/$1/proto-google-cloud-gke-connect-gateway-$1/src"
26+
- source: "/google/cloud/gkeconnect/gateway/(v.*)/.*-java/grpc-google-.*/src"
27+
dest: "/owl-bot-staging/$1/grpc-google-cloud-gke-connect-gateway-$1/src"
28+
- source: "/google/cloud/gkeconnect/gateway/(v.*)/.*-java/gapic-google-.*/src"
29+
dest: "/owl-bot-staging/$1/google-cloud-gke-connect-gateway/src"

.github/CODEOWNERS

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Code owners file.
2+
# This file controls who is tagged for review for any given pull request.
3+
4+
# For syntax help see:
5+
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
6+
7+
* @googleapis/yoshi-java
8+
9+
# The java-samples-reviewers team is the default owner for samples changes
10+
samples/**/*.java @googleapis/java-samples-reviewers

.github/ISSUE_TEMPLATE/bug_report.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
Thanks for stopping by to let us know something could be better!
8+
9+
**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response.
10+
11+
Please run down the following list and make sure you've tried the usual "quick fixes":
12+
13+
- Search the issues already opened: https://github.com/googleapis/java-gke-connect-gateway/issues
14+
- Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform
15+
16+
If you are still having issues, please include as much information as possible:
17+
18+
#### Environment details
19+
20+
1. Specify the API at the beginning of the title. For example, "BigQuery: ...").
21+
General, Core, and Other are also allowed as types
22+
2. OS type and version:
23+
3. Java version:
24+
4. gke-connect-gateway version(s):
25+
26+
#### Steps to reproduce
27+
28+
1. ?
29+
2. ?
30+
31+
#### Code example
32+
33+
```java
34+
// example
35+
```
36+
37+
#### Stack trace
38+
```
39+
Any relevant stacktrace here.
40+
```
41+
42+
#### External references such as API reference guides
43+
44+
- ?
45+
46+
#### Any additional information below
47+
48+
49+
Following these steps guarantees the quickest resolution possible.
50+
51+
Thanks!
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this library
4+
5+
---
6+
7+
Thanks for stopping by to let us know something could be better!
8+
9+
**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response.
10+
11+
**Is your feature request related to a problem? Please describe.**
12+
What the problem is. Example: I'm always frustrated when [...]
13+
14+
**Describe the solution you'd like**
15+
What you want to happen.
16+
17+
**Describe alternatives you've considered**
18+
Any alternative solutions or features you've considered.
19+
20+
**Additional context**
21+
Any other context or screenshots about the feature request.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: Support request
3+
about: If you have a support contract with Google, please create an issue in the Google Cloud Support console.
4+
5+
---
6+
7+
**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response.

.github/PULL_REQUEST_TEMPLATE.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
2+
- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-gke-connect-gateway/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
3+
- [ ] Ensure the tests and linter pass
4+
- [ ] Code coverage does not decrease (if any source code was changed)
5+
- [ ] Appropriate docs were updated (if necessary)
6+
7+
Fixes #<issue_number_goes_here> ☕️

.github/blunderbuss.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Configuration for the Blunderbuss GitHub app. For more info see
2+
# https://github.com/googleapis/repo-automation-bots/tree/master/packages/blunderbuss
3+
assign_prs_by:
4+
- labels:
5+
- samples
6+
to:
7+
- googleapis/java-samples-reviewers

.github/generated-files-bot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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[*]'
8+
ignoreAuthors:
9+
- 'renovate-bot'
10+
- 'yoshi-automation'
11+
- 'release-please[bot]'
12+
- 'gcf-owl-bot[bot]'

.github/readme/synth.py

+19
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/release-please.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bumpMinorPreMajor: true
2+
handleGHRelease: true
3+
releaseType: java-yoshi

.github/snippet-bot.yml

Whitespace-only changes.

.github/sync-repo-settings.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
# Whether or not rebase-merging is enabled on this repository.
3+
# Defaults to `true`
4+
rebaseMergeAllowed: false
5+
6+
# Whether or not squash-merging is enabled on this repository.
7+
# Defaults to `true`
8+
squashMergeAllowed: true
9+
10+
# Whether or not PRs are merged with a merge commit on this repository.
11+
# Defaults to `false`
12+
mergeCommitAllowed: false
13+
14+
# Rules for master branch protection
15+
branchProtectionRules:
16+
# Identifies the protection rule pattern. Name of the branch to be protected.
17+
# Defaults to `master`
18+
- pattern: master
19+
# Can admins overwrite branch protection.
20+
# Defaults to `true`
21+
isAdminEnforced: true
22+
# Number of approving reviews required to update matching branches.
23+
# Defaults to `1`
24+
requiredApprovingReviewCount: 1
25+
# Are reviews from code owners required to update matching branches.
26+
# Defaults to `false`
27+
requiresCodeOwnerReviews: true
28+
# Require up to date branches
29+
requiresStrictStatusChecks: false
30+
# List of required status check contexts that must pass for commits to be accepted to matching branches.
31+
requiredStatusCheckContexts:
32+
- "dependencies (8)"
33+
- "dependencies (11)"
34+
- "linkage-monitor"
35+
- "lint"
36+
- "clirr"
37+
- "units (7)"
38+
- "units (8)"
39+
- "units (11)"
40+
- "Kokoro - Test: Integration"
41+
- "cla/google"
42+
# List of explicit permissions to add (additive only)
43+
permissionRules:
44+
- team: yoshi-admins
45+
permission: admin
46+
- team: yoshi-java-admins
47+
permission: admin
48+
- team: yoshi-java
49+
permission: push

.github/trusted-contribution.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
trustedContributors:
2+
- renovate-bot

.github/workflows/approve-readme.yaml

+54
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/github-script@v3
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

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
on:
2+
pull_request:
3+
name: auto-release
4+
jobs:
5+
approve:
6+
runs-on: ubuntu-latest
7+
if: contains(github.head_ref, 'release-please')
8+
steps:
9+
- uses: actions/github-script@v3
10+
with:
11+
github-token: ${{secrets.YOSHI_APPROVER_TOKEN}}
12+
debug: true
13+
script: |
14+
// only approve PRs from release-please[bot]
15+
if (context.payload.pull_request.user.login !== "release-please[bot]") {
16+
return;
17+
}
18+
19+
// only approve PRs like "chore: release <release version>"
20+
if ( !context.payload.pull_request.title.startsWith("chore: release") ) {
21+
return;
22+
}
23+
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+
42+
// trigger auto-release when
43+
// 1) it is a SNAPSHOT release (auto-generated post regular release)
44+
// 2) there are dependency updates only
45+
// 3) there are no open dependency update PRs in this repo (to avoid multiple releases)
46+
if (
47+
context.payload.pull_request.body.includes("Fix") ||
48+
context.payload.pull_request.body.includes("Build") ||
49+
context.payload.pull_request.body.includes("Documentation") ||
50+
context.payload.pull_request.body.includes("BREAKING CHANGES") ||
51+
context.payload.pull_request.body.includes("Features")
52+
) {
53+
console.log( "Not auto-releasing since it is not a dependency-update-only release." );
54+
return;
55+
}
56+
57+
const promise = github.pulls.list.endpoint({
58+
owner: context.repo.owner,
59+
repo: context.repo.repo,
60+
state: 'open'
61+
});
62+
const open_pulls = await github.paginate(promise)
63+
64+
if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) {
65+
for ( const pull of open_pulls ) {
66+
if ( pull.title.startsWith("deps: update dependency") ) {
67+
console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." );
68+
return;
69+
}
70+
}
71+
}
72+
73+
// approve release PR
74+
await github.pulls.createReview({
75+
owner: context.repo.owner,
76+
repo: context.repo.repo,
77+
body: 'Rubber stamped release!',
78+
pull_number: context.payload.pull_request.number,
79+
event: 'APPROVE'
80+
});
81+
82+
// attach kokoro:force-run and automerge labels
83+
await github.issues.addLabels({
84+
owner: context.repo.owner,
85+
repo: context.repo.repo,
86+
issue_number: context.payload.pull_request.number,
87+
labels: ['kokoro:force-run', 'automerge']
88+
});

0 commit comments

Comments
 (0)