Skip to content

Commit b6fc775

Browse files
authored
Support passing the specified QueryConsistencyLevel (#1456)
<!-- Describe what has changed in this PR --> **What changed?** Updated mappers for `DescribeWorkflowExecutionRequest` and `GetWorkflowExecutionHistoryRequest`. <!-- Tell your future self why have you made these changes --> **Why?** When implementing the ability to pass QueryConsistencyLevel: Strong on DescribeWorkflowExecution and GetWorkflowExecutionHistory I missed two mappers to convert between proto and thrift objects. This meant that requests passed via the go client did not have the user defined consistency level and passed the default, Invalid. <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> **How did you test it?** Unit tests + tested w/ a local script using the go client against our staging environments. <!-- Assuming the worst case, what can be broken when deploying this change to production? --> **Potential risks** N/A
1 parent 061b43b commit b6fc775

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

internal/compatibility/proto/request.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ func DescribeWorkflowExecutionRequest(t *shared.DescribeWorkflowExecutionRequest
7676
return nil
7777
}
7878
return &apiv1.DescribeWorkflowExecutionRequest{
79-
Domain: t.GetDomain(),
80-
WorkflowExecution: WorkflowExecution(t.Execution),
79+
Domain: t.GetDomain(),
80+
WorkflowExecution: WorkflowExecution(t.Execution),
81+
QueryConsistencyLevel: QueryConsistencyLevel(t.QueryConsistencyLevel),
8182
}
8283
}
8384

@@ -104,6 +105,7 @@ func GetWorkflowExecutionHistoryRequest(t *shared.GetWorkflowExecutionHistoryReq
104105
WaitForNewEvent: t.GetWaitForNewEvent(),
105106
HistoryEventFilterType: EventFilterType(t.HistoryEventFilterType),
106107
SkipArchival: t.GetSkipArchival(),
108+
QueryConsistencyLevel: QueryConsistencyLevel(t.QueryConsistencyLevel),
107109
}
108110
}
109111

internal/compatibility/testdata/service.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,9 @@ var (
443443
Identity: Identity,
444444
}
445445
DescribeWorkflowExecutionRequest = apiv1.DescribeWorkflowExecutionRequest{
446-
Domain: DomainName,
447-
WorkflowExecution: &WorkflowExecution,
446+
Domain: DomainName,
447+
WorkflowExecution: &WorkflowExecution,
448+
QueryConsistencyLevel: QueryConsistencyLevel,
448449
}
449450
DescribeWorkflowExecutionResponse = apiv1.DescribeWorkflowExecutionResponse{
450451
ExecutionConfiguration: &WorkflowExecutionConfiguration,
@@ -504,6 +505,7 @@ var (
504505
WaitForNewEvent: true,
505506
HistoryEventFilterType: HistoryEventFilterType,
506507
SkipArchival: true,
508+
QueryConsistencyLevel: QueryConsistencyLevel,
507509
}
508510
GetWorkflowExecutionHistoryResponse = apiv1.GetWorkflowExecutionHistoryResponse{
509511
History: &History,

internal/compatibility/thrift/request.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ func DescribeWorkflowExecutionRequest(t *apiv1.DescribeWorkflowExecutionRequest)
7878
return nil
7979
}
8080
return &shared.DescribeWorkflowExecutionRequest{
81-
Domain: &t.Domain,
82-
Execution: WorkflowExecution(t.WorkflowExecution),
81+
Domain: &t.Domain,
82+
Execution: WorkflowExecution(t.WorkflowExecution),
83+
QueryConsistencyLevel: QueryConsistencyLevel(t.QueryConsistencyLevel),
8384
}
8485
}
8586

@@ -106,6 +107,7 @@ func GetWorkflowExecutionHistoryRequest(t *apiv1.GetWorkflowExecutionHistoryRequ
106107
WaitForNewEvent: &t.WaitForNewEvent,
107108
HistoryEventFilterType: EventFilterType(t.HistoryEventFilterType),
108109
SkipArchival: &t.SkipArchival,
110+
QueryConsistencyLevel: QueryConsistencyLevel(t.QueryConsistencyLevel),
109111
}
110112
}
111113

0 commit comments

Comments
 (0)