From ca5360f5a878a3e8db74d1143048a0c45cae9369 Mon Sep 17 00:00:00 2001 From: Chris Warren <16132615+c-warren@users.noreply.github.com> Date: Thu, 31 Jul 2025 09:12:13 -0700 Subject: [PATCH 1/3] Add unimplemented DiagnoseWorkflowExecution methods --- src/main/idls | 2 +- .../compatibility/Thrift2ProtoAdapter.java | 17 ++++++ .../sync/TestActivityEnvironmentInternal.java | 15 +++++ .../sync/TestWorkflowEnvironmentInternal.java | 17 ++++++ .../testservice/TestWorkflowService.java | 17 ++++++ .../serviceclient/IWorkflowServiceBase.java | 15 +++++ .../WorkflowServiceTChannel.java | 15 +++++ .../Thrift2ProtoAdapterTest.java | 2 + .../TestWorkflowServiceDiagnoseTest.java | 50 ++++++++++++++++ .../IWorkflowServiceBaseTest.java | 7 +++ .../WorkflowServiceTChannelDiagnoseTest.java | 59 +++++++++++++++++++ 11 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 src/test/java/com/uber/cadence/internal/testservice/TestWorkflowServiceDiagnoseTest.java create mode 100644 src/test/java/com/uber/cadence/serviceclient/WorkflowServiceTChannelDiagnoseTest.java diff --git a/src/main/idls b/src/main/idls index 83d5cae7f..f5ac3a987 160000 --- a/src/main/idls +++ b/src/main/idls @@ -1 +1 @@ -Subproject commit 83d5cae7fc5176f73486ffe82144044711930073 +Subproject commit f5ac3a987dcaf996cf44c72064195faf76c381f3 diff --git a/src/main/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapter.java b/src/main/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapter.java index a83561749..4850686c0 100644 --- a/src/main/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapter.java +++ b/src/main/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapter.java @@ -31,6 +31,8 @@ import com.uber.cadence.DescribeTaskListResponse; import com.uber.cadence.DescribeWorkflowExecutionRequest; import com.uber.cadence.DescribeWorkflowExecutionResponse; +import com.uber.cadence.DiagnoseWorkflowExecutionRequest; +import com.uber.cadence.DiagnoseWorkflowExecutionResponse; import com.uber.cadence.DomainAlreadyExistsError; import com.uber.cadence.DomainNotActiveError; import com.uber.cadence.EntityNotExistsError; @@ -156,6 +158,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque } } + @Override + public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution( + DiagnoseWorkflowExecutionRequest diagnoseRequest) + throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError, + ClientVersionNotSupportedError, TException { + throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented"); + } + @Override public ListDomainsResponse ListDomains(ListDomainsRequest listRequest) throws BadRequestError, EntityNotExistsError, ServiceBusyError, @@ -829,6 +839,13 @@ public void DescribeDomain( throw new UnsupportedOperationException("not implemented"); } + @Override + public void DiagnoseWorkflowExecution( + DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler) + throws TException { + throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented"); + } + @Override public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler) throws TException { diff --git a/src/main/java/com/uber/cadence/internal/sync/TestActivityEnvironmentInternal.java b/src/main/java/com/uber/cadence/internal/sync/TestActivityEnvironmentInternal.java index 2ed9218b1..8b763132c 100644 --- a/src/main/java/com/uber/cadence/internal/sync/TestActivityEnvironmentInternal.java +++ b/src/main/java/com/uber/cadence/internal/sync/TestActivityEnvironmentInternal.java @@ -593,6 +593,13 @@ public void DescribeDomain( impl.DescribeDomain(describeRequest, resultHandler); } + @Override + public void DiagnoseWorkflowExecution( + DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler) + throws TException { + throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented"); + } + @Override public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler) throws TException { @@ -921,6 +928,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque return impl.DescribeDomain(describeRequest); } + @Override + public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution( + DiagnoseWorkflowExecutionRequest diagnoseRequest) + throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError, + ClientVersionNotSupportedError, TException { + throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented"); + } + @Override public ListDomainsResponse ListDomains(ListDomainsRequest listRequest) throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError, diff --git a/src/main/java/com/uber/cadence/internal/sync/TestWorkflowEnvironmentInternal.java b/src/main/java/com/uber/cadence/internal/sync/TestWorkflowEnvironmentInternal.java index 5c432d1cc..aa810762e 100644 --- a/src/main/java/com/uber/cadence/internal/sync/TestWorkflowEnvironmentInternal.java +++ b/src/main/java/com/uber/cadence/internal/sync/TestWorkflowEnvironmentInternal.java @@ -29,6 +29,8 @@ import com.uber.cadence.DescribeTaskListResponse; import com.uber.cadence.DescribeWorkflowExecutionRequest; import com.uber.cadence.DescribeWorkflowExecutionResponse; +import com.uber.cadence.DiagnoseWorkflowExecutionRequest; +import com.uber.cadence.DiagnoseWorkflowExecutionResponse; import com.uber.cadence.DomainAlreadyExistsError; import com.uber.cadence.DomainNotActiveError; import com.uber.cadence.EntityNotExistsError; @@ -475,6 +477,13 @@ public void DescribeDomain( impl.DescribeDomain(describeRequest, resultHandler); } + @Override + public void DiagnoseWorkflowExecution( + DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler) + throws TException { + throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented"); + } + @Override public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler) throws TException { @@ -809,6 +818,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque return impl.DescribeDomain(describeRequest); } + @Override + public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution( + DiagnoseWorkflowExecutionRequest diagnoseRequest) + throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError, + ClientVersionNotSupportedError, TException { + throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented"); + } + @Override public ListDomainsResponse ListDomains(ListDomainsRequest listRequest) throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError, diff --git a/src/main/java/com/uber/cadence/internal/testservice/TestWorkflowService.java b/src/main/java/com/uber/cadence/internal/testservice/TestWorkflowService.java index 8af30e9d6..d0a87ef40 100644 --- a/src/main/java/com/uber/cadence/internal/testservice/TestWorkflowService.java +++ b/src/main/java/com/uber/cadence/internal/testservice/TestWorkflowService.java @@ -29,6 +29,8 @@ import com.uber.cadence.DescribeTaskListResponse; import com.uber.cadence.DescribeWorkflowExecutionRequest; import com.uber.cadence.DescribeWorkflowExecutionResponse; +import com.uber.cadence.DiagnoseWorkflowExecutionRequest; +import com.uber.cadence.DiagnoseWorkflowExecutionResponse; import com.uber.cadence.DomainAlreadyExistsError; import com.uber.cadence.DomainNotActiveError; import com.uber.cadence.EntityNotExistsError; @@ -206,6 +208,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque throw new UnsupportedOperationException("not implemented"); } + @Override + public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution( + DiagnoseWorkflowExecutionRequest diagnoseRequest) + throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError, + ClientVersionNotSupportedError, TException { + throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented"); + } + @Override public ListDomainsResponse ListDomains(ListDomainsRequest listRequest) throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError, @@ -834,6 +844,13 @@ public void DescribeDomain( throw new UnsupportedOperationException("not implemented"); } + @Override + public void DiagnoseWorkflowExecution( + DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler) + throws TException { + throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented"); + } + @Override public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler) throws TException { diff --git a/src/main/java/com/uber/cadence/serviceclient/IWorkflowServiceBase.java b/src/main/java/com/uber/cadence/serviceclient/IWorkflowServiceBase.java index db00bb728..7b1ce458d 100644 --- a/src/main/java/com/uber/cadence/serviceclient/IWorkflowServiceBase.java +++ b/src/main/java/com/uber/cadence/serviceclient/IWorkflowServiceBase.java @@ -43,6 +43,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque throw new UnsupportedOperationException("unimplemented"); } + @Override + public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution( + DiagnoseWorkflowExecutionRequest diagnoseRequest) + throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError, + ClientVersionNotSupportedError, TException { + throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented"); + } + @Override public ListDomainsResponse ListDomains(ListDomainsRequest listRequest) throws BadRequestError, EntityNotExistsError, ServiceBusyError, @@ -377,6 +385,13 @@ public void DescribeDomain( throw new UnsupportedOperationException("unimplemented"); } + @Override + public void DiagnoseWorkflowExecution( + DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler) + throws TException { + throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented"); + } + @Override public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler) throws TException { diff --git a/src/main/java/com/uber/cadence/serviceclient/WorkflowServiceTChannel.java b/src/main/java/com/uber/cadence/serviceclient/WorkflowServiceTChannel.java index 2878e6fac..d8d22695f 100644 --- a/src/main/java/com/uber/cadence/serviceclient/WorkflowServiceTChannel.java +++ b/src/main/java/com/uber/cadence/serviceclient/WorkflowServiceTChannel.java @@ -443,6 +443,14 @@ private DescribeDomainResponse describeDomain(DescribeDomainRequest describeRequ } } + @Override + public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution( + DiagnoseWorkflowExecutionRequest diagnoseRequest) + throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError, + ClientVersionNotSupportedError, TException { + throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented"); + } + @Override public ListDomainsResponse ListDomains(ListDomainsRequest listRequest) throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError, @@ -2937,6 +2945,13 @@ public void DescribeDomain( throw new UnsupportedOperationException("not implemented"); } + @Override + public void DiagnoseWorkflowExecution( + DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler) + throws TException { + throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented"); + } + @Override public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler) throws TException { diff --git a/src/test/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapterTest.java b/src/test/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapterTest.java index a8e17d9ec..d28b69804 100644 --- a/src/test/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapterTest.java +++ b/src/test/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapterTest.java @@ -786,9 +786,11 @@ public void testIsHealthy() throws Exception { @Test public void testAsyncUnsupported() { assertUnsupported(WorkflowService.Iface::RestartWorkflowExecution); + assertUnsupported(WorkflowService.Iface::DiagnoseWorkflowExecution); assertUnsupported(WorkflowService.Iface::GetTaskListsByDomain); assertAsyncUnsupported(WorkflowService.AsyncIface::RegisterDomain); assertAsyncUnsupported(WorkflowService.AsyncIface::DescribeDomain); + assertAsyncUnsupported(WorkflowService.AsyncIface::DiagnoseWorkflowExecution); assertAsyncUnsupported(WorkflowService.AsyncIface::ListDomains); assertAsyncUnsupported(WorkflowService.AsyncIface::UpdateDomain); assertAsyncUnsupported(WorkflowService.AsyncIface::DeprecateDomain); diff --git a/src/test/java/com/uber/cadence/internal/testservice/TestWorkflowServiceDiagnoseTest.java b/src/test/java/com/uber/cadence/internal/testservice/TestWorkflowServiceDiagnoseTest.java new file mode 100644 index 000000000..333abd2c9 --- /dev/null +++ b/src/test/java/com/uber/cadence/internal/testservice/TestWorkflowServiceDiagnoseTest.java @@ -0,0 +1,50 @@ +/** + * Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + *
Modifications copyright (C) 2017 Uber Technologies, Inc. + * + *
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. A copy of the License is located at + * + *
http://aws.amazon.com/apache2.0 + * + *
or in the "license" file accompanying this file. This file 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. + */ +package com.uber.cadence.internal.testservice; + +import static org.junit.Assert.assertThrows; + +import com.uber.cadence.DiagnoseWorkflowExecutionRequest; +import org.apache.thrift.async.AsyncMethodCallback; +import org.junit.Test; + +public class TestWorkflowServiceDiagnoseTest { + + private final TestWorkflowService service = new TestWorkflowService(); + + @Test + public void testDiagnoseWorkflowExecutionThrowsUnsupportedOperation() { + DiagnoseWorkflowExecutionRequest request = new DiagnoseWorkflowExecutionRequest(); + assertThrows( + UnsupportedOperationException.class, () -> service.DiagnoseWorkflowExecution(request)); + } + + @Test + public void testDiagnoseWorkflowExecutionAsyncThrowsUnsupportedOperation() { + DiagnoseWorkflowExecutionRequest request = new DiagnoseWorkflowExecutionRequest(); + AsyncMethodCallback callback = + new AsyncMethodCallback() { + @Override + public void onComplete(Object response) {} + + @Override + public void onError(Exception exception) {} + }; + + assertThrows( + UnsupportedOperationException.class, + () -> service.DiagnoseWorkflowExecution(request, callback)); + } +} diff --git a/src/test/java/com/uber/cadence/serviceclient/IWorkflowServiceBaseTest.java b/src/test/java/com/uber/cadence/serviceclient/IWorkflowServiceBaseTest.java index de02e485e..4408cf4af 100644 --- a/src/test/java/com/uber/cadence/serviceclient/IWorkflowServiceBaseTest.java +++ b/src/test/java/com/uber/cadence/serviceclient/IWorkflowServiceBaseTest.java @@ -36,6 +36,13 @@ public void testDescribeDomain() { assertThrows(UnsupportedOperationException.class, () -> service.DescribeDomain(null, null)); } + public void testDiagnoseWorkflowExecution() { + assertThrows( + UnsupportedOperationException.class, () -> service.DiagnoseWorkflowExecution(null)); + assertThrows( + UnsupportedOperationException.class, () -> service.DiagnoseWorkflowExecution(null, null)); + } + public void testListDomains() { assertThrows(UnsupportedOperationException.class, () -> service.ListDomains(null)); assertThrows(UnsupportedOperationException.class, () -> service.ListDomains(null, null)); diff --git a/src/test/java/com/uber/cadence/serviceclient/WorkflowServiceTChannelDiagnoseTest.java b/src/test/java/com/uber/cadence/serviceclient/WorkflowServiceTChannelDiagnoseTest.java new file mode 100644 index 000000000..536db39d9 --- /dev/null +++ b/src/test/java/com/uber/cadence/serviceclient/WorkflowServiceTChannelDiagnoseTest.java @@ -0,0 +1,59 @@ +/** + * Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + *
Modifications copyright (C) 2017 Uber Technologies, Inc. + * + *
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. A copy of the License is located at + * + *
http://aws.amazon.com/apache2.0 + * + *
or in the "license" file accompanying this file. This file 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.
+ */
+package com.uber.cadence.serviceclient;
+
+import static org.junit.Assert.assertThrows;
+import static org.mockito.Mockito.mock;
+
+import com.uber.cadence.DiagnoseWorkflowExecutionRequest;
+import com.uber.tchannel.api.SubChannel;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.junit.Before;
+import org.junit.Test;
+
+public class WorkflowServiceTChannelDiagnoseTest {
+
+ private WorkflowServiceTChannel service;
+
+ @Before
+ public void setUp() {
+ SubChannel mockSubChannel = mock(SubChannel.class);
+ service = new WorkflowServiceTChannel(mockSubChannel, ClientOptions.newBuilder().build());
+ }
+
+ @Test
+ public void testDiagnoseWorkflowExecutionThrowsUnsupportedOperation() {
+ DiagnoseWorkflowExecutionRequest request = new DiagnoseWorkflowExecutionRequest();
+ assertThrows(
+ UnsupportedOperationException.class, () -> service.DiagnoseWorkflowExecution(request));
+ }
+
+ @Test
+ public void testDiagnoseWorkflowExecutionAsyncThrowsUnsupportedOperation() {
+ DiagnoseWorkflowExecutionRequest request = new DiagnoseWorkflowExecutionRequest();
+ AsyncMethodCallback callback =
+ new AsyncMethodCallback() {
+ @Override
+ public void onComplete(Object response) {}
+
+ @Override
+ public void onError(Exception exception) {}
+ };
+
+ assertThrows(
+ UnsupportedOperationException.class,
+ () -> service.DiagnoseWorkflowExecution(request, callback));
+ }
+}
From 08baa9a14ff83ad5f7ca7a63e47b5d1279d9dd0f Mon Sep 17 00:00:00 2001
From: Chris Warren <16132615+c-warren@users.noreply.github.com>
Date: Thu, 31 Jul 2025 14:34:49 -0700
Subject: [PATCH 2/3] Fix proto and thrift mappers
---
.../compatibility/proto/RequestMapper.java | 11 ++++++++++-
.../internal/compatibility/ProtoObjects.java | 3 +++
.../internal/compatibility/ThriftObjects.java | 14 ++++++++++----
3 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/uber/cadence/internal/compatibility/proto/RequestMapper.java b/src/main/java/com/uber/cadence/internal/compatibility/proto/RequestMapper.java
index 319d3e5ea..c07d67361 100644
--- a/src/main/java/com/uber/cadence/internal/compatibility/proto/RequestMapper.java
+++ b/src/main/java/com/uber/cadence/internal/compatibility/proto/RequestMapper.java
@@ -29,6 +29,7 @@
import static com.uber.cadence.internal.compatibility.proto.Helpers.newFieldMask;
import static com.uber.cadence.internal.compatibility.proto.Helpers.nullToEmpty;
import static com.uber.cadence.internal.compatibility.proto.Helpers.secondsToDuration;
+import static com.uber.cadence.internal.compatibility.proto.Helpers.unixNanoToTime;
import static com.uber.cadence.internal.compatibility.proto.TypeMapper.badBinaries;
import static com.uber.cadence.internal.compatibility.proto.TypeMapper.clusterReplicationConfigurationArray;
import static com.uber.cadence.internal.compatibility.proto.TypeMapper.failure;
@@ -403,6 +404,7 @@ public static DescribeWorkflowExecutionRequest describeWorkflowExecutionRequest(
return DescribeWorkflowExecutionRequest.newBuilder()
.setDomain(t.getDomain())
.setWorkflowExecution(workflowExecution(t.getExecution()))
+ .setQueryConsistencyLevel(queryConsistencyLevel(t.getQueryConsistencyLevel()))
.build();
}
@@ -418,7 +420,8 @@ public static GetWorkflowExecutionHistoryRequest getWorkflowExecutionHistoryRequ
.setPageSize(t.getMaximumPageSize())
.setWaitForNewEvent(t.isWaitForNewEvent())
.setHistoryEventFilterType(eventFilterType(t.HistoryEventFilterType))
- .setSkipArchival(t.isSkipArchival());
+ .setSkipArchival(t.isSkipArchival())
+ .setQueryConsistencyLevel(queryConsistencyLevel(t.getQueryConsistencyLevel()));
if (t.getNextPageToken() != null) {
builder.setNextPageToken(arrayToByteString(t.getNextPageToken()));
}
@@ -445,6 +448,9 @@ public static SignalWithStartWorkflowExecutionRequest signalWithStartWorkflowExe
.setSearchAttributes(searchAttributes(t.getSearchAttributes()))
.setHeader(header(t.getHeader()))
.setJitterStart(secondsToDuration(t.getJitterStartSeconds()));
+ if (t.isSetFirstRunAtTimestamp()) {
+ builder.setFirstRunAt(unixNanoToTime(t.getFirstRunAtTimestamp()));
+ }
if (t.getRetryPolicy() != null) {
builder.setRetryPolicy(retryPolicy(t.getRetryPolicy()));
}
@@ -530,6 +536,9 @@ public static StartWorkflowExecutionRequest startWorkflowExecutionRequest(
.setHeader(header(t.getHeader()))
.setDelayStart(secondsToDuration(t.getDelayStartSeconds()))
.setJitterStart(secondsToDuration(t.getJitterStartSeconds()));
+ if (t.isSetFirstRunAtTimestamp()) {
+ request.setFirstRunAt(unixNanoToTime(t.getFirstRunAtTimestamp()));
+ }
if (t.getRetryPolicy() != null) {
request.setRetryPolicy(retryPolicy(t.getRetryPolicy()));
}
diff --git a/src/test/java/com/uber/cadence/internal/compatibility/ProtoObjects.java b/src/test/java/com/uber/cadence/internal/compatibility/ProtoObjects.java
index c12ae0ea5..5a9878f82 100644
--- a/src/test/java/com/uber/cadence/internal/compatibility/ProtoObjects.java
+++ b/src/test/java/com/uber/cadence/internal/compatibility/ProtoObjects.java
@@ -984,6 +984,7 @@ public final class ProtoObjects {
DescribeWorkflowExecutionRequest.newBuilder()
.setDomain("domain")
.setWorkflowExecution(WORKFLOW_EXECUTION)
+ .setQueryConsistencyLevel(QueryConsistencyLevel.QUERY_CONSISTENCY_LEVEL_STRONG)
.build();
public static final GetWorkflowExecutionHistoryRequest GET_WORKFLOW_EXECUTION_HISTORY_REQUEST =
@@ -995,6 +996,7 @@ public final class ProtoObjects {
.setHistoryEventFilterType(EventFilterType.EVENT_FILTER_TYPE_CLOSE_EVENT)
.setSkipArchival(true)
.setNextPageToken(utf8("nextPageToken"))
+ .setQueryConsistencyLevel(QueryConsistencyLevel.QUERY_CONSISTENCY_LEVEL_STRONG)
.build();
public static final StartWorkflowExecutionRequest START_WORKFLOW_EXECUTION =
@@ -1016,6 +1018,7 @@ public final class ProtoObjects {
.setHeader(HEADER)
.setDelayStart(seconds(3))
.setJitterStart(seconds(0))
+ .setFirstRunAt(timestampNanos(123456789))
.build();
public static final SignalWithStartWorkflowExecutionRequest SIGNAL_WITH_START_WORKFLOW_EXECUTION =
diff --git a/src/test/java/com/uber/cadence/internal/compatibility/ThriftObjects.java b/src/test/java/com/uber/cadence/internal/compatibility/ThriftObjects.java
index 7737f01bb..ea28fbb22 100644
--- a/src/test/java/com/uber/cadence/internal/compatibility/ThriftObjects.java
+++ b/src/test/java/com/uber/cadence/internal/compatibility/ThriftObjects.java
@@ -843,7 +843,10 @@ public final class ThriftObjects {
.setQuery("query");
public static final DescribeWorkflowExecutionRequest DESCRIBE_WORKFLOW_EXECUTION_REQUEST =
- new DescribeWorkflowExecutionRequest().setDomain("domain").setExecution(WORKFLOW_EXECUTION);
+ new DescribeWorkflowExecutionRequest()
+ .setDomain("domain")
+ .setExecution(WORKFLOW_EXECUTION)
+ .setQueryConsistencyLevel(QueryConsistencyLevel.STRONG);
public static final GetWorkflowExecutionHistoryRequest GET_WORKFLOW_EXECUTION_HISTORY_REQUEST =
new GetWorkflowExecutionHistoryRequest()
@@ -853,7 +856,8 @@ public final class ThriftObjects {
.setWaitForNewEvent(true)
.setHistoryEventFilterType(HistoryEventFilterType.CLOSE_EVENT)
.setSkipArchival(true)
- .setNextPageToken(utf8("nextPageToken"));
+ .setNextPageToken(utf8("nextPageToken"))
+ .setQueryConsistencyLevel(QueryConsistencyLevel.STRONG);
public static final com.uber.cadence.StartWorkflowExecutionRequest START_WORKFLOW_EXECUTION =
new com.uber.cadence.StartWorkflowExecutionRequest()
@@ -873,7 +877,8 @@ public final class ThriftObjects {
.setSearchAttributes(SEARCH_ATTRIBUTES)
.setHeader(HEADER)
.setJitterStartSeconds(0)
- .setDelayStartSeconds(3);
+ .setDelayStartSeconds(3)
+ .setFirstRunAtTimestamp(123456789L);
public static final com.uber.cadence.SignalWithStartWorkflowExecutionRequest
SIGNAL_WITH_START_WORKFLOW_EXECUTION =
new SignalWithStartWorkflowExecutionRequest()
@@ -896,7 +901,8 @@ public final class ThriftObjects {
.setSearchAttributes(SEARCH_ATTRIBUTES)
.setHeader(HEADER)
.setDelayStartSeconds(3)
- .setJitterStartSeconds(0);
+ .setJitterStartSeconds(0)
+ .setFirstRunAtTimestamp(123456789L);
public static final StartWorkflowExecutionAsyncRequest START_WORKFLOW_EXECUTION_ASYNC_REQUEST =
new StartWorkflowExecutionAsyncRequest().setRequest(START_WORKFLOW_EXECUTION);
From 4e7be6680d8083abb5ec9946d528ceeef1377405 Mon Sep 17 00:00:00 2001
From: Chris Warren <16132615+c-warren@users.noreply.github.com>
Date: Thu, 31 Jul 2025 19:02:34 -0700
Subject: [PATCH 3/3] fix the next round of compile/test errors from idl
changes
---
.../internal/compatibility/Thrift2ProtoAdapter.java | 2 +-
.../internal/compatibility/thrift/HistoryMapper.java | 2 ++
.../compatibility/thrift/ResponseMapper.java | 3 +++
.../internal/compatibility/thrift/TypeMapper.java | 11 +++++++++++
.../sync/TestActivityEnvironmentInternal.java | 4 ++--
.../cadence/internal/compatibility/ProtoObjects.java | 6 ++++++
.../internal/compatibility/ThriftObjects.java | 12 +++++++++---
.../compatibility/thrift/HistoryMapperEventTest.java | 3 +--
8 files changed, 35 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapter.java b/src/main/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapter.java
index 4850686c0..b4bae6557 100644
--- a/src/main/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapter.java
+++ b/src/main/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapter.java
@@ -843,7 +843,7 @@ public void DescribeDomain(
public void DiagnoseWorkflowExecution(
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
throws TException {
- throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
+ throw new UnsupportedOperationException("not implemented");
}
@Override
diff --git a/src/main/java/com/uber/cadence/internal/compatibility/thrift/HistoryMapper.java b/src/main/java/com/uber/cadence/internal/compatibility/thrift/HistoryMapper.java
index ed1b0b54d..8c49de1f7 100644
--- a/src/main/java/com/uber/cadence/internal/compatibility/thrift/HistoryMapper.java
+++ b/src/main/java/com/uber/cadence/internal/compatibility/thrift/HistoryMapper.java
@@ -947,6 +947,8 @@ static MarkerRecordedEventAttributes markerRecordedEventAttributes(
res.setMemo(memo(t.getMemo()));
res.setSearchAttributes(searchAttributes(t.getSearchAttributes()));
res.setDelayStartSeconds(durationToSeconds(t.getDelayStart()));
+ res.setJitterStartSeconds(durationToSeconds(t.getJitterStart()));
+ res.setFirstRunAtTimestamp(timeToUnixNano(t.getFirstRunAt()));
return res;
}
diff --git a/src/main/java/com/uber/cadence/internal/compatibility/thrift/ResponseMapper.java b/src/main/java/com/uber/cadence/internal/compatibility/thrift/ResponseMapper.java
index b517216bc..10fe645e7 100644
--- a/src/main/java/com/uber/cadence/internal/compatibility/thrift/ResponseMapper.java
+++ b/src/main/java/com/uber/cadence/internal/compatibility/thrift/ResponseMapper.java
@@ -25,6 +25,7 @@
import static com.uber.cadence.internal.compatibility.thrift.HistoryMapper.history;
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.activityLocalDispatchInfoMap;
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.activityType;
+import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.autoConfigHint;
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.badBinaries;
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.clusterReplicationConfigurationArray;
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.dataBlobArray;
@@ -239,6 +240,7 @@ public static PollForActivityTaskResponse pollForActivityTaskResponse(
res.setWorkflowType(workflowType(t.getWorkflowType()));
res.setWorkflowDomain(t.getWorkflowDomain());
res.setHeader(header(t.getHeader()));
+ res.setAutoConfigHint(autoConfigHint(t.getAutoConfigHint()));
return res;
}
@@ -265,6 +267,7 @@ public static PollForDecisionTaskResponse pollForDecisionTaskResponse(
res.setStartedTimestamp(timeToUnixNano(t.getStartedTime()));
res.setQueries(workflowQueryMap(t.getQueriesMap()));
res.setNextEventId(t.getNextEventId());
+ res.setAutoConfigHint(autoConfigHint(t.getAutoConfigHint()));
return res;
}
diff --git a/src/main/java/com/uber/cadence/internal/compatibility/thrift/TypeMapper.java b/src/main/java/com/uber/cadence/internal/compatibility/thrift/TypeMapper.java
index be2d34855..681b495dd 100644
--- a/src/main/java/com/uber/cadence/internal/compatibility/thrift/TypeMapper.java
+++ b/src/main/java/com/uber/cadence/internal/compatibility/thrift/TypeMapper.java
@@ -31,6 +31,7 @@
import com.uber.cadence.ActivityLocalDispatchInfo;
import com.uber.cadence.ActivityType;
+import com.uber.cadence.AutoConfigHint;
import com.uber.cadence.BadBinaries;
import com.uber.cadence.BadBinaryInfo;
import com.uber.cadence.ClusterReplicationConfiguration;
@@ -686,4 +687,14 @@ static Map