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

Commit

Permalink
chore: regenerate common templates (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation committed Sep 21, 2020
1 parent a354468 commit 990a413
Show file tree
Hide file tree
Showing 15 changed files with 246 additions and 49 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -4,5 +4,7 @@
# 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
69 changes: 69 additions & 0 deletions .github/workflows/auto-release.yaml
@@ -0,0 +1,69 @@
on:
pull_request:
name: auto-release
jobs:
approve:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3.0.0
with:
github-token: ${{secrets.GITHUB_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;
}
// 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']
});
31 changes: 3 additions & 28 deletions .kokoro/release/stage.cfg
Expand Up @@ -13,32 +13,7 @@ action {
}
}

# Fetch the token needed for reporting release status to GitHub
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "yoshi-automation-github-key"
}
}
}

# Fetch magictoken to use with Magic Github Proxy
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "releasetool-magictoken"
}
}
}

# Fetch api key to use with Magic Github Proxy
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "magic-github-proxy-api-key"
}
}
env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem"
}
Expand Up @@ -256,6 +256,10 @@ public Action findValueByNumber(int number) {
};

public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}

Expand Down Expand Up @@ -302,6 +306,7 @@ private Action(int value) {
*
* @return The enum numeric value on the wire for action.
*/
@java.lang.Override
public int getActionValue() {
return action_;
}
Expand All @@ -317,6 +322,7 @@ public int getActionValue() {
*
* @return The action.
*/
@java.lang.Override
public com.google.iam.v1.AuditConfigDelta.Action getAction() {
@SuppressWarnings("deprecation")
com.google.iam.v1.AuditConfigDelta.Action result =
Expand All @@ -340,6 +346,7 @@ public com.google.iam.v1.AuditConfigDelta.Action getAction() {
*
* @return The service.
*/
@java.lang.Override
public java.lang.String getService() {
java.lang.Object ref = service_;
if (ref instanceof java.lang.String) {
Expand All @@ -365,6 +372,7 @@ public java.lang.String getService() {
*
* @return The bytes for service.
*/
@java.lang.Override
public com.google.protobuf.ByteString getServiceBytes() {
java.lang.Object ref = service_;
if (ref instanceof java.lang.String) {
Expand Down Expand Up @@ -392,6 +400,7 @@ public com.google.protobuf.ByteString getServiceBytes() {
*
* @return The exemptedMember.
*/
@java.lang.Override
public java.lang.String getExemptedMember() {
java.lang.Object ref = exemptedMember_;
if (ref instanceof java.lang.String) {
Expand All @@ -416,6 +425,7 @@ public java.lang.String getExemptedMember() {
*
* @return The bytes for exemptedMember.
*/
@java.lang.Override
public com.google.protobuf.ByteString getExemptedMemberBytes() {
java.lang.Object ref = exemptedMember_;
if (ref instanceof java.lang.String) {
Expand Down Expand Up @@ -443,6 +453,7 @@ public com.google.protobuf.ByteString getExemptedMemberBytes() {
*
* @return The logType.
*/
@java.lang.Override
public java.lang.String getLogType() {
java.lang.Object ref = logType_;
if (ref instanceof java.lang.String) {
Expand All @@ -467,6 +478,7 @@ public java.lang.String getLogType() {
*
* @return The bytes for logType.
*/
@java.lang.Override
public com.google.protobuf.ByteString getLogTypeBytes() {
java.lang.Object ref = logType_;
if (ref instanceof java.lang.String) {
Expand Down Expand Up @@ -853,6 +865,7 @@ public Builder mergeFrom(
*
* @return The enum numeric value on the wire for action.
*/
@java.lang.Override
public int getActionValue() {
return action_;
}
Expand All @@ -870,6 +883,7 @@ public int getActionValue() {
* @return This builder for chaining.
*/
public Builder setActionValue(int value) {

action_ = value;
onChanged();
return this;
Expand All @@ -886,6 +900,7 @@ public Builder setActionValue(int value) {
*
* @return The action.
*/
@java.lang.Override
public com.google.iam.v1.AuditConfigDelta.Action getAction() {
@SuppressWarnings("deprecation")
com.google.iam.v1.AuditConfigDelta.Action result =
Expand Down
Expand Up @@ -151,6 +151,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
*
* @return The role.
*/
@java.lang.Override
public java.lang.String getRole() {
java.lang.Object ref = role_;
if (ref instanceof java.lang.String) {
Expand All @@ -174,6 +175,7 @@ public java.lang.String getRole() {
*
* @return The bytes for role.
*/
@java.lang.Override
public com.google.protobuf.ByteString getRoleBytes() {
java.lang.Object ref = role_;
if (ref instanceof java.lang.String) {
Expand Down Expand Up @@ -315,6 +317,7 @@ public com.google.protobuf.ByteString getMembersBytes(int index) {
*
* @return Whether the condition field is set.
*/
@java.lang.Override
public boolean hasCondition() {
return condition_ != null;
}
Expand All @@ -332,6 +335,7 @@ public boolean hasCondition() {
*
* @return The condition.
*/
@java.lang.Override
public com.google.type.Expr getCondition() {
return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_;
}
Expand All @@ -347,6 +351,7 @@ public com.google.type.Expr getCondition() {
*
* <code>.google.type.Expr condition = 3;</code>
*/
@java.lang.Override
public com.google.type.ExprOrBuilder getConditionOrBuilder() {
return getCondition();
}
Expand Down
Expand Up @@ -261,6 +261,10 @@ public Action findValueByNumber(int number) {
};

public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}

Expand Down Expand Up @@ -307,6 +311,7 @@ private Action(int value) {
*
* @return The enum numeric value on the wire for action.
*/
@java.lang.Override
public int getActionValue() {
return action_;
}
Expand All @@ -322,6 +327,7 @@ public int getActionValue() {
*
* @return The action.
*/
@java.lang.Override
public com.google.iam.v1.BindingDelta.Action getAction() {
@SuppressWarnings("deprecation")
com.google.iam.v1.BindingDelta.Action result =
Expand All @@ -344,6 +350,7 @@ public com.google.iam.v1.BindingDelta.Action getAction() {
*
* @return The role.
*/
@java.lang.Override
public java.lang.String getRole() {
java.lang.Object ref = role_;
if (ref instanceof java.lang.String) {
Expand All @@ -368,6 +375,7 @@ public java.lang.String getRole() {
*
* @return The bytes for role.
*/
@java.lang.Override
public com.google.protobuf.ByteString getRoleBytes() {
java.lang.Object ref = role_;
if (ref instanceof java.lang.String) {
Expand Down Expand Up @@ -395,6 +403,7 @@ public com.google.protobuf.ByteString getRoleBytes() {
*
* @return The member.
*/
@java.lang.Override
public java.lang.String getMember() {
java.lang.Object ref = member_;
if (ref instanceof java.lang.String) {
Expand All @@ -419,6 +428,7 @@ public java.lang.String getMember() {
*
* @return The bytes for member.
*/
@java.lang.Override
public com.google.protobuf.ByteString getMemberBytes() {
java.lang.Object ref = member_;
if (ref instanceof java.lang.String) {
Expand All @@ -444,6 +454,7 @@ public com.google.protobuf.ByteString getMemberBytes() {
*
* @return Whether the condition field is set.
*/
@java.lang.Override
public boolean hasCondition() {
return condition_ != null;
}
Expand All @@ -458,6 +469,7 @@ public boolean hasCondition() {
*
* @return The condition.
*/
@java.lang.Override
public com.google.type.Expr getCondition() {
return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_;
}
Expand All @@ -470,6 +482,7 @@ public com.google.type.Expr getCondition() {
*
* <code>.google.type.Expr condition = 4;</code>
*/
@java.lang.Override
public com.google.type.ExprOrBuilder getConditionOrBuilder() {
return getCondition();
}
Expand Down Expand Up @@ -857,6 +870,7 @@ public Builder mergeFrom(
*
* @return The enum numeric value on the wire for action.
*/
@java.lang.Override
public int getActionValue() {
return action_;
}
Expand All @@ -874,6 +888,7 @@ public int getActionValue() {
* @return This builder for chaining.
*/
public Builder setActionValue(int value) {

action_ = value;
onChanged();
return this;
Expand All @@ -890,6 +905,7 @@ public Builder setActionValue(int value) {
*
* @return The action.
*/
@java.lang.Override
public com.google.iam.v1.BindingDelta.Action getAction() {
@SuppressWarnings("deprecation")
com.google.iam.v1.BindingDelta.Action result =
Expand Down

0 comments on commit 990a413

Please sign in to comment.