Skip to content
Permalink
Browse files
feat: initial generation
  • Loading branch information
Neenu1995 committed Jun 17, 2021
0 parents commit 4ff9303f2b7957dbf5e583389370ff51c8154ab9
Showing with 45,814 additions and 0 deletions.
  1. +3 −0 .github/.OwlBot.lock.yaml
  2. +32 −0 .github/.OwlBot.yaml
  3. +10 −0 .github/CODEOWNERS
  4. +51 −0 .github/ISSUE_TEMPLATE/bug_report.md
  5. +21 −0 .github/ISSUE_TEMPLATE/feature_request.md
  6. +7 −0 .github/ISSUE_TEMPLATE/support_request.md
  7. +7 −0 .github/PULL_REQUEST_TEMPLATE.md
  8. +7 −0 .github/blunderbuss.yml
  9. +12 −0 .github/generated-files-bot.yml
  10. +19 −0 .github/readme/synth.py
  11. +3 −0 .github/release-please.yml
  12. 0 .github/snippet-bot.yml
  13. +49 −0 .github/sync-repo-settings.yaml
  14. +2 −0 .github/trusted-contribution.yml
  15. +54 −0 .github/workflows/approve-readme.yaml
  16. +88 −0 .github/workflows/auto-release.yaml
  17. +79 −0 .github/workflows/ci.yaml
  18. +14 −0 .github/workflows/samples.yaml
  19. +17 −0 .gitignore
  20. +3 −0 .kokoro/build.bat
  21. +125 −0 .kokoro/build.sh
  22. +38 −0 .kokoro/coerce_logs.sh
  23. +13 −0 .kokoro/common.cfg
  24. +58 −0 .kokoro/common.sh
  25. +25 −0 .kokoro/continuous/common.cfg
  26. +12 −0 .kokoro/continuous/java8.cfg
  27. +55 −0 .kokoro/continuous/readme.cfg
  28. +90 −0 .kokoro/dependencies.sh
  29. +25 −0 .kokoro/nightly/common.cfg
  30. +37 −0 .kokoro/nightly/integration.cfg
  31. +7 −0 .kokoro/nightly/java11.cfg
  32. +7 −0 .kokoro/nightly/java7.cfg
  33. +3 −0 .kokoro/nightly/java8-osx.cfg
  34. +3 −0 .kokoro/nightly/java8-win.cfg
  35. +12 −0 .kokoro/nightly/java8.cfg
  36. +38 −0 .kokoro/nightly/samples.cfg
  37. +43 −0 .kokoro/populate-secrets.sh
  38. +13 −0 .kokoro/presubmit/clirr.cfg
  39. +34 −0 .kokoro/presubmit/common.cfg
  40. +12 −0 .kokoro/presubmit/dependencies.cfg
  41. +33 −0 .kokoro/presubmit/integration.cfg
  42. +7 −0 .kokoro/presubmit/java11.cfg
  43. +7 −0 .kokoro/presubmit/java7.cfg
  44. +3 −0 .kokoro/presubmit/java8-osx.cfg
  45. +3 −0 .kokoro/presubmit/java8-win.cfg
  46. +12 −0 .kokoro/presubmit/java8.cfg
  47. +12 −0 .kokoro/presubmit/linkage-monitor.cfg
  48. +13 −0 .kokoro/presubmit/lint.cfg
  49. +33 −0 .kokoro/presubmit/samples.cfg
  50. +45 −0 .kokoro/readme.sh
  51. +53 −0 .kokoro/release/bump_snapshot.cfg
  52. +49 −0 .kokoro/release/common.cfg
  53. +50 −0 .kokoro/release/common.sh
  54. +6 −0 .kokoro/release/drop.cfg
  55. +32 −0 .kokoro/release/drop.sh
  56. +6 −0 .kokoro/release/promote.cfg
  57. +34 −0 .kokoro/release/promote.sh
  58. +23 −0 .kokoro/release/publish_javadoc.cfg
  59. +53 −0 .kokoro/release/publish_javadoc.sh
  60. +30 −0 .kokoro/release/publish_javadoc11.cfg
  61. +67 −0 .kokoro/release/publish_javadoc11.sh
  62. +6 −0 .kokoro/release/snapshot.cfg
  63. +33 −0 .kokoro/release/snapshot.sh
  64. +19 −0 .kokoro/release/stage.cfg
  65. +45 −0 .kokoro/release/stage.sh
  66. +26 −0 .kokoro/trampoline.sh
  67. +16 −0 .repo-metadata.json
  68. +94 −0 CODE_OF_CONDUCT.md
  69. +139 −0 CONTRIBUTING.md
  70. +201 −0 LICENSE
  71. +7 −0 SECURITY.md
  72. +4 −0 codecov.yaml
  73. +85 −0 google-cloud-debugger-client-bom/pom.xml
  74. +111 −0 google-cloud-debugger-client/pom.xml
  75. +485 −0 google-cloud-debugger-client/src/main/java/com/google/cloud/debugger/v2/Controller2Client.java
  76. +212 −0 google-cloud-debugger-client/src/main/java/com/google/cloud/debugger/v2/Controller2Settings.java
  77. +604 −0 google-cloud-debugger-client/src/main/java/com/google/cloud/debugger/v2/Debugger2Client.java
  78. +235 −0 google-cloud-debugger-client/src/main/java/com/google/cloud/debugger/v2/Debugger2Settings.java
  79. +51 −0 google-cloud-debugger-client/src/main/java/com/google/cloud/debugger/v2/gapic_metadata.json
  80. +79 −0 google-cloud-debugger-client/src/main/java/com/google/cloud/debugger/v2/package-info.java
  81. +55 −0 google-cloud-debugger-client/src/main/java/com/google/cloud/debugger/v2/stub/Controller2Stub.java
  82. +352 −0 ...loud-debugger-client/src/main/java/com/google/cloud/debugger/v2/stub/Controller2StubSettings.java
  83. +64 −0 google-cloud-debugger-client/src/main/java/com/google/cloud/debugger/v2/stub/Debugger2Stub.java
  84. +398 −0 ...-cloud-debugger-client/src/main/java/com/google/cloud/debugger/v2/stub/Debugger2StubSettings.java
  85. +113 −0 ...bugger-client/src/main/java/com/google/cloud/debugger/v2/stub/GrpcController2CallableFactory.java
  86. +242 −0 ...le-cloud-debugger-client/src/main/java/com/google/cloud/debugger/v2/stub/GrpcController2Stub.java
  87. +113 −0 ...debugger-client/src/main/java/com/google/cloud/debugger/v2/stub/GrpcDebugger2CallableFactory.java
  88. +293 −0 google-cloud-debugger-client/src/main/java/com/google/cloud/debugger/v2/stub/GrpcDebugger2Stub.java
  89. +204 −0 google-cloud-debugger-client/src/test/java/com/google/cloud/debugger/v2/Controller2ClientTest.java
  90. +297 −0 google-cloud-debugger-client/src/test/java/com/google/cloud/debugger/v2/Debugger2ClientTest.java
  91. +59 −0 google-cloud-debugger-client/src/test/java/com/google/cloud/debugger/v2/MockController2.java
  92. +131 −0 google-cloud-debugger-client/src/test/java/com/google/cloud/debugger/v2/MockController2Impl.java
  93. +59 −0 google-cloud-debugger-client/src/test/java/com/google/cloud/debugger/v2/MockDebugger2.java
  94. +175 −0 google-cloud-debugger-client/src/test/java/com/google/cloud/debugger/v2/MockDebugger2Impl.java
  95. +69 −0 grpc-google-cloud-debugger-client-v2/pom.xml
  96. +790 −0 ...-cloud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/Controller2Grpc.java
  97. +879 −0 ...le-cloud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/Debugger2Grpc.java
  98. +15 −0 java.header
  99. +10 −0 license-checks.xml
  100. +24 −0 owlbot.py
  101. +188 −0 pom.xml
  102. +19 −0 proto-google-cloud-debugger-client-v2/clirr-ignored-differences.xml
  103. +46 −0 proto-google-cloud-debugger-client-v2/pom.xml
  104. +5,694 −0 ...oogle-cloud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/Breakpoint.java
  105. +741 −0 ...ud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/BreakpointOrBuilder.java
  106. +185 −0 ...-cloud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/ControllerProto.java
  107. +263 −0 ...google-cloud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/DataProto.java
  108. +3,371 −0 ...-google-cloud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/Debuggee.java
  109. +428 −0 ...loud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/DebuggeeOrBuilder.java
  110. +270 −0 ...le-cloud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/DebuggerProto.java
  111. +1,005 −0 ...ebugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/DeleteBreakpointRequest.java
  112. +102 −0 ...lient-v2/src/main/java/com/google/devtools/clouddebugger/v2/DeleteBreakpointRequestOrBuilder.java
  113. +958 −0 ...le-cloud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/FormatMessage.java
  114. +113 −0 ...debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/FormatMessageOrBuilder.java
  115. +1,002 −0 ...d-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/GetBreakpointRequest.java
  116. +102 −0 ...r-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/GetBreakpointRequestOrBuilder.java
  117. +747 −0 ...-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/GetBreakpointResponse.java
  118. +63 −0 ...-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/GetBreakpointResponseOrBuilder.java
  119. +952 −0 ...er-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/ListActiveBreakpointsRequest.java
  120. +98 −0 ...-v2/src/main/java/com/google/devtools/clouddebugger/v2/ListActiveBreakpointsRequestOrBuilder.java
  121. +1,277 −0 ...r-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/ListActiveBreakpointsResponse.java
  122. +124 −0 ...v2/src/main/java/com/google/devtools/clouddebugger/v2/ListActiveBreakpointsResponseOrBuilder.java
  123. +2,307 −0 ...debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/ListBreakpointsRequest.java
  124. +195 −0 ...client-v2/src/main/java/com/google/devtools/clouddebugger/v2/ListBreakpointsRequestOrBuilder.java
  125. +1,217 −0 ...ebugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/ListBreakpointsResponse.java
  126. +119 −0 ...lient-v2/src/main/java/com/google/devtools/clouddebugger/v2/ListBreakpointsResponseOrBuilder.java
  127. +917 −0 ...d-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/ListDebuggeesRequest.java
  128. +91 −0 ...r-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/ListDebuggeesRequestOrBuilder.java
  129. +1,022 −0 ...-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/ListDebuggeesResponse.java
  130. +92 −0 ...-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/ListDebuggeesResponseOrBuilder.java
  131. +786 −0 ...ebugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/RegisterDebuggeeRequest.java
  132. +72 −0 ...lient-v2/src/main/java/com/google/devtools/clouddebugger/v2/RegisterDebuggeeRequestOrBuilder.java
  133. +787 −0 ...bugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/RegisterDebuggeeResponse.java
  134. +72 −0 ...ient-v2/src/main/java/com/google/devtools/clouddebugger/v2/RegisterDebuggeeResponseOrBuilder.java
  135. +1,137 −0 ...d-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/SetBreakpointRequest.java
  136. +121 −0 ...r-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/SetBreakpointRequestOrBuilder.java
  137. +747 −0 ...-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/SetBreakpointResponse.java
  138. +63 −0 ...-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/SetBreakpointResponseOrBuilder.java
  139. +824 −0 ...e-cloud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/SourceLocation.java
  140. +78 −0 ...ebugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/SourceLocationOrBuilder.java
  141. +1,943 −0 ...oogle-cloud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/StackFrame.java
  142. +199 −0 ...ud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/StackFrameOrBuilder.java
  143. +1,237 −0 ...le-cloud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/StatusMessage.java
  144. +98 −0 ...debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/StatusMessageOrBuilder.java
  145. +974 −0 ...r-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/UpdateActiveBreakpointRequest.java
  146. +97 −0 ...v2/src/main/java/com/google/devtools/clouddebugger/v2/UpdateActiveBreakpointRequestOrBuilder.java
  147. +471 −0 ...-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/UpdateActiveBreakpointResponse.java
  148. +24 −0 ...2/src/main/java/com/google/devtools/clouddebugger/v2/UpdateActiveBreakpointResponseOrBuilder.java
  149. +2,403 −0 ...-google-cloud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/Variable.java
  150. +273 −0 ...loud-debugger-client-v2/src/main/java/com/google/devtools/clouddebugger/v2/VariableOrBuilder.java
  151. +184 −0 ...-google-cloud-debugger-client-v2/src/main/proto/google/devtools/clouddebugger/v2/controller.proto
  152. +453 −0 proto-google-cloud-debugger-client-v2/src/main/proto/google/devtools/clouddebugger/v2/data.proto
  153. +221 −0 proto-google-cloud-debugger-client-v2/src/main/proto/google/devtools/clouddebugger/v2/debugger.proto
  154. +73 −0 renovate.json
  155. +84 −0 samples/install-without-bom/pom.xml
  156. +56 −0 samples/pom.xml
  157. +83 −0 samples/snapshot/pom.xml
  158. +47 −0 samples/snippets/pom.xml
  159. +6 −0 versions.txt
