Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove WorkflowIDReusePolicy from schedule options #1077

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions internal/internal_schedule_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,6 @@ func convertToPBScheduleAction(ctx context.Context, client *WorkflowClient, sche
WorkflowExecutionTimeout: &action.WorkflowExecutionTimeout,
WorkflowRunTimeout: &action.WorkflowRunTimeout,
WorkflowTaskTimeout: &action.WorkflowTaskTimeout,
WorkflowIdReusePolicy: action.WorkflowIDReusePolicy,
RetryPolicy: convertToPBRetryPolicy(action.RetryPolicy),
Memo: memo,
SearchAttributes: searchAttr,
Expand Down Expand Up @@ -651,7 +650,6 @@ func convertFromPBScheduleAction(action *schedulepb.ScheduleAction) (ScheduleAct
WorkflowExecutionTimeout: common.DurationValue(workflow.GetWorkflowExecutionTimeout()),
WorkflowRunTimeout: common.DurationValue(workflow.GetWorkflowRunTimeout()),
WorkflowTaskTimeout: common.DurationValue(workflow.GetWorkflowTaskTimeout()),
WorkflowIDReusePolicy: workflow.GetWorkflowIdReusePolicy(),
RetryPolicy: convertFromPBRetryPolicy(workflow.RetryPolicy),
Memo: memos,
SearchAttributes: searchAttributes,
Expand Down
4 changes: 0 additions & 4 deletions internal/schedule_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,6 @@ type (
// pulled this task.
WorkflowTaskTimeout time.Duration

// WorkflowIdReusePolicy - Whether server allow reuse of workflow ID, can be useful
// for dedupe logic if set to RejectDuplicate.
WorkflowIDReusePolicy enumspb.WorkflowIdReusePolicy

// RetryPolicy - Retry policy for workflow. If a retry policy is specified, in case of workflow failure
// server will start new workflow execution if needed based on the retry policy.
RetryPolicy *RetryPolicy
Expand Down
40 changes: 30 additions & 10 deletions test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2962,26 +2962,29 @@ func (ts *IntegrationTestSuite) TestScheduleCalendarDefault() {
// test default calendar spec
ts.Equal([]client.ScheduleCalendarSpec{
{
Second: []client.ScheduleRange{{Start: 30, End: 30}},
Minute: []client.ScheduleRange{{}},
Hour: []client.ScheduleRange{{}},
Second: []client.ScheduleRange{{Start: 30, End: 30, Step: 1}},
Minute: []client.ScheduleRange{{Start: 0, End: 0, Step: 1}},
Hour: []client.ScheduleRange{{Start: 0, End: 0, Step: 1}},
DayOfMonth: []client.ScheduleRange{
{
Start: 1,
End: 31,
Step: 1,
},
},
Month: []client.ScheduleRange{
{
Start: 1,
End: 12,
Step: 1,
},
},
Year: []client.ScheduleRange{},
DayOfWeek: []client.ScheduleRange{
{
Start: 0,
End: 6,
Step: 1,
},
},
},
Expand Down Expand Up @@ -3012,7 +3015,6 @@ func (ts *IntegrationTestSuite) TestScheduleCreateDuplicate() {
func (ts *IntegrationTestSuite) TestScheduleDescribeSpec() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

handle, err := ts.client.ScheduleClient().Create(ctx, client.ScheduleOptions{
ID: "test-schedule-describe-spec-schedule",
Spec: client.ScheduleSpec{
Expand Down Expand Up @@ -3092,27 +3094,33 @@ func (ts *IntegrationTestSuite) TestScheduleDescribeSpec() {
// test spec
ts.Equal([]client.ScheduleCalendarSpec{
{
Second: []client.ScheduleRange{{}},
Minute: []client.ScheduleRange{{}},
Second: []client.ScheduleRange{{Start: 0, End: 0, Step: 1}},
Minute: []client.ScheduleRange{{Start: 0, End: 0, Step: 1}},
Hour: []client.ScheduleRange{{
Start: 12,
End: 12,
Step: 1,
}},
DayOfMonth: []client.ScheduleRange{
{
Start: 1,
End: 31,
Step: 1,
},
},
Month: []client.ScheduleRange{
{
Start: 1,
End: 12,
Step: 1,
},
},
Year: []client.ScheduleRange{},
DayOfWeek: []client.ScheduleRange{
{
Start: 1,
End: 1,
Step: 1,
},
},
},
Expand All @@ -3130,27 +3138,33 @@ func (ts *IntegrationTestSuite) TestScheduleDescribeSpec() {

ts.Equal([]client.ScheduleCalendarSpec{
{
Second: []client.ScheduleRange{{}},
Minute: []client.ScheduleRange{{}},
Second: []client.ScheduleRange{{Start: 0, End: 0, Step: 1}},
Minute: []client.ScheduleRange{{Start: 0, End: 0, Step: 1}},
Hour: []client.ScheduleRange{{
Start: 12,
End: 12,
Step: 1,
}},
DayOfMonth: []client.ScheduleRange{
{
Start: 1,
End: 31,
Step: 1,
},
},
Month: []client.ScheduleRange{
{
Start: 1,
End: 12,
Step: 1,
},
},
Year: []client.ScheduleRange{},
DayOfWeek: []client.ScheduleRange{
{
Start: 1,
Step: 1,
End: 1,
},
},
},
Expand Down Expand Up @@ -3182,27 +3196,33 @@ func (ts *IntegrationTestSuite) TestScheduleDescribeSpecCron() {
// test spec
ts.Equal([]client.ScheduleCalendarSpec{
{
Second: []client.ScheduleRange{{}},
Minute: []client.ScheduleRange{{}},
Second: []client.ScheduleRange{{Start: 0, End: 0, Step: 1}},
Minute: []client.ScheduleRange{{Start: 0, End: 0, Step: 1}},
Hour: []client.ScheduleRange{{
Start: 12,
End: 12,
Step: 1,
}},
DayOfMonth: []client.ScheduleRange{
{
Start: 1,
End: 31,
Step: 1,
},
},
Month: []client.ScheduleRange{
{
Start: 1,
End: 12,
Step: 1,
},
},
Year: []client.ScheduleRange{},
DayOfWeek: []client.ScheduleRange{
{
Start: 1,
End: 1,
Step: 1,
},
},
},
Expand Down