Skip to content

Commit 553c95e

Browse files
authored
[frontend] update idls and ensure thrift fields roundtrip (cadence-workflow#5365)
* [frontend] update ilds and ensure thrift fields roundtrip * update idls submodule * regenerate using proper go version 1.17
1 parent 6961e8e commit 553c95e

File tree

4 files changed

+192
-21
lines changed

4 files changed

+192
-21
lines changed

.gen/go/shared/shared.go

Lines changed: 132 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/types/mapper/thrift/shared.go

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6266,6 +6266,8 @@ func FromWorkflowExecutionInfo(t *types.WorkflowExecutionInfo) *shared.WorkflowE
62666266
CloseStatus: FromWorkflowExecutionCloseStatus(t.CloseStatus),
62676267
HistoryLength: &t.HistoryLength,
62686268
ParentDomainId: t.ParentDomainID,
6269+
ParentDomainName: t.ParentDomain,
6270+
ParentInitatedId: t.ParentInitiatedID,
62696271
ParentExecution: FromWorkflowExecution(t.ParentExecution),
62706272
ExecutionTime: t.ExecutionTime,
62716273
Memo: FromMemo(t.Memo),
@@ -6284,22 +6286,24 @@ func ToWorkflowExecutionInfo(t *shared.WorkflowExecutionInfo) *types.WorkflowExe
62846286
return nil
62856287
}
62866288
return &types.WorkflowExecutionInfo{
6287-
Execution: ToWorkflowExecution(t.Execution),
6288-
Type: ToWorkflowType(t.Type),
6289-
StartTime: t.StartTime,
6290-
CloseTime: t.CloseTime,
6291-
CloseStatus: ToWorkflowExecutionCloseStatus(t.CloseStatus),
6292-
HistoryLength: t.GetHistoryLength(),
6293-
ParentDomainID: t.ParentDomainId,
6294-
ParentExecution: ToWorkflowExecution(t.ParentExecution),
6295-
ExecutionTime: t.ExecutionTime,
6296-
Memo: ToMemo(t.Memo),
6297-
SearchAttributes: ToSearchAttributes(t.SearchAttributes),
6298-
AutoResetPoints: ToResetPoints(t.AutoResetPoints),
6299-
TaskList: t.GetTaskList(),
6300-
IsCron: t.GetIsCron(),
6301-
UpdateTime: t.UpdateTime,
6302-
PartitionConfig: t.PartitionConfig,
6289+
Execution: ToWorkflowExecution(t.Execution),
6290+
Type: ToWorkflowType(t.Type),
6291+
StartTime: t.StartTime,
6292+
CloseTime: t.CloseTime,
6293+
CloseStatus: ToWorkflowExecutionCloseStatus(t.CloseStatus),
6294+
HistoryLength: t.GetHistoryLength(),
6295+
ParentDomainID: t.ParentDomainId,
6296+
ParentDomain: t.ParentDomainName,
6297+
ParentInitiatedID: t.ParentInitatedId,
6298+
ParentExecution: ToWorkflowExecution(t.ParentExecution),
6299+
ExecutionTime: t.ExecutionTime,
6300+
Memo: ToMemo(t.Memo),
6301+
SearchAttributes: ToSearchAttributes(t.SearchAttributes),
6302+
AutoResetPoints: ToResetPoints(t.AutoResetPoints),
6303+
TaskList: t.GetTaskList(),
6304+
IsCron: t.GetIsCron(),
6305+
UpdateTime: t.UpdateTime,
6306+
PartitionConfig: t.PartitionConfig,
63036307
}
63046308
}
63056309

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// The MIT License (MIT)
2+
3+
// Copyright (c) 2017-2020 Uber Technologies Inc.
4+
5+
// Permission is hereby granted, free of charge, to any person obtaining a copy
6+
// of this software and associated documentation files (the "Software"), to deal
7+
// in the Software without restriction, including without limitation the rights
8+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
// copies of the Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall be included in all
13+
// copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
// SOFTWARE.
22+
23+
package thrift_test
24+
25+
import (
26+
"testing"
27+
28+
"github.com/stretchr/testify/assert"
29+
30+
"github.com/uber/cadence/common/types"
31+
"github.com/uber/cadence/common/types/mapper/thrift"
32+
"github.com/uber/cadence/common/types/testdata"
33+
)
34+
35+
func TestWorkflowExecutionInfo(t *testing.T) {
36+
for _, item := range []*types.WorkflowExecutionInfo{nil, {}, &testdata.WorkflowExecutionInfo, &testdata.CronWorkflowExecutionInfo} {
37+
assert.Equal(t, item, thrift.ToWorkflowExecutionInfo(thrift.FromWorkflowExecutionInfo(item)))
38+
}
39+
}

idls

Submodule idls updated from b6f2035 to eb9698c

0 commit comments

Comments
 (0)