Skip to content

Commit f332748

Browse files
authored
Schedules start workflows through frontend (#3935)
1 parent 7faf6f8 commit f332748

File tree

12 files changed

+264
-269
lines changed

12 files changed

+264
-269
lines changed

api/historyservice/v1/request_response.pb.go

+5-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/schedule/v1/message.pb.go

+79-213
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/util.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,10 @@ func FromConfigToDefaultRetrySettings(options map[string]interface{}) DefaultRet
560560
return defaultSettings
561561
}
562562

563-
// CreateHistoryStartWorkflowRequest create a start workflow request for history
563+
// CreateHistoryStartWorkflowRequest create a start workflow request for history.
564+
// Note: this mutates startRequest by unsetting the fields ContinuedFailure and
565+
// LastCompletionResult (these should only be set on workflows created by the scheduler
566+
// worker).
564567
func CreateHistoryStartWorkflowRequest(
565568
namespaceID string,
566569
startRequest *workflowservice.StartWorkflowExecutionRequest,
@@ -574,7 +577,11 @@ func CreateHistoryStartWorkflowRequest(
574577
Attempt: 1,
575578
ParentExecutionInfo: parentExecutionInfo,
576579
FirstWorkflowTaskBackoff: backoff.GetBackoffForNextScheduleNonNegative(startRequest.GetCronSchedule(), now, now),
580+
ContinuedFailure: startRequest.ContinuedFailure,
581+
LastCompletionResult: startRequest.LastCompletionResult,
577582
}
583+
startRequest.ContinuedFailure = nil
584+
startRequest.LastCompletionResult = nil
578585

579586
if timestamp.DurationValue(startRequest.GetWorkflowExecutionTimeout()) > 0 {
580587
deadline := now.Add(timestamp.DurationValue(startRequest.GetWorkflowExecutionTimeout()))

go.mod

+10-10
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ require (
4444
go.opentelemetry.io/otel/metric v0.34.0
4545
go.opentelemetry.io/otel/sdk v1.11.2
4646
go.opentelemetry.io/otel/sdk/metric v0.34.0
47-
go.temporal.io/api v1.16.0
47+
go.temporal.io/api v1.16.1-0.20230210062249-90fb5b4a7b41
4848
go.temporal.io/sdk v1.21.0
4949
go.temporal.io/version v0.3.0
5050
go.uber.org/atomic v1.10.0
5151
go.uber.org/fx v1.18.2
5252
go.uber.org/multierr v1.8.0
5353
go.uber.org/zap v1.24.0
5454
golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9
55-
golang.org/x/oauth2 v0.2.0
55+
golang.org/x/oauth2 v0.4.0
5656
golang.org/x/time v0.2.0
5757
google.golang.org/api v0.103.0
58-
google.golang.org/grpc v1.52.3
58+
google.golang.org/grpc v1.53.0
5959
google.golang.org/grpc/examples v0.0.0-20221201195934-736197138d20
6060
gopkg.in/square/go-jose.v2 v2.6.0
6161
gopkg.in/validator.v2 v2.0.1
@@ -65,15 +65,15 @@ require (
6565

6666
require (
6767
cloud.google.com/go v0.107.0 // indirect
68-
cloud.google.com/go/compute v1.13.0 // indirect
69-
cloud.google.com/go/compute/metadata v0.2.2 // indirect
68+
cloud.google.com/go/compute v1.15.1 // indirect
69+
cloud.google.com/go/compute/metadata v0.2.3 // indirect
7070
cloud.google.com/go/iam v0.8.0 // indirect
7171
github.com/apache/thrift v0.17.0 // indirect
7272
github.com/benbjohnson/clock v1.3.0 // indirect
7373
github.com/beorn7/perks v1.0.1 // indirect
7474
github.com/bitly/go-hostpool v0.1.0 // indirect
7575
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
76-
github.com/cespare/xxhash/v2 v2.1.2 // indirect
76+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
7777
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
7878
github.com/davecgh/go-spew v1.1.1 // indirect
7979
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
@@ -121,13 +121,13 @@ require (
121121
go.uber.org/dig v1.15.0 // indirect
122122
golang.org/x/crypto v0.3.0 // indirect
123123
golang.org/x/mod v0.7.0 // indirect
124-
golang.org/x/net v0.5.0 // indirect
125-
golang.org/x/sys v0.4.0 // indirect
126-
golang.org/x/text v0.6.0 // indirect
124+
golang.org/x/net v0.6.0 // indirect
125+
golang.org/x/sys v0.5.0 // indirect
126+
golang.org/x/text v0.7.0 // indirect
127127
golang.org/x/tools v0.3.0 // indirect
128128
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
129129
google.golang.org/appengine v1.6.7 // indirect
130-
google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa // indirect
130+
google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc // indirect
131131
google.golang.org/protobuf v1.28.1 // indirect
132132
gopkg.in/inf.v0 v0.9.1 // indirect
133133
lukechampine.com/uint128 v1.2.0 // indirect

0 commit comments

Comments
 (0)