Skip to content
Permalink
Browse files
feat: initial generation
  • Loading branch information
chingor13 committed Mar 4, 2021
0 parents commit b2e947d7ddcdb578505de5ed1f12fe6b4ca598ac
Showing with 15,634 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. +83 −0 .github/workflows/ci.yaml
  15. +14 −0 .github/workflows/samples.yaml
  16. +17 −0 .gitignore
  17. +3 −0 .kokoro/build.bat
  18. +120 −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. +25 −0 .kokoro/nightly/common.cfg
  27. +37 −0 .kokoro/nightly/integration.cfg
  28. +7 −0 .kokoro/nightly/java11.cfg
  29. +7 −0 .kokoro/nightly/java7.cfg
  30. +3 −0 .kokoro/nightly/java8-osx.cfg
  31. +3 −0 .kokoro/nightly/java8-win.cfg
  32. +12 −0 .kokoro/nightly/java8.cfg
  33. +38 −0 .kokoro/nightly/samples.cfg
  34. +43 −0 .kokoro/populate-secrets.sh
  35. +13 −0 .kokoro/presubmit/clirr.cfg
  36. +34 −0 .kokoro/presubmit/common.cfg
  37. +12 −0 .kokoro/presubmit/dependencies.cfg
  38. +33 −0 .kokoro/presubmit/integration.cfg
  39. +7 −0 .kokoro/presubmit/java11.cfg
  40. +7 −0 .kokoro/presubmit/java7.cfg
  41. +3 −0 .kokoro/presubmit/java8-osx.cfg
  42. +3 −0 .kokoro/presubmit/java8-win.cfg
  43. +12 −0 .kokoro/presubmit/java8.cfg
  44. +12 −0 .kokoro/presubmit/linkage-monitor.cfg
  45. +13 −0 .kokoro/presubmit/lint.cfg
  46. +33 −0 .kokoro/presubmit/samples.cfg
  47. +45 −0 .kokoro/readme.sh
  48. +53 −0 .kokoro/release/bump_snapshot.cfg
  49. +49 −0 .kokoro/release/common.cfg
  50. +50 −0 .kokoro/release/common.sh
  51. +6 −0 .kokoro/release/drop.cfg
  52. +32 −0 .kokoro/release/drop.sh
  53. +6 −0 .kokoro/release/promote.cfg
  54. +34 −0 .kokoro/release/promote.sh
  55. +23 −0 .kokoro/release/publish_javadoc.cfg
  56. +58 −0 .kokoro/release/publish_javadoc.sh
  57. +30 −0 .kokoro/release/publish_javadoc11.cfg
  58. +55 −0 .kokoro/release/publish_javadoc11.sh
  59. +6 −0 .kokoro/release/snapshot.cfg
  60. +33 −0 .kokoro/release/snapshot.sh
  61. +19 −0 .kokoro/release/stage.cfg
  62. +45 −0 .kokoro/release/stage.sh
  63. +26 −0 .kokoro/trampoline.sh
  64. +15 −0 .repo-metadata.json
  65. +94 −0 CODE_OF_CONDUCT.md
  66. +139 −0 CONTRIBUTING.md
  67. +201 −0 LICENSE
  68. +143 −0 README.md
  69. +4 −0 codecov.yaml
  70. +97 −0 google-cloud-policy-troubleshooter-bom/pom.xml
  71. +111 −0 google-cloud-policy-troubleshooter/pom.xml
  72. +214 −0 ...olicy-troubleshooter/src/main/java/com/google/cloud/policytroubleshooter/v1/IamCheckerClient.java
  73. +183 −0 ...icy-troubleshooter/src/main/java/com/google/cloud/policytroubleshooter/v1/IamCheckerSettings.java
  74. +21 −0 ...-policy-troubleshooter/src/main/java/com/google/cloud/policytroubleshooter/v1/gapic_metadata.json
  75. +38 −0 ...ud-policy-troubleshooter/src/main/java/com/google/cloud/policytroubleshooter/v1/package-info.java
  76. +113 −0 ...er/src/main/java/com/google/cloud/policytroubleshooter/v1/stub/GrpcIamCheckerCallableFactory.java
  77. +155 −0 ...roubleshooter/src/main/java/com/google/cloud/policytroubleshooter/v1/stub/GrpcIamCheckerStub.java
  78. +41 −0 ...cy-troubleshooter/src/main/java/com/google/cloud/policytroubleshooter/v1/stub/IamCheckerStub.java
  79. +267 −0 ...leshooter/src/main/java/com/google/cloud/policytroubleshooter/v1/stub/IamCheckerStubSettings.java
  80. +118 −0 ...y-troubleshooter/src/test/java/com/google/cloud/policytroubleshooter/v1/IamCheckerClientTest.java
  81. +59 −0 ...-policy-troubleshooter/src/test/java/com/google/cloud/policytroubleshooter/v1/MockIamChecker.java
  82. +82 −0 ...icy-troubleshooter/src/test/java/com/google/cloud/policytroubleshooter/v1/MockIamCheckerImpl.java
  83. +65 −0 grpc-google-cloud-policy-troubleshooter-v1/pom.xml
  84. +379 −0 ...licy-troubleshooter-v1/src/main/java/com/google/cloud/policytroubleshooter/v1/IamCheckerGrpc.java
  85. +15 −0 java.header
  86. +10 −0 license-checks.xml
  87. +189 −0 pom.xml
  88. +46 −0 proto-google-cloud-policy-troubleshooter-v1/pom.xml
  89. +112 −0 ...icy-troubleshooter-v1/src/main/java/com/google/cloud/policytroubleshooter/v1/IAMCheckerProto.java
  90. +765 −0 ...ooter-v1/src/main/java/com/google/cloud/policytroubleshooter/v1/TroubleshootIamPolicyRequest.java
  91. +63 −0 ...src/main/java/com/google/cloud/policytroubleshooter/v1/TroubleshootIamPolicyRequestOrBuilder.java
  92. +1,346 −0 ...oter-v1/src/main/java/com/google/cloud/policytroubleshooter/v1/TroubleshootIamPolicyResponse.java
  93. +147 −0 ...rc/main/java/com/google/cloud/policytroubleshooter/v1/TroubleshootIamPolicyResponseOrBuilder.java
  94. +7,937 −0 ...oud-policy-troubleshooter-v1/src/main/java/google/cloud/policytroubleshooter/v1/Explanations.java
  95. +74 −0 ...-cloud-policy-troubleshooter-v1/src/main/proto/google/cloud/policytroubleshooter/v1/checker.proto
  96. +245 −0 ...d-policy-troubleshooter-v1/src/main/proto/google/cloud/policytroubleshooter/v1/explanations.proto
  97. +73 −0 renovate.json
  98. +84 −0 samples/install-without-bom/pom.xml
  99. +56 −0 samples/pom.xml
  100. +83 −0 samples/snapshot/pom.xml
  101. +47 −0 samples/snippets/pom.xml
  102. +33 −0 synth.metadata
  103. +31 −0 synth.py
  104. +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-policy-troubleshooter/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. policy-troubleshooter 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-policy-troubleshooter/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-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(master): release <release version>"
if ( !context.payload.pull_request.title.startsWith("chore(master): 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,83 @@
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
- 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:
- 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 b2e947d

Please sign in to comment.