Skip to content

Commit

Permalink
Update gradle 7.6.1 -> 8.10.2 (#2294)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinn-With-Two-Ns authored Oct 25, 2024
1 parent 805833c commit 6efbde3
Show file tree
Hide file tree
Showing 27 changed files with 76 additions and 37 deletions.
11 changes: 5 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
buildscript {
ext {
palantirGitVersionVersion = "${JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11) ? '0.15.0' : '0.13.0'}"
kotlinVersion = "${project.hasProperty("edgeDepsTest") ? '1.8.20' : (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16) ? '1.5.32' : '1.4.32')}"
}
}

plugins {
id 'net.ltgt.errorprone' version '3.0.1' apply false
id 'net.ltgt.errorprone' version '4.0.1' apply false
id 'org.cadixdev.licenser' version '0.6.1'
id 'com.palantir.git-version' version "${palantirGitVersionVersion}" apply false
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
id 'com.diffplug.spotless' version '6.18.0' apply false
id 'com.github.nbaztec.coveralls-jacoco' version "1.2.15" apply false
id 'com.diffplug.spotless' version '6.25.0' apply false
id 'com.github.nbaztec.coveralls-jacoco' version "1.2.20" apply false

// id 'org.jetbrains.kotlin.jvm' version '1.4.32'
// id 'org.jetbrains.kotlin.jvm' version '1.5.32'
// id 'org.jetbrains.kotlin.jvm' version '1.6.21'
// id 'org.jetbrains.kotlin.jvm' version '1.7.22'
// id 'org.jetbrains.kotlin.jvm' version '1.8.20'
id 'org.jetbrains.kotlin.jvm' version "${kotlinVersion}" apply false
id 'org.jetbrains.kotlin.jvm' version '1.8.20' apply false
id 'base'
}

Expand Down Expand Up @@ -62,7 +61,7 @@ ext {
// test scoped
// we don't upgrade to 1.3 and 1.4 because they require slf4j 2.x
logbackVersion = project.hasProperty("edgeDepsTest") ? '1.3.5' : '1.2.11'
mockitoVersion = '5.2.0'
mockitoVersion = '5.14.2'
junitVersion = '4.13.2'
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/errorprone.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ subprojects {
dependencies {
errorproneJavac('com.google.errorprone:javac:9+181-r4173-1')
if (JavaVersion.current().isJava11Compatible()) {
errorprone('com.google.errorprone:error_prone_core:2.18.0')
errorprone('com.google.errorprone:error_prone_core:2.31.0')
} else {
errorprone('com.google.errorprone:error_prone_core:2.10.0')
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/linting.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ subprojects {
target 'src/*/java/**/*.java'
targetExclude '**/generated/*'
targetExclude '**/.idea/**'
googleJavaFormat('1.16.0')
googleJavaFormat('1.24.0')
}

kotlin {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
34 changes: 21 additions & 13 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -83,10 +85,9 @@ 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 -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +134,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 +201,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
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
1 change: 1 addition & 0 deletions temporal-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ tasks.withType(KotlinCompile).all {
kotlinOptions {
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
jvmTarget = project.hasProperty("edgeDepsTest") ? JavaVersion.VERSION_17 : JavaVersion.VERSION_1_8
languageVersion = "${project.hasProperty("edgeDepsTest") ? '1.8' : (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16) ? '1.5' : '1.4')}"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class StandardTagNames {
public static final String RUN_ID = "runId";
public static final String PARENT_WORKFLOW_ID = "parentWorkflowId";
public static final String PARENT_RUN_ID = "parentRunId";

/**
* @deprecated use {@link io.opentracing.tag.Tags#ERROR}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public interface WorkflowClient {

/** Use this constant as a query type to get a workflow stack trace. */
String QUERY_TYPE_STACK_TRACE = "__stack_trace";

/** Replays workflow to the current state and returns empty result or error if replay failed. */
String QUERY_TYPE_REPLAY_ONLY = "__replay_only";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
public class WorkflowExecutionHistory {
protected static final String DEFAULT_WORKFLOW_ID = "workflow_id_in_replay";
private static final Gson GSON_PRETTY_PRINTER = new GsonBuilder().setPrettyPrinting().create();

// we stay on using the old API that uses a JsonParser instance instead of static methods
// to give users a larger range of supported version
@SuppressWarnings("deprecation")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public interface LocalActivityCallback
class LocalActivityFailedException extends RuntimeException {
private final @Nonnull Failure failure;
private final int lastAttempt;

/**
* If this is not null, code that processes this exception will schedule a workflow timer to
* continue retrying the execution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ final class LocalActivityStateMachine

private ExecuteLocalActivityParameters localActivityParameters;
private final Functions.Func<Boolean> replaying;

/** Accepts proposed current time. Returns accepted current time. */
private final Functions.Func1<Long, Long> setCurrentTimeCallback;

Expand All @@ -74,6 +75,7 @@ final class LocalActivityStateMachine

/** Workflow timestamp when the LA state machine is initialized */
private final long workflowTimeMillisWhenStarted;

/**
* System.nanoTime result at the moment of LA state machine initialization. May be used to
* calculate elapsed time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ final class VersionStateMachine {
private final Functions.Proc1<StateMachine> stateMachineSink;

@Nullable private Integer version;

/**
* This variable is used for replay only. When we replay, we look one workflow task ahead and
* preload all version markers to be able to return from Workflow.getVersion called in the event
Expand Down Expand Up @@ -368,6 +369,7 @@ private VersionStateMachine(
this.commandSink = Objects.requireNonNull(commandSink);
this.stateMachineSink = stateMachineSink;
}

/**
* Get the version for this state machine.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ private static void popCurrent(CancellationScopeImpl expected) {
private final Runnable runnable;
private CancellationScopeImpl parent;
private final Set<CancellationScopeImpl> children = new HashSet<>();

/**
* When disconnected scope has no parent and thus doesn't receive cancellation requests from it.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ public final class POJOWorkflowImplementationFactory implements ReplayWorkflowFa
/** Key: workflow type name, Value: function that creates SyncWorkflowDefinition instance. */
private final Map<String, Functions.Func1<WorkflowExecution, SyncWorkflowDefinition>>
workflowDefinitions = Collections.synchronizedMap(new HashMap<>());

/** Factories providing instances of workflow classes. */
private final Map<Class<?>, Functions.Func<?>> workflowInstanceFactories =
Collections.synchronizedMap(new HashMap<>());

/** If present then it is called for any unknown workflow type. */
private Functions.Func1<EncodedValues, ? extends DynamicWorkflow>
dynamicWorkflowImplementationFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public final class LocalActivityResult {
private final @Nullable RespondActivityTaskCompletedRequest executionCompleted;
private final @Nullable ExecutionFailedResult executionFailed;
private final @Nullable RespondActivityTaskCanceledRequest executionCanceled;

/**
* If present, it will cause an immediate WFT failure instead of providing LA result to the
* workflow code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
public class WorkflowSerializationContext implements HasWorkflowSerializationContext {
private final @Nonnull String namespace;
private final @Nonnull String workflowId;

// We can't currently reliably and consistency provide workflowType to the DataConverter.
// 1. Signals and queries don't know workflowType when they are sent.
// 2. WorkflowStub#getResult call is not aware of the workflowType, workflowType is an optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ private MetricsType() {}
TEMPORAL_METRICS_PREFIX + "workflow_task_schedule_to_start_latency";
public static final String WORKFLOW_TASK_EXECUTION_LATENCY =
TEMPORAL_METRICS_PREFIX + "workflow_task_execution_latency";

/** Total latency of a workflow task which can include multiple forced decision tasks */
public static final String WORKFLOW_TASK_EXECUTION_TOTAL_LATENCY =
TEMPORAL_METRICS_PREFIX + "workflow_task_execution_total_latency";
Expand All @@ -66,6 +67,7 @@ private MetricsType() {}
/** Workflow task failed, possibly failing workflow or reporting failure to the service. */
public static final String WORKFLOW_TASK_EXECUTION_FAILURE_COUNTER =
TEMPORAL_METRICS_PREFIX + "workflow_task_execution_failed";

/**
* Workflow task failed with unhandled exception without replying to the service.<br>
* This typically happens when workflow task fails second time in a row.<br>
Expand Down Expand Up @@ -95,6 +97,7 @@ private MetricsType() {}
TEMPORAL_METRICS_PREFIX + "activity_execution_failed";
public static final String ACTIVITY_EXEC_CANCELLED_COUNTER =
TEMPORAL_METRICS_PREFIX + "activity_execution_cancelled";

/**
* @deprecated use {@link #ACTIVITY_EXEC_CANCELLED_COUNTER}
*/
Expand All @@ -115,6 +118,7 @@ private MetricsType() {}

public static final String LOCAL_ACTIVITY_EXEC_CANCELLED_COUNTER =
TEMPORAL_METRICS_PREFIX + "local_activity_execution_cancelled";

/**
* @deprecated use {@link #LOCAL_ACTIVITY_EXEC_CANCELLED_COUNTER}
*/
Expand All @@ -124,6 +128,7 @@ private MetricsType() {}

public static final String LOCAL_ACTIVITY_EXEC_FAILED_COUNTER =
TEMPORAL_METRICS_PREFIX + "local_activity_execution_failed";

/**
* @deprecated use {@link #LOCAL_ACTIVITY_EXEC_FAILED_COUNTER}
*/
Expand Down Expand Up @@ -173,6 +178,7 @@ private MetricsType() {}
public static final String STICKY_CACHE_HIT = TEMPORAL_METRICS_PREFIX + "sticky_cache_hit";
// tagged with namespace, task_queue, worker_type, workflow_type
public static final String STICKY_CACHE_MISS = TEMPORAL_METRICS_PREFIX + "sticky_cache_miss";

// tagged with namespace, task_queue, worker_type, workflow_type
@Deprecated
// This metric in its current form is useless, it's not possible for users to interpret it for any
Expand All @@ -190,6 +196,7 @@ private MetricsType() {}
// Otherwise deprecate it everywhere and remove from docs.
public static final String STICKY_CACHE_TOTAL_FORCED_EVICTION =
TEMPORAL_METRICS_PREFIX + "sticky_cache_total_forced_eviction";

// tagged with namespace, task_queue, worker_type, workflow_type
public static final String STICKY_CACHE_THREAD_FORCED_EVICTION =
TEMPORAL_METRICS_PREFIX + "sticky_cache_thread_forced_eviction";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ class GrpcRetryerUtils {
Status.Code code = currentException.getStatus().getCode();

switch (code) {
// CANCELLED and DEADLINE_EXCEEDED usually considered non-retryable in GRPC world, for
// example:
// https://github.com/grpc-ecosystem/go-grpc-middleware/blob/master/retry/retry.go#L287
// CANCELLED and DEADLINE_EXCEEDED usually considered non-retryable in GRPC world, for
// example:
// https://github.com/grpc-ecosystem/go-grpc-middleware/blob/master/retry/retry.go#L287
case CANCELLED:
return new CancellationException("The gRPC request was cancelled");
case INVALID_ARGUMENT:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public class ServiceStubsOptions {
* Interval at which server will be pinged in order to determine if connections are still alive.
*/
protected final Duration keepAliveTime;

/**
* Amount of time that client would wait for the keep alive ping response from the server before
* closing the connection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ public final class WorkflowServiceStubsOptions extends ServiceStubsOptions {
* empty result after this server timeout.
*/
public static final Duration DEFAULT_SERVER_LONG_POLL_RPC_TIMEOUT = Duration.ofSeconds(60);

/** Default RPC timeout used for all long poll calls. */
public static final Duration DEFAULT_POLL_RPC_TIMEOUT =
DEFAULT_SERVER_LONG_POLL_RPC_TIMEOUT.plus(Duration.ofSeconds(10));

/** Default RPC timeout for workflow queries */
public static final Duration DEFAULT_QUERY_RPC_TIMEOUT = Duration.ofSeconds(10);

Expand Down
Loading

0 comments on commit 6efbde3

Please sign in to comment.