Skip to content

Commit 8fb193f

Browse files
committed
feedback changes
1 parent 9a02b23 commit 8fb193f

File tree

5 files changed

+71
-36
lines changed

5 files changed

+71
-36
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## placeholder
2-
* Add automatic proto file download and commit hash tracking during build ([#TBD](https://github.com/microsoft/durabletask-java/pull/TBD))
2+
* Add automatic proto file download and commit hash tracking during build ([#201](https://github.com/microsoft/durabletask-java/pull/201))
33
* Fix infinite loop when use continueasnew after wait external event ([#183](https://github.com/microsoft/durabletask-java/pull/183))
44
* Fix the issue "Deserialize Exception got swallowed when use anyOf with external event." ([#185](https://github.com/microsoft/durabletask-java/pull/185))
55

client/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def jacksonVersion = '2.15.3'
1717
// When build on local, you need to set this value to your local jdk11 directory.
1818
// Java11 is used to compile and run all the tests.
1919
// Example for Windows: C:/Program Files/Java/openjdk-11.0.12_7/
20-
def PATH_TO_TEST_JAVA_RUNTIME = "$System.env.JDK_11"
20+
def PATH_TO_TEST_JAVA_RUNTIME = System.env.JDK_11 ?: System.getProperty("java.home")
2121

2222
dependencies {
2323

@@ -52,19 +52,21 @@ compileTestJava {
5252
}
5353

5454
task downloadProtoFiles {
55+
ext.branch = project.hasProperty('protoBranch') ? project.protoBranch : 'main'
56+
5557
doLast {
5658
def protoDir = file("${rootProject.projectDir}/internal/durabletask-protobuf/protos")
5759
protoDir.mkdirs()
5860

5961
// Download the proto file
60-
new URL('https://raw.githubusercontent.com/microsoft/durabletask-protobuf/main/protos/orchestrator_service.proto')
62+
new URL("https://raw.githubusercontent.com/microsoft/durabletask-protobuf/${ext.branch}/protos/orchestrator_service.proto")
6163
.withInputStream { i ->
6264
new File(protoDir, 'orchestrator_service.proto').withOutputStream { it << i }
6365
}
6466

6567
// Get and save the commit hash
6668
def commitHashFile = new File("${rootProject.projectDir}/internal/durabletask-protobuf/PROTO_SOURCE_COMMIT_HASH")
67-
def commitApiUrl = new URL('https://api.github.com/repos/microsoft/durabletask-protobuf/commits?path=protos/orchestrator_service.proto&sha=main&per_page=1')
69+
def commitApiUrl = new URL("https://api.github.com/repos/microsoft/durabletask-protobuf/commits?path=protos/orchestrator_service.proto&sha=${ext.branch}&per_page=1")
6870
def connection = commitApiUrl.openConnection()
6971
connection.setRequestProperty('Accept', 'application/vnd.github.v3+json')
7072
def commitHash = new groovy.json.JsonSlurper().parse(connection.inputStream)[0].sha
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
443b333f4f65a438dc9eb4f090560d232afec4b7
1+
310000510e1c1544a4e99172007bd058ade66c55

internal/durabletask-protobuf/README.md

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,5 @@ The proto files are automatically downloaded and updated when running Gradle bui
2020
If you need to manually update the proto files, you can run:
2121

2222
```bash
23-
./gradlew downloadProtoFiles
24-
```
25-
26-
# Durable Task Protobuf Definitions
27-
28-
This repo contains [protocol buffer](https://developers.google.com/protocol-buffers) (protobuf) definitions
29-
used by the Durable Task framework sidecar architecture. It's recommended that Durable Task language SDKs reference
30-
the protobuf contracts in this repo via [Git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
31-
32-
## Contributing
33-
34-
This project welcomes contributions and suggestions. Most contributions require you to agree to a
35-
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
36-
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
37-
38-
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
39-
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
40-
provided by the bot. You will only need to do this once across all repos using our CLA.
41-
42-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
43-
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
44-
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
45-
46-
## Trademarks
47-
48-
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
49-
trademarks or logos is subject to and must follow
50-
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general).
51-
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
52-
Any use of third-party trademarks or logos are subject to those third-party's policies.
23+
./gradlew downloadProtoFiles -PprotoBranch=<branch-name>
24+
```

internal/durabletask-protobuf/protos/orchestrator_service.proto

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,51 @@ message ExecutionResumedEvent {
171171
google.protobuf.StringValue input = 1;
172172
}
173173

174+
message EntityOperationSignaledEvent {
175+
string requestId = 1;
176+
string operation = 2;
177+
google.protobuf.Timestamp scheduledTime = 3;
178+
google.protobuf.StringValue input = 4;
179+
google.protobuf.StringValue targetInstanceId = 5; // used only within histories, null in messages
180+
}
181+
182+
message EntityOperationCalledEvent {
183+
string requestId = 1;
184+
string operation = 2;
185+
google.protobuf.Timestamp scheduledTime = 3;
186+
google.protobuf.StringValue input = 4;
187+
google.protobuf.StringValue parentInstanceId = 5; // used only within messages, null in histories
188+
google.protobuf.StringValue parentExecutionId = 6; // used only within messages, null in histories
189+
google.protobuf.StringValue targetInstanceId = 7; // used only within histories, null in messages
190+
}
191+
192+
message EntityLockRequestedEvent {
193+
string criticalSectionId = 1;
194+
repeated string lockSet = 2;
195+
int32 position = 3;
196+
google.protobuf.StringValue parentInstanceId = 4; // used only within messages, null in histories
197+
}
198+
199+
message EntityOperationCompletedEvent {
200+
string requestId = 1;
201+
google.protobuf.StringValue output = 2;
202+
}
203+
204+
message EntityOperationFailedEvent {
205+
string requestId = 1;
206+
TaskFailureDetails failureDetails = 2;
207+
}
208+
209+
message EntityUnlockSentEvent {
210+
string criticalSectionId = 1;
211+
google.protobuf.StringValue parentInstanceId = 2; // used only within messages, null in histories
212+
google.protobuf.StringValue targetInstanceId = 3; // used only within histories, null in messages
213+
}
214+
215+
message EntityLockGrantedEvent {
216+
string criticalSectionId = 1;
217+
}
218+
174219
message HistoryEvent {
175220
int32 eventId = 1;
176221
google.protobuf.Timestamp timestamp = 2;
@@ -195,6 +240,13 @@ message HistoryEvent {
195240
ContinueAsNewEvent continueAsNew = 20;
196241
ExecutionSuspendedEvent executionSuspended = 21;
197242
ExecutionResumedEvent executionResumed = 22;
243+
EntityOperationSignaledEvent entityOperationSignaled = 23;
244+
EntityOperationCalledEvent entityOperationCalled = 24;
245+
EntityOperationCompletedEvent entityOperationCompleted = 25;
246+
EntityOperationFailedEvent entityOperationFailed = 26;
247+
EntityLockRequestedEvent entityLockRequested = 27;
248+
EntityLockGrantedEvent entityLockGranted = 28;
249+
EntityUnlockSentEvent entityUnlockSent = 29;
198250
}
199251
}
200252

@@ -495,6 +547,13 @@ message EntityBatchResult {
495547
TaskFailureDetails failureDetails = 4;
496548
}
497549

550+
message EntityRequest {
551+
string instanceId = 1;
552+
string executionId = 2;
553+
google.protobuf.StringValue entityState = 3; // null if entity does not exist
554+
repeated HistoryEvent operationRequests = 4;
555+
}
556+
498557
message OperationRequest {
499558
string operation = 1;
500559
string requestId = 2;
@@ -602,14 +661,16 @@ service TaskHubSidecarService {
602661
message GetWorkItemsRequest {
603662
int32 maxConcurrentOrchestrationWorkItems = 1;
604663
int32 maxConcurrentActivityWorkItems = 2;
664+
int32 maxConcurrentEntityWorkItems = 3;
605665
}
606666

607667
message WorkItem {
608668
oneof request {
609669
OrchestratorRequest orchestratorRequest = 1;
610670
ActivityRequest activityRequest = 2;
611-
EntityBatchRequest entityRequest = 3;
671+
EntityBatchRequest entityRequest = 3; // (older) used by orchestration services implementations
612672
HealthPing healthPing = 4;
673+
EntityRequest entityRequestV2 = 5; // (newer) used by backend service implementations
613674
}
614675
string completionToken = 10;
615676
}

0 commit comments

Comments
 (0)