Skip to content

Commit

Permalink
chore: migrate to owlbot (#1458)
Browse files Browse the repository at this point in the history
* chore: migrate to owlbot

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Neenu1995 <neenushaji@google.com>
  • Loading branch information
3 people committed Oct 7, 2021
1 parent 08180a7 commit f8e62ec
Show file tree
Hide file tree
Showing 15 changed files with 102 additions and 109 deletions.
3 changes: 3 additions & 0 deletions .github/.OwlBot.lock.yaml
@@ -0,0 +1,3 @@
docker:
digest: sha256:db1616f2f70823d8381d859835229e04371d14f59ac78063c5af73c55c3fffbb
image: gcr.io/repo-automation-bots/owlbot-java:latest
14 changes: 3 additions & 11 deletions synth.py → .github/.OwlBot.yaml
@@ -1,4 +1,4 @@
# Copyright 2019 Google LLC
# 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.
Expand All @@ -11,14 +11,6 @@
# 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 parts of this library."""

import synthtool.languages.java as java

java.common_templates(excludes=[
"README.md",
"java.header",
"checkstyle.xml",
"license-checks.xml",
".github/workflows/samples.yaml",
])
docker:
image: "gcr.io/repo-automation-bots/owlbot-java:latest"
2 changes: 1 addition & 1 deletion .github/blunderbuss.yml
@@ -1,5 +1,5 @@
# Configuration for the Blunderbuss GitHub app. For more info see
# https://github.com/googleapis/repo-automation-bots/tree/main/packages/blunderbuss
# https://github.com/googleapis/repo-automation-bots/tree/master/packages/blunderbuss
assign_prs_by:
- labels:
- samples
Expand Down
21 changes: 8 additions & 13 deletions .github/workflows/ci.yaml
@@ -1,23 +1,22 @@
on:
push:
branches:
- main
- master
pull_request:
name: ci
jobs:
units:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11, 17]
java: [8, 11]
steps:
- uses: actions/checkout@v2
- uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.1
- uses: actions/setup-java@v2
- uses: actions/setup-java@v1
with:
distribution: zulu
java-version: ${{matrix.java}}
- run: java -version
- run: .kokoro/build.sh
Expand All @@ -30,9 +29,8 @@ jobs:
- uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.1
- uses: actions/setup-java@v2
- uses: actions/setup-java@v1
with:
distribution: zulu
java-version: 8
- run: java -version
- run: .kokoro/build.bat
Expand All @@ -42,15 +40,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11, 17]
java: [8, 11]
steps:
- uses: actions/checkout@v2
- uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.1
- uses: actions/setup-java@v2
- uses: actions/setup-java@v1
with:
distribution: zulu
java-version: ${{matrix.java}}
- run: java -version
- run: .kokoro/dependencies.sh
Expand All @@ -61,9 +58,8 @@ jobs:
- uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.1
- uses: actions/setup-java@v2
- uses: actions/setup-java@v1
with:
distribution: zulu
java-version: 8
- run: java -version
- run: .kokoro/build.sh
Expand All @@ -76,9 +72,8 @@ jobs:
- uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.1
- uses: actions/setup-java@v2
- uses: actions/setup-java@v1
with:
distribution: zulu
java-version: 8
- run: java -version
- run: .kokoro/build.sh
Expand Down
23 changes: 1 addition & 22 deletions .kokoro/dependencies.sh
Expand Up @@ -28,28 +28,7 @@ source ${scriptDir}/common.sh
java -version
echo $JOB_TYPE

function determineMavenOpts() {
local javaVersion=$(
# filter down to the version line, then pull out the version between quotes,
# then trim the version number down to its minimal number (removing any
# update or suffix number).
java -version 2>&1 | grep "version" \
| sed -E 's/^.*"(.*?)".*$/\1/g' \
| sed -E 's/^(1\.[0-9]\.0).*$/\1/g'
)

case $javaVersion in
"17")
# MaxPermSize is no longer supported as of jdk 17
echo -n "-Xmx1024m"
;;
*)
echo -n "-Xmx1024m -XX:MaxPermSize=128m"
;;
esac
}

export MAVEN_OPTS=$(determineMavenOpts)
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m"

# this should run maven enforcer
retry_with_backoff 3 10 \
Expand Down
Expand Up @@ -15,7 +15,6 @@

import com.google.api.client.json.JsonFactory;
import com.google.api.client.test.json.AbstractJsonFactoryTest;

import java.util.ArrayList;

/**
Expand All @@ -24,16 +23,31 @@
* @author Yaniv Inbar
*/
public class AndroidJsonFactoryTest extends AbstractJsonFactoryTest {

private static final String GSON_LINE_SEPARATOR = "\n";

private static final String JSON_ENTRY_PRETTY =
"{" + GSON_LINE_SEPARATOR + " \"title\": \"foo\"" + GSON_LINE_SEPARATOR + "}";
private static final String JSON_FEED_PRETTY = "{" + GSON_LINE_SEPARATOR + " \"entries\": ["
+ GSON_LINE_SEPARATOR + " {" + GSON_LINE_SEPARATOR + " \"title\": \"foo\""
+ GSON_LINE_SEPARATOR + " }," + GSON_LINE_SEPARATOR + " {"
+ GSON_LINE_SEPARATOR + " \"title\": \"bar\"" + GSON_LINE_SEPARATOR + " }"
+ GSON_LINE_SEPARATOR + " ]" + GSON_LINE_SEPARATOR + "}";
private static final String JSON_FEED_PRETTY =
"{"
+ GSON_LINE_SEPARATOR
+ " \"entries\": ["
+ GSON_LINE_SEPARATOR
+ " {"
+ GSON_LINE_SEPARATOR
+ " \"title\": \"foo\""
+ GSON_LINE_SEPARATOR
+ " },"
+ GSON_LINE_SEPARATOR
+ " {"
+ GSON_LINE_SEPARATOR
+ " \"title\": \"bar\""
+ GSON_LINE_SEPARATOR
+ " }"
+ GSON_LINE_SEPARATOR
+ " ]"
+ GSON_LINE_SEPARATOR
+ "}";

public AndroidJsonFactoryTest(String name) {
super(name);
Expand Down Expand Up @@ -61,5 +75,4 @@ public final void testToPrettyString_Feed() throws Exception {
feed.entries.add(entryBar);
assertEquals(JSON_FEED_PRETTY, newFactory().toPrettyString(feed));
}

}
Expand Up @@ -26,6 +26,5 @@ public FakeTest(String name) {
super(name);
}

public final void test() throws Exception {
}
public final void test() throws Exception {}
}
Expand Up @@ -17,6 +17,4 @@
*
* @author Yaniv Inbar
*/

package com.google.api.client.extensions.android.json;

Expand Up @@ -20,8 +20,7 @@
@Beta
public class BetaClass {

public void method() {
}
public void method() {}

@Beta
public void betaMethod() {
Expand All @@ -36,8 +35,7 @@ public BetaClass() {

int field;

@Beta
int betaField;
@Beta int betaField;

@Override
public String toString() {
Expand Down
Expand Up @@ -19,12 +19,10 @@
/** A class which contains {@link Beta} fields. */
public class ClassWithBetaField {

@Beta
public int betaField;
@Beta public int betaField;
public int field;

@Beta
public static final int betaStaticField = 10;
@Beta public static final int betaStaticField = 10;
public static final int staticField = 20;

public ClassWithBetaField() {
Expand Down
Expand Up @@ -19,8 +19,7 @@
/** A class which contains {@link Beta} methods. */
public class ClassWithBetaMethod {

@Beta
int betaField = 10;
@Beta int betaField = 10;

@Beta
public void betaMethod() {
Expand Down
32 changes: 32 additions & 0 deletions owlbot.py
@@ -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
#
# https://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.

import synthtool as s
from synthtool.languages import java


for library in s.get_staging_dirs():
# put any special-case replacements here
s.move(library)

s.remove_staging_dirs()
java.common_templates(
excludes=[
"README.md",
"java.header",
"checkstyle.xml",
"license-checks.xml",
".github/workflows/samples.yaml",
]
)
5 changes: 4 additions & 1 deletion renovate.json
Expand Up @@ -70,5 +70,8 @@
}
],
"semanticCommits": true,
"dependencyDashboard": true
"dependencyDashboard": true,
"dependencyDashboardLabels": [
"type: process"
]
}

0 comments on commit f8e62ec

Please sign in to comment.