Skip to content

Commit

Permalink
Schedules start workflows through frontend (#3935)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnr authored Feb 10, 2023
1 parent 7faf6f8 commit f332748
Show file tree
Hide file tree
Showing 12 changed files with 264 additions and 269 deletions.
8 changes: 5 additions & 3 deletions api/historyservice/v1/request_response.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

292 changes: 79 additions & 213 deletions api/schedule/v1/message.pb.go

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion common/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,10 @@ func FromConfigToDefaultRetrySettings(options map[string]interface{}) DefaultRet
return defaultSettings
}

// CreateHistoryStartWorkflowRequest create a start workflow request for history
// CreateHistoryStartWorkflowRequest create a start workflow request for history.
// Note: this mutates startRequest by unsetting the fields ContinuedFailure and
// LastCompletionResult (these should only be set on workflows created by the scheduler
// worker).
func CreateHistoryStartWorkflowRequest(
namespaceID string,
startRequest *workflowservice.StartWorkflowExecutionRequest,
Expand All @@ -574,7 +577,11 @@ func CreateHistoryStartWorkflowRequest(
Attempt: 1,
ParentExecutionInfo: parentExecutionInfo,
FirstWorkflowTaskBackoff: backoff.GetBackoffForNextScheduleNonNegative(startRequest.GetCronSchedule(), now, now),
ContinuedFailure: startRequest.ContinuedFailure,
LastCompletionResult: startRequest.LastCompletionResult,
}
startRequest.ContinuedFailure = nil
startRequest.LastCompletionResult = nil

if timestamp.DurationValue(startRequest.GetWorkflowExecutionTimeout()) > 0 {
deadline := now.Add(timestamp.DurationValue(startRequest.GetWorkflowExecutionTimeout()))
Expand Down
20 changes: 10 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ require (
go.opentelemetry.io/otel/metric v0.34.0
go.opentelemetry.io/otel/sdk v1.11.2
go.opentelemetry.io/otel/sdk/metric v0.34.0
go.temporal.io/api v1.16.0
go.temporal.io/api v1.16.1-0.20230210062249-90fb5b4a7b41
go.temporal.io/sdk v1.21.0
go.temporal.io/version v0.3.0
go.uber.org/atomic v1.10.0
go.uber.org/fx v1.18.2
go.uber.org/multierr v1.8.0
go.uber.org/zap v1.24.0
golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9
golang.org/x/oauth2 v0.2.0
golang.org/x/oauth2 v0.4.0
golang.org/x/time v0.2.0
google.golang.org/api v0.103.0
google.golang.org/grpc v1.52.3
google.golang.org/grpc v1.53.0
google.golang.org/grpc/examples v0.0.0-20221201195934-736197138d20
gopkg.in/square/go-jose.v2 v2.6.0
gopkg.in/validator.v2 v2.0.1
Expand All @@ -65,15 +65,15 @@ require (

require (
cloud.google.com/go v0.107.0 // indirect
cloud.google.com/go/compute v1.13.0 // indirect
cloud.google.com/go/compute/metadata v0.2.2 // indirect
cloud.google.com/go/compute v1.15.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.8.0 // indirect
github.com/apache/thrift v0.17.0 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bitly/go-hostpool v0.1.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
Expand Down Expand Up @@ -121,13 +121,13 @@ require (
go.uber.org/dig v1.15.0 // indirect
golang.org/x/crypto v0.3.0 // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
golang.org/x/net v0.6.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/tools v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa // indirect
google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
lukechampine.com/uint128 v1.2.0 // indirect
Expand Down
Loading

0 comments on commit f332748

Please sign in to comment.