@@ -0,0 +1,3 @@
docker:
digest: sha256:649fac54a80ecd8539e971b87cc36273ba68bb71bd65609f523406f7981691ac
image: gcr.io/repo-automation-bots/owlbot-java:latest
@@ -0,0 +1,32 @@
# Copyright 2021 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.

docker:
image: "gcr.io/repo-automation-bots/owlbot-java:latest"

deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"

deep-preserve-regex:
- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"

deep-copy-regex:
- source: "/google/devtools/clouddebugger/(v.*)/.*-java/proto-google-.*/src"
dest: "/owl-bot-staging/$1/proto-google-cloud-debugger-client-$1/src"
- source: "/google/devtools/clouddebugger/(v.*)/.*-java/grpc-google-.*/src"
dest: "/owl-bot-staging/$1/grpc-google-cloud-debugger-client-$1/src"
- source: "/google/devtools/clouddebugger/(v.*)/.*-java/gapic-google-.*/src"
dest: "/owl-bot-staging/$1/google-cloud-debugger-client/src"
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-debugger-client/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. debugger-client 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-debugger-client/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,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]'
@@ -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,3 @@
bumpMinorPreMajor: true
handleGHRelease: true
releaseType: java-yoshi
Empty file.
@@ -0,0 +1,49 @@

# Whether or not rebase-merging is enabled on this repository.
# Defaults to `true`
rebaseMergeAllowed: false

# Whether or not squash-merging is enabled on this repository.
# Defaults to `true`
squashMergeAllowed: true

# Whether or not PRs are merged with a merge commit on this repository.
# Defaults to `false`
mergeCommitAllowed: false

# Rules for master branch protection
branchProtectionRules:
# Identifies the protection rule pattern. Name of the branch to be protected.
# Defaults to `master`
- pattern: master
# Can admins overwrite branch protection.
# Defaults to `true`
isAdminEnforced: true
# Number of approving reviews required to update matching branches.
# Defaults to `1`
requiredApprovingReviewCount: 1
# Are reviews from code owners required to update matching branches.
# Defaults to `false`
requiresCodeOwnerReviews: true
# Require up to date branches
requiresStrictStatusChecks: false
# List of required status check contexts that must pass for commits to be accepted to matching branches.
requiredStatusCheckContexts:
- "dependencies (8)"
- "dependencies (11)"
- "linkage-monitor"
- "lint"
- "clirr"
- "units (7)"
- "units (8)"
- "units (11)"
- "Kokoro - Test: Integration"
- "cla/google"
# List of explicit permissions to add (additive only)
permissionRules:
- team: yoshi-admins
permission: admin
- team: yoshi-java-admins
permission: admin
- team: yoshi-java
permission: push
@@ -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: 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 comments on commit 4ff9303

Please sign in to comment.