Skip to content

Commit 72c1fc8

Browse files
committed
Merge branch 'main' into vabachu/rewind
2 parents 7cec5d1 + ebebbc9 commit 72c1fc8

File tree

11 files changed

+155
-55
lines changed

11 files changed

+155
-55
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
* Adding rewind client API ([#253](https://github.com/microsoft/durabletask-java/pull/253))
44

5+
## v1.7.0
6+
* Add descriptive error when orchestration type is not registered ([#261](https://github.com/microsoft/durabletask-java/pull/261))
7+
* Update all dependencies to latest versions ([#260](https://github.com/microsoft/durabletask-java/pull/260))
8+
59
## v1.6.3
610
* Add DurableTaskGrpcClientFactory ([#256](https://github.com/microsoft/durabletask-java/pull/256))
711
* Add support for running GitHub workflows manually and update flaky tests ([#258](https://github.com/microsoft/durabletask-java/pull/258))

azurefunctions/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ plugins {
22
id 'java-library'
33
id 'maven-publish'
44
id 'signing'
5-
id 'com.github.spotbugs' version '5.2.1'
5+
id 'com.github.spotbugs' version '6.4.8'
66
}
77

88
group 'com.microsoft'
9-
version = '1.6.3'
9+
version = '1.7.0'
1010
archivesBaseName = 'durabletask-azure-functions'
1111

12-
def protocVersion = '3.12.0'
12+
def protocVersion = '3.25.8'
1313

1414
repositories {
1515
maven {
@@ -19,9 +19,9 @@ repositories {
1919

2020
dependencies {
2121
api project(':client')
22-
implementation group: 'com.microsoft.azure.functions', name: 'azure-functions-java-library', version: '3.0.0'
22+
implementation group: 'com.microsoft.azure.functions', name: 'azure-functions-java-library', version: '3.2.3'
2323
implementation "com.google.protobuf:protobuf-java:${protocVersion}"
24-
compileOnly "com.microsoft.azure.functions:azure-functions-java-spi:1.0.0"
24+
compileOnly "com.microsoft.azure.functions:azure-functions-java-spi:1.1.0"
2525
}
2626

2727
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -88,9 +88,9 @@ java {
8888
}
8989

9090
spotbugs {
91-
toolVersion = '4.9.2'
92-
effort = 'max'
93-
reportLevel = 'high'
91+
toolVersion = '4.9.8'
92+
effort = com.github.spotbugs.snom.Effort.valueOf('MAX')
93+
reportLevel = com.github.spotbugs.snom.Confidence.valueOf('HIGH')
9494
ignoreFailures = true
9595
excludeFilter = file('spotbugs-exclude.xml')
9696
}

azuremanaged/build.gradle

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88

99
plugins {
1010
id 'java'
11-
id 'com.google.protobuf' version '0.8.16'
11+
id 'com.google.protobuf' version '0.9.6'
1212
id 'idea'
1313
id 'maven-publish'
1414
id 'signing'
15-
id 'com.github.spotbugs' version '5.2.1'
15+
id 'com.github.spotbugs' version '6.4.8'
1616
}
1717

1818
archivesBaseName = 'durabletask-azuremanaged'
1919
group 'com.microsoft'
20-
version = '1.6.3'
20+
version = '1.7.0'
2121

22-
def grpcVersion = '1.59.0'
23-
def azureCoreVersion = '1.45.0'
24-
def azureIdentityVersion = '1.11.1'
22+
def grpcVersion = '1.78.0'
23+
def azureCoreVersion = '1.57.1'
24+
def azureIdentityVersion = '1.18.1'
2525
// When build on local, you need to set this value to your local jdk11 directory.
2626
// Java11 is used to compile and run all the tests.
2727
def PATH_TO_TEST_JAVA_RUNTIME = System.env.JDK_11 ?: System.getProperty("java.home")
@@ -40,12 +40,13 @@ dependencies {
4040
implementation "com.azure:azure-identity:${azureIdentityVersion}"
4141

4242
// Test dependencies
43-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
44-
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.0'
45-
testImplementation 'org.mockito:mockito-core:5.3.1'
46-
testImplementation 'org.mockito:mockito-junit-jupiter:5.3.1'
43+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.14.2'
44+
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.14.2'
45+
testImplementation 'org.mockito:mockito-core:5.21.0'
46+
testImplementation 'org.mockito:mockito-junit-jupiter:5.21.0'
4747
testImplementation "io.grpc:grpc-netty:${grpcVersion}"
48-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
48+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.14.2'
49+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.14.2'
4950
}
5051

5152
compileJava {
@@ -123,9 +124,9 @@ java {
123124
}
124125

125126
spotbugs {
126-
toolVersion = '4.9.2'
127-
effort = 'max'
128-
reportLevel = 'high'
127+
toolVersion = '4.9.8'
128+
effort = com.github.spotbugs.snom.Effort.valueOf('MAX')
129+
reportLevel = com.github.spotbugs.snom.Confidence.valueOf('HIGH')
129130
ignoreFailures = true
130131
excludeFilter = file('spotbugs-exclude.xml')
131132
}

client/build.gradle

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
plugins {
22
id 'java-library'
3-
id 'com.google.protobuf' version '0.8.16'
3+
id 'com.google.protobuf' version '0.9.6'
44
// Generate IntelliJ IDEA's .idea & .iml project files
55
id 'idea'
66
id 'maven-publish'
77
id 'signing'
8-
id 'com.github.spotbugs' version '5.2.1'
9-
id 'org.gradle.test-retry' version '1.4.1'
8+
id 'com.github.spotbugs' version '6.4.8'
9+
id 'org.gradle.test-retry' version '1.6.4'
1010
}
1111

1212
group 'com.microsoft'
13-
version = '1.6.3'
13+
version = '1.7.0'
1414
archivesBaseName = 'durabletask-client'
1515

16-
def grpcVersion = '1.59.0'
17-
def protocVersion = '3.12.0'
18-
def jacksonVersion = '2.15.3'
19-
def openTelemetryVersion = '1.25.0'
20-
def azureCoreVersion = '1.45.0'
21-
def azureIdentityVersion = '1.11.1'
16+
def grpcVersion = '1.78.0'
17+
def protocVersion = '3.25.8'
18+
def jacksonVersion = '2.18.3'
19+
def openTelemetryVersion = '1.58.0'
20+
def azureCoreVersion = '1.57.1'
21+
def azureIdentityVersion = '1.18.1'
2222
// When build on local, you need to set this value to your local jdk11 directory.
2323
// Java11 is used to compile and run all the tests.
2424
// Example for Windows: C:/Program Files/Java/openjdk-11.0.12_7/
@@ -41,8 +41,9 @@ dependencies {
4141
implementation "io.opentelemetry:opentelemetry-api:${openTelemetryVersion}"
4242
implementation "io.opentelemetry:opentelemetry-context:${openTelemetryVersion}"
4343

44-
testImplementation(platform('org.junit:junit-bom:5.7.2'))
44+
testImplementation(platform('org.junit:junit-bom:5.14.2'))
4545
testImplementation('org.junit.jupiter:junit-jupiter')
46+
testRuntimeOnly('org.junit.platform:junit-platform-launcher')
4647
testImplementation project(':azuremanaged')
4748
testImplementation "com.azure:azure-core:${azureCoreVersion}"
4849
testImplementation "com.azure:azure-identity:${azureIdentityVersion}"
@@ -204,9 +205,9 @@ java {
204205
}
205206

206207
spotbugs {
207-
toolVersion = '4.9.2'
208-
effort = 'max'
209-
reportLevel = 'high'
208+
toolVersion = '4.9.8'
209+
effort = com.github.spotbugs.snom.Effort.valueOf('MAX')
210+
reportLevel = com.github.spotbugs.snom.Confidence.valueOf('HIGH')
210211
ignoreFailures = true
211212
excludeFilter = file('spotbugs-exclude.xml')
212213
}

client/src/main/java/com/microsoft/durabletask/TaskOrchestrationExecutor.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,12 @@ private void processEvent(HistoryEvent e) {
882882
// Try getting the default orchestrator
883883
factory = TaskOrchestrationExecutor.this.orchestrationFactories.get("*");
884884
}
885-
// TODO: Throw if the factory is null (orchestration by that name doesn't exist)
885+
if (factory == null) {
886+
throw new IllegalStateException(String.format(
887+
"No orchestration factory registered for orchestration type '%s'. This usually means that a worker that doesn't support this orchestration type is connected to this task hub. Make sure the worker has a registered orchestration for '%s'.",
888+
name,
889+
name));
890+
}
886891
TaskOrchestration orchestrator = factory.create();
887892
orchestrator.run(this);
888893
break;

client/src/test/java/com/microsoft/durabletask/IntegrationTestBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class IntegrationTestBase {
2222
private ManagedChannel clientChannel;
2323

2424
@AfterEach
25-
private void shutdown() {
25+
void shutdown() {
2626
if (this.server != null) {
2727
this.server.stop();
2828
this.server = null;
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
package com.microsoft.durabletask;
5+
6+
import com.google.protobuf.StringValue;
7+
import com.google.protobuf.Timestamp;
8+
import com.microsoft.durabletask.implementation.protobuf.OrchestratorService.*;
9+
import org.junit.jupiter.api.Test;
10+
11+
import java.time.Duration;
12+
import java.util.*;
13+
import java.util.logging.Logger;
14+
15+
import static org.junit.jupiter.api.Assertions.*;
16+
17+
/**
18+
* Unit tests for TaskOrchestrationExecutor.
19+
*/
20+
public class TaskOrchestrationExecutorTest {
21+
22+
private static final Logger logger = Logger.getLogger(TaskOrchestrationExecutorTest.class.getName());
23+
24+
@Test
25+
void execute_unregisteredOrchestrationType_failsWithDescriptiveMessage() {
26+
// Arrange: create executor with no registered orchestrations
27+
HashMap<String, TaskOrchestrationFactory> factories = new HashMap<>();
28+
TaskOrchestrationExecutor executor = new TaskOrchestrationExecutor(
29+
factories,
30+
new JacksonDataConverter(),
31+
Duration.ofDays(3),
32+
logger,
33+
null);
34+
35+
String unknownName = "NonExistentOrchestration";
36+
37+
// Build history events simulating an orchestration start
38+
HistoryEvent orchestratorStarted = HistoryEvent.newBuilder()
39+
.setEventId(-1)
40+
.setTimestamp(Timestamp.getDefaultInstance())
41+
.setOrchestratorStarted(OrchestratorStartedEvent.getDefaultInstance())
42+
.build();
43+
44+
HistoryEvent executionStarted = HistoryEvent.newBuilder()
45+
.setEventId(-1)
46+
.setTimestamp(Timestamp.getDefaultInstance())
47+
.setExecutionStarted(ExecutionStartedEvent.newBuilder()
48+
.setName(unknownName)
49+
.setVersion(StringValue.of(""))
50+
.setInput(StringValue.of("\"test-input\""))
51+
.setOrchestrationInstance(OrchestrationInstance.newBuilder()
52+
.setInstanceId("test-instance-id")
53+
.build())
54+
.build())
55+
.build();
56+
57+
HistoryEvent orchestratorCompleted = HistoryEvent.newBuilder()
58+
.setEventId(-1)
59+
.setTimestamp(Timestamp.getDefaultInstance())
60+
.setOrchestratorCompleted(OrchestratorCompletedEvent.getDefaultInstance())
61+
.build();
62+
63+
List<HistoryEvent> pastEvents = Arrays.asList(orchestratorStarted, executionStarted, orchestratorCompleted);
64+
List<HistoryEvent> newEvents = Collections.emptyList();
65+
66+
// Act
67+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
68+
69+
// Assert: the result should contain a CompleteOrchestrationAction with FAILED status
70+
// and a failure message mentioning the unknown orchestration name
71+
OrchestratorAction action = result.getActions().iterator().next();
72+
assertTrue(action.hasCompleteOrchestration(), "Expected a CompleteOrchestrationAction");
73+
74+
CompleteOrchestrationAction completeAction = action.getCompleteOrchestration();
75+
assertEquals(OrchestrationStatus.ORCHESTRATION_STATUS_FAILED, completeAction.getOrchestrationStatus());
76+
assertTrue(completeAction.hasFailureDetails(), "Expected failure details");
77+
78+
TaskFailureDetails failureDetails = completeAction.getFailureDetails();
79+
assertEquals("java.lang.IllegalStateException", failureDetails.getErrorType());
80+
assertTrue(failureDetails.getErrorMessage().contains(unknownName),
81+
"Error message should contain the orchestration name: " + failureDetails.getErrorMessage());
82+
assertTrue(failureDetails.getErrorMessage().contains("worker"),
83+
"Error message should mention workers: " + failureDetails.getErrorMessage());
84+
}
85+
}

endtoendtests/build.gradle

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id "com.microsoft.azure.azurefunctions" version "1.11.1"
3+
id "com.microsoft.azure.azurefunctions" version "1.16.1"
44
}
55

66
group 'com.durabletask.endtoend'
@@ -18,10 +18,12 @@ dependencies {
1818
implementation project(':client')
1919
implementation project(':azurefunctions')
2020

21-
implementation 'com.microsoft.azure.functions:azure-functions-java-library:3.1.0'
22-
testImplementation 'org.junit.jupiter:junit-jupiter:5.6.2'
23-
testImplementation 'io.rest-assured:rest-assured:5.3.0'
24-
testImplementation 'io.rest-assured:json-path:5.3.0'
21+
implementation 'com.microsoft.azure.functions:azure-functions-java-library:3.2.3'
22+
testImplementation platform('org.junit:junit-bom:5.14.2')
23+
testImplementation 'org.junit.jupiter:junit-jupiter'
24+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
25+
testImplementation 'io.rest-assured:rest-assured:5.5.7'
26+
testImplementation 'io.rest-assured:json-path:5.5.7'
2527

2628
}
2729

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

samples-azure-functions/build.gradle

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id "com.microsoft.azure.azurefunctions" version "1.11.1"
3+
id "com.microsoft.azure.azurefunctions" version "1.16.1"
44
}
55

66
group 'com.functions'
@@ -18,10 +18,12 @@ dependencies {
1818
implementation project(':client')
1919
implementation project(':azurefunctions')
2020

21-
implementation 'com.microsoft.azure.functions:azure-functions-java-library:3.0.0'
22-
testImplementation 'org.junit.jupiter:junit-jupiter:5.6.2'
23-
testImplementation 'io.rest-assured:rest-assured:5.3.0'
24-
testImplementation 'io.rest-assured:json-path:5.3.0'
21+
implementation 'com.microsoft.azure.functions:azure-functions-java-library:3.2.3'
22+
testImplementation platform('org.junit:junit-bom:5.14.2')
23+
testImplementation 'org.junit.jupiter:junit-jupiter'
24+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
25+
testImplementation 'io.rest-assured:rest-assured:5.5.7'
26+
testImplementation 'io.rest-assured:json-path:5.5.7'
2527

2628
}
2729

0 commit comments

Comments
 (0)