Skip to content

chore: migrate to owlbot #1458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ public FakeTest(String name) {
super(name);
}

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

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

Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,8 @@
}
],
"semanticCommits": true,
"dependencyDashboard": true
"dependencyDashboard": true,
"dependencyDashboardLabels": [
"type: process"
]
}
Loading