Skip to content

Commit

Permalink
Update to Gradle 8.5
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Redko <[email protected]>
  • Loading branch information
reta committed Feb 5, 2024
1 parent 70222ba commit 6359444
Show file tree
Hide file tree
Showing 534 changed files with 222 additions and 751 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/gauntlet-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ jobs:
build_rca_pkg:
runs-on: [ubuntu-latest]
name: Build and Run Gauntlet tests
strategy:
matrix:
java:
- 17
- 21
steps:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 14
java-version: ${{matrix.java}}
# RCA in ./tmp/performance-analyzer-rca
- name: Checkout RCA
uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
java:
- 11
- 17
- 21
fail-fast: false
runs-on: [ubuntu-latest]
name: Building RCA package
Expand Down
54 changes: 24 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ plugins {
id 'java'
id 'application'
id 'maven-publish'
id 'com.google.protobuf' version '0.8.18'
id 'com.google.protobuf' version '0.9.4'
id 'jacoco'
id 'idea'
id 'com.github.spotbugs' version '5.0.13'
id "de.undercouch.download" version "4.0.4"
id 'com.adarshr.test-logger' version '2.1.0'
id 'org.gradle.test-retry' version '1.5.2'
id 'com.diffplug.spotless' version '5.11.0'
id 'eclipse'
id 'com.github.spotbugs' version '6.0.7'
id "de.undercouch.download" version "5.5.0"
id 'com.adarshr.test-logger' version '4.0.0'
id 'org.gradle.test-retry' version '1.5.8'
id 'com.diffplug.spotless' version '6.25.0'
}

application {
Expand Down Expand Up @@ -86,7 +87,7 @@ distributions {
spotless {
java {
licenseHeaderFile(file('license-header'))
googleJavaFormat('1.12.0').aosp()
googleJavaFormat('1.17.0').aosp()
importOrder()
removeUnusedImports()
trimTrailingWhitespace()
Expand Down Expand Up @@ -126,7 +127,8 @@ testlogger {

spotbugsMain {
excludeFilter = file("checkstyle/findbugs-exclude.xml")
effort = 'max'

effort = com.github.spotbugs.snom.Effort.MAX
ignoreFailures = true // TODO: Set this to false later as they are too many warnings to be fixed.

reports {
Expand All @@ -145,14 +147,14 @@ check {
}

jacoco {
toolVersion = "0.8.7"
toolVersion = "0.8.11"
}

jacocoTestReport {
reports {
xml.enabled true
html.enabled true
csv.enabled false
xml.required = true
html.required = true
csv.required = false
}

afterEvaluate {
Expand Down Expand Up @@ -208,7 +210,7 @@ check.dependsOn jacocoTestCoverageVerification
version = opensearch_build

distZip {
archiveName "performance-analyzer-rca-${version}.zip"
archiveFileName = "performance-analyzer-rca-${version}.zip"
}

publishing {
Expand Down Expand Up @@ -260,6 +262,9 @@ tasks.withType(Test) {
jvmArgs('--add-opens=java.base/java.nio.file=ALL-UNNAMED')
jvmArgs('--add-opens=java.base/java.lang=ALL-UNNAMED')
jvmArgs('--add-opens=java.base/java.util=ALL-UNNAMED')
if (JavaVersion.current().compareTo(JavaVersion.VERSION_17) > 0) {
jvmArgs += ["-Djava.security.manager=allow"]
}
}

task rcaTest(type: Test) {
Expand Down Expand Up @@ -367,30 +372,19 @@ dependencies {
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: "${protobufVersion}"
implementation 'io.grpc:grpc-netty:1.56.1'
implementation 'io.grpc:grpc-protobuf:1.56.1'
implementation("io.netty:netty-codec-http2:${nettyVersion}") {
force = 'true'
}
implementation("io.netty:netty-handler-proxy:${nettyVersion}") {
force = 'true'
}
implementation("io.netty:netty-codec-http2:${nettyVersion}")
implementation("io.netty:netty-handler-proxy:${nettyVersion}")
implementation 'io.grpc:grpc-stub:1.52.1'
implementation "jakarta.annotation:jakarta.annotation-api:${jakartaVersion}"

// JDK9+ has to run powermock 2+. https://github.com/powermock/powermock/issues/888
testImplementation group: 'org.powermock', name: 'powermock-api-mockito2', version: '2.0.0'
testImplementation group: 'org.powermock', name: 'powermock-module-junit4', version: '2.0.0'
implementation("org.mockito:mockito-core") {
testImplementation("org.mockito:mockito-core") {
version {
strictly "2.23.0"
strictly "5.10.0"
}
}
testImplementation group: 'org.powermock', name: 'powermock-core', version: '2.0.2'
testImplementation group: 'org.powermock', name: 'powermock-api-support', version: '2.0.2'
testImplementation group: 'org.powermock', name: 'powermock-module-junit4-common', version: '2.0.2'
testImplementation group: 'org.javassist', name: 'javassist', version: '3.28.0-GA'
testImplementation group: 'org.powermock', name: 'powermock-reflect', version: '2.0.2'
testImplementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.9.3'
testImplementation group: 'org.objenesis', name: 'objenesis', version: '3.0.1'
testImplementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.14.7'
testImplementation group: 'org.objenesis', name: 'objenesis', version: '3.2'
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
testImplementation group: 'org.hamcrest', name: 'hamcrest', version: '2.1'
testImplementation group: 'junit', name: 'junit', version: "${junitVersion}"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer;


import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer;


import java.io.File;
import java.io.FileReader;
import java.security.KeyStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer;


import com.sun.net.httpserver.HttpServer;
import org.opensearch.performanceanalyzer.net.NetClient;
import org.opensearch.performanceanalyzer.net.NetServer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer;


import java.util.Collection;
import java.util.HashSet;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer;


import io.netty.handler.codec.http.HttpMethod;
import java.io.BufferedReader;
import java.io.DataOutputStream;
Expand Down Expand Up @@ -65,7 +64,7 @@ public static void disablePA() throws InterruptedException {
public static class ClusterSettings {
static List<String> clusterSettings = new ArrayList<>();

public final static String SETTING_NOT_FOUND = "NULL";
public static final String SETTING_NOT_FOUND = "NULL";

static final String CLUSTER_SETTINGS_URL =
"/_cluster/settings?flat_settings=true&include_defaults=true&pretty";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer;


import com.google.common.annotations.VisibleForTesting;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.sun.net.httpserver.HttpServer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer;


import org.opensearch.performanceanalyzer.commons.stats.metrics.StatExceptionCode;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer;


import com.google.common.annotations.VisibleForTesting;
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
Expand All @@ -32,6 +31,7 @@ public class PerformanceAnalyzerWebServer {

@VisibleForTesting
public static final String WEBSERVICE_BIND_HOST_NAME = "webservice-bind-host";

// Use system default for max backlog.
private static final int INCOMING_QUEUE_LENGTH = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.collections;


import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import java.util.Iterator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.config.overrides;


import com.google.common.annotations.VisibleForTesting;
import java.io.IOException;
import java.util.HashSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.core;


import java.io.File;
import java.security.AccessController;
import java.security.PrivilegedAction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.decisionmaker.actions;


import java.util.List;
import java.util.Map;
import org.opensearch.performanceanalyzer.rca.store.rca.cluster.NodeKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.decisionmaker.actions;


import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.decisionmaker.actions;


import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.decisionmaker.actions;


import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ public static class Summary {

@SerializedName(value = CURRENT_MAX_SIZE)
private long currentCacheMaxSizeInBytes;

// TODO: remove coolOffPeriodInMillis and canUpdate from summary
// as those already exist in baseline action object
@SerializedName(value = COOL_OFF_PERIOD)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.decisionmaker.actions;


import com.google.common.annotations.VisibleForTesting;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
Expand Down Expand Up @@ -274,6 +273,7 @@ public static class Summary {

@SerializedName(value = CURRENT_CAPACITY)
private int currentCapacity;

// TODO: remove coolOffPeriodInMillis and canUpdate from summary
// as those already exist in baseline action object
@SerializedName(value = COOL_OFF_PERIOD)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.decisionmaker.actions;


import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.SerializedName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.decisionmaker.actions;


import org.opensearch.performanceanalyzer.AppContext;

/** Actions that can be suppressed through a config. */
Expand Down
Loading

0 comments on commit 6359444

Please sign in to comment.