Skip to content

Commit

Permalink
Fix AutoConfigHint population in the mapper (#1415)
Browse files Browse the repository at this point in the history
What changed?
add missing mapper for autoconfighint
  • Loading branch information
shijiesheng authored Jan 6, 2025
1 parent 1fd8ba0 commit 6c105e0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/compatibility/proto/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ func PollForActivityTaskResponse(t *shared.PollForActivityTaskResponse) *apiv1.P
WorkflowType: WorkflowType(t.WorkflowType),
WorkflowDomain: t.GetWorkflowDomain(),
Header: Header(t.Header),
AutoConfigHint: AutoConfigHint(t.AutoConfigHint),
}
}

Expand All @@ -234,6 +235,7 @@ func PollForDecisionTaskResponse(t *shared.PollForDecisionTaskResponse) *apiv1.P
Queries: WorkflowQueryMap(t.Queries),
NextEventId: t.GetNextEventId(),
TotalHistoryBytes: t.GetTotalHistoryBytes(),
AutoConfigHint: AutoConfigHint(t.AutoConfigHint),
}
}

Expand Down
10 changes: 10 additions & 0 deletions internal/compatibility/proto/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ func ActivityType(t *shared.ActivityType) *apiv1.ActivityType {
}
}

func AutoConfigHint(t *shared.AutoConfigHint) *apiv1.AutoConfigHint {
if t == nil {
return nil
}
return &apiv1.AutoConfigHint{
EnableAutoConfig: t.GetEnableAutoConfig(),
PollerWaitTimeInMs: t.GetPollerWaitTimeInMs(),
}
}

func WorkflowType(t *shared.WorkflowType) *apiv1.WorkflowType {
if t == nil {
return nil
Expand Down
4 changes: 4 additions & 0 deletions internal/compatibility/testdata/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ var (
ActivityLocalDispatchInfoMap = map[string]*apiv1.ActivityLocalDispatchInfo{
ActivityID: &ActivityLocalDispatchInfo,
}
AutoConfigHint = apiv1.AutoConfigHint{
EnableAutoConfig: true,
PollerWaitTimeInMs: 100,
}
TaskListMetadata = apiv1.TaskListMetadata{
MaxTasksPerSecond: &gogo.DoubleValue{Value: RatePerSecond},
}
Expand Down
2 changes: 2 additions & 0 deletions internal/compatibility/testdata/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ var (
StartedTime: Timestamp2,
Queries: WorkflowQueryMap,
NextEventId: EventID3,
AutoConfigHint: &AutoConfigHint,
}
RespondDecisionTaskCompletedRequest = apiv1.RespondDecisionTaskCompletedRequest{
TaskToken: TaskToken,
Expand Down Expand Up @@ -245,6 +246,7 @@ var (
WorkflowType: &WorkflowType,
WorkflowDomain: DomainName,
Header: &Header,
AutoConfigHint: &AutoConfigHint,
}
RespondActivityTaskCompletedRequest = apiv1.RespondActivityTaskCompletedRequest{
TaskToken: TaskToken,
Expand Down

0 comments on commit 6c105e0

Please sign in to comment.