Skip to content
Permalink
Browse files
feat: initial code generation
  • Loading branch information
Neenu1995 committed Jan 14, 2021
0 parents commit 2d28170995cdbb352076ab1db0a16cf96ae6f3d5
Showing with 35,897 additions and 0 deletions.
  1. +10 −0 .github/CODEOWNERS
  2. +51 −0 .github/ISSUE_TEMPLATE/bug_report.md
  3. +21 −0 .github/ISSUE_TEMPLATE/feature_request.md
  4. +7 −0 .github/ISSUE_TEMPLATE/support_request.md
  5. +7 −0 .github/PULL_REQUEST_TEMPLATE.md
  6. +7 −0 .github/blunderbuss.yml
  7. +11 −0 .github/generated-files-bot.yml
  8. +19 −0 .github/readme/synth.py
  9. +2 −0 .github/release-please.yml
  10. 0 .github/snippet-bot.yml
  11. +2 −0 .github/trusted-contribution.yml
  12. +54 −0 .github/workflows/approve-readme.yaml
  13. +88 −0 .github/workflows/auto-release.yaml
  14. +79 −0 .github/workflows/ci.yaml
  15. +14 −0 .github/workflows/samples.yaml
  16. +17 −0 .gitignore
  17. +3 −0 .kokoro/build.bat
  18. +118 −0 .kokoro/build.sh
  19. +38 −0 .kokoro/coerce_logs.sh
  20. +13 −0 .kokoro/common.cfg
  21. +58 −0 .kokoro/common.sh
  22. +25 −0 .kokoro/continuous/common.cfg
  23. +12 −0 .kokoro/continuous/java8.cfg
  24. +55 −0 .kokoro/continuous/readme.cfg
  25. +89 −0 .kokoro/dependencies.sh
  26. +46 −0 .kokoro/linkage-monitor.sh
  27. +25 −0 .kokoro/nightly/common.cfg
  28. +37 −0 .kokoro/nightly/integration.cfg
  29. +7 −0 .kokoro/nightly/java11.cfg
  30. +7 −0 .kokoro/nightly/java7.cfg
  31. +3 −0 .kokoro/nightly/java8-osx.cfg
  32. +3 −0 .kokoro/nightly/java8-win.cfg
  33. +12 −0 .kokoro/nightly/java8.cfg
  34. +38 −0 .kokoro/nightly/samples.cfg
  35. +43 −0 .kokoro/populate-secrets.sh
  36. +13 −0 .kokoro/presubmit/clirr.cfg
  37. +34 −0 .kokoro/presubmit/common.cfg
  38. +12 −0 .kokoro/presubmit/dependencies.cfg
  39. +33 −0 .kokoro/presubmit/integration.cfg
  40. +7 −0 .kokoro/presubmit/java11.cfg
  41. +7 −0 .kokoro/presubmit/java7.cfg
  42. +3 −0 .kokoro/presubmit/java8-osx.cfg
  43. +3 −0 .kokoro/presubmit/java8-win.cfg
  44. +12 −0 .kokoro/presubmit/java8.cfg
  45. +12 −0 .kokoro/presubmit/linkage-monitor.cfg
  46. +13 −0 .kokoro/presubmit/lint.cfg
  47. +33 −0 .kokoro/presubmit/samples.cfg
  48. +45 −0 .kokoro/readme.sh
  49. +53 −0 .kokoro/release/bump_snapshot.cfg
  50. +49 −0 .kokoro/release/common.cfg
  51. +50 −0 .kokoro/release/common.sh
  52. +6 −0 .kokoro/release/drop.cfg
  53. +32 −0 .kokoro/release/drop.sh
  54. +6 −0 .kokoro/release/promote.cfg
  55. +34 −0 .kokoro/release/promote.sh
  56. +29 −0 .kokoro/release/publish_javadoc.cfg
  57. +77 −0 .kokoro/release/publish_javadoc.sh
  58. +6 −0 .kokoro/release/snapshot.cfg
  59. +33 −0 .kokoro/release/snapshot.sh
  60. +19 −0 .kokoro/release/stage.cfg
  61. +45 −0 .kokoro/release/stage.sh
  62. +26 −0 .kokoro/trampoline.sh
  63. +15 −0 .repo-metadata.json
  64. +94 −0 CODE_OF_CONDUCT.md
  65. +139 −0 CONTRIBUTING.md
  66. +202 −0 LICENSE
  67. +4 −0 codecov.yaml
  68. +97 −0 google-cloud-networkconnectivity-bom/pom.xml
  69. +111 −0 google-cloud-networkconnectivity/pom.xml
  70. +901 −0 ...orkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceClient.java
  71. +355 −0 ...kconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceSettings.java
  72. +31 −0 ...networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/package-info.java
  73. +115 −0 ...c/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/GrpcHubServiceCallableFactory.java
  74. +532 −0 ...ectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/GrpcHubServiceStub.java
  75. +138 −0 ...connectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/HubServiceStub.java
  76. +883 −0 ...vity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/HubServiceStubSettings.java
  77. +967 −0 ...onnectivity/src/test/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceClientTest.java
  78. +59 −0 ...tworkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1alpha1/MockHubService.java
  79. +202 −0 ...kconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1alpha1/MockHubServiceImpl.java
  80. +65 −0 grpc-google-cloud-networkconnectivity-v1alpha1/pom.xml
  81. +1,380 −0 ...ectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceGrpc.java
  82. +15 −0 java.header
  83. +10 −0 license-checks.xml
  84. +189 −0 pom.xml
  85. +42 −0 proto-google-cloud-networkconnectivity-v1alpha1/pom.xml
  86. +93 −0 ...onnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CommonProto.java
  87. +1,388 −0 ...tivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateHubRequest.java
  88. +165 −0 ...alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateHubRequestOrBuilder.java
  89. +1,389 −0 ...vity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateSpokeRequest.java
  90. +165 −0 ...pha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateSpokeRequestOrBuilder.java
  91. +906 −0 ...tivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteHubRequest.java
  92. +99 −0 ...alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteHubRequestOrBuilder.java
  93. +907 −0 ...vity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteSpokeRequest.java
  94. +99 −0 ...pha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteSpokeRequestOrBuilder.java
  95. +651 −0 ...nectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetHubRequest.java
  96. +54 −0 ...-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetHubRequestOrBuilder.java
  97. +655 −0 ...ctivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetSpokeRequest.java
  98. +54 −0 ...1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetSpokeRequestOrBuilder.java
  99. +2,184 −0 ...networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/Hub.java
  100. +191 −0 ...orkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubName.java
  101. +287 −0 ...nnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubOrBuilder.java
  102. +443 −0 ...rkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubProto.java
  103. +217 −0 ...nnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/InstanceName.java
  104. +224 −0 ...lpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/InterconnectAttachmentName.java
  105. +1,282 −0 ...ctivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsRequest.java
  106. +142 −0 ...1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsRequestOrBuilder.java
  107. +1,422 −0 ...tivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsResponse.java
  108. +155 −0 ...alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsResponseOrBuilder.java
  109. +1,285 −0 ...ivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesRequest.java
  110. +142 −0 ...lpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesRequestOrBuilder.java
  111. +1,426 −0 ...vity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesResponse.java
  112. +155 −0 ...pha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesResponseOrBuilder.java
  113. +192 −0 ...nnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/LocationName.java
  114. +1,856 −0 ...ivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/OperationMetadata.java
  115. +217 −0 ...lpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/OperationMetadataOrBuilder.java
  116. +973 −0 ...v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/RouterApplianceInstance.java
  117. +90 −0 ...src/main/java/com/google/cloud/networkconnectivity/v1alpha1/RouterApplianceInstanceOrBuilder.java
  118. +3,236 −0 ...tworkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/Spoke.java
  119. +223 −0 ...kconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/SpokeName.java
  120. +433 −0 ...ectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/SpokeOrBuilder.java
  121. +1,348 −0 ...tivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateHubRequest.java
  122. +161 −0 ...alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateHubRequestOrBuilder.java
  123. +1,349 −0 ...vity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateSpokeRequest.java
  124. +161 −0 ...pha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateSpokeRequestOrBuilder.java
  125. +223 −0 ...nectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/VpnTunnelName.java
  126. +53 −0 ...etworkconnectivity-v1alpha1/src/main/proto/google/cloud/networkconnectivity/v1alpha1/common.proto
  127. +525 −0 ...d-networkconnectivity-v1alpha1/src/main/proto/google/cloud/networkconnectivity/v1alpha1/hub.proto
  128. +73 −0 renovate.json
  129. +84 −0 samples/install-without-bom/pom.xml
  130. +56 −0 samples/pom.xml
  131. +83 −0 samples/snapshot/pom.xml
  132. +47 −0 samples/snippets/pom.xml
  133. +37 −0 synth.metadata
  134. +32 −0 synth.py
  135. +6 −0 versions.txt
Validating CODEOWNERS rules …
@@ -0,0 +1,10 @@
# Code owners file.
# This file controls who is tagged for review for any given pull request.

# 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
@@ -0,0 +1,51 @@
---
name: Bug report
about: Create a report to help us improve

---

Thanks for stopping by to let us know something could be better!

**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.

Please run down the following list and make sure you've tried the usual "quick fixes":

- Search the issues already opened: https://github.com/googleapis/java-networkconnectivity/issues
- Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform

If you are still having issues, please include as much information as possible:

#### Environment details

1. Specify the API at the beginning of the title. For example, "BigQuery: ...").
General, Core, and Other are also allowed as types
2. OS type and version:
3. Java version:
4. networkconnectivity version(s):

#### Steps to reproduce

1. ?
2. ?

#### Code example

```java
// example
```

#### Stack trace
```
Any relevant stacktrace here.
```

#### External references such as API reference guides

- ?

#### Any additional information below


Following these steps guarantees the quickest resolution possible.

Thanks!
@@ -0,0 +1,21 @@
---
name: Feature request
about: Suggest an idea for this library

---

Thanks for stopping by to let us know something could be better!

**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.

**Is your feature request related to a problem? Please describe.**
What the problem is. Example: I'm always frustrated when [...]

**Describe the solution you'd like**
What you want to happen.

**Describe alternatives you've considered**
Any alternative solutions or features you've considered.

**Additional context**
Any other context or screenshots about the feature request.
@@ -0,0 +1,7 @@
---
name: Support request
about: If you have a support contract with Google, please create an issue in the Google Cloud Support console.

---

**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.
@@ -0,0 +1,7 @@
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:
- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-networkconnectivity/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> ☕️
@@ -0,0 +1,7 @@
# Configuration for the Blunderbuss GitHub app. For more info see
# https://github.com/googleapis/repo-automation-bots/tree/master/packages/blunderbuss
assign_prs_by:
- labels:
- samples
to:
- googleapis/java-samples-reviewers
@@ -0,0 +1,11 @@
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]'
@@ -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"])
@@ -0,0 +1,2 @@
releaseType: java-yoshi
bumpMinorPreMajor: true
Empty file.
@@ -0,0 +1,2 @@
trustedContributors:
- renovate-bot
@@ -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']
});
@@ -0,0 +1,88 @@
on:
pull_request:
name: auto-release
jobs:
approve:
runs-on: ubuntu-latest
if: contains(github.head_ref, 'release-v')
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']
});
@@ -0,0 +1,79 @@
on:
push:
branches:
- master
pull_request:
name: ci
jobs:
units:
runs-on: ubuntu-latest
strategy:
matrix:
java: [7, 8, 11]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: ${{matrix.java}}
- run: java -version
- 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:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- run: java -version
- run: .kokoro/build.bat
env:
JOB_TYPE: test
dependencies:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: ${{matrix.java}}
- run: java -version
- run: .kokoro/dependencies.sh
linkage-monitor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- run: java -version
- run: .kokoro/linkage-monitor.sh
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- run: java -version
- run: .kokoro/build.sh
env:
JOB_TYPE: lint
clirr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- run: java -version
- run: .kokoro/build.sh
env:
JOB_TYPE: clirr
@@ -0,0 +1,14 @@
on:
pull_request:
name: samples
jobs:
checkstyle:
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

0 comments on commit 2d28170

Please sign in to comment.