Skip to content

Commit

Permalink
Update API and SDK to latest master (#4402)
Browse files Browse the repository at this point in the history
Note: This commit came from a feature branch and is not expected to build.
  • Loading branch information
bergundy authored and dnr committed May 26, 2023
1 parent 209e250 commit 188a7ec
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 26 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -130,7 +130,7 @@ require (
golang.org/x/tools v0.7.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-20230410155749-daa745c078e1 // indirect
google.golang.org/genproto v0.0.0-20230525154841-bd750badd5c6 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
lukechampine.com/uint128 v1.2.0 // indirect
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Expand Up @@ -1737,8 +1737,9 @@ google.golang.org/genproto v0.0.0-20230322174352-cde4c949918d/go.mod h1:NWraEVix
google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak=
google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak=
google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak=
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
google.golang.org/genproto v0.0.0-20230525154841-bd750badd5c6 h1:62QuyPXKEkZpjZesyj5K5jABl6MnSnWl+vNuT5oz90E=
google.golang.org/genproto v0.0.0-20230525154841-bd750badd5c6/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
Expand Down
13 changes: 5 additions & 8 deletions tests/advanced_visibility_test.go
Expand Up @@ -1982,12 +1982,12 @@ func (s *advancedVisibilitySuite) Test_BuildIdIndexedOnCompletion_VersionedWorke
workflow.GetSignalChannel(ctx, "continue").Receive(ctx, nil)

// Start compatible child
c1Ctx := workflow.WithChildOptions(ctx, workflow.ChildWorkflowOptions{WorkflowID: childId1, TaskQueue: taskQueue, VersioningIntent: worker.CompatibleVersion})
c1Ctx := workflow.WithChildOptions(ctx, workflow.ChildWorkflowOptions{WorkflowID: childId1, TaskQueue: taskQueue, VersioningIntent: temporal.VersioningIntentCompatible})
if err := workflow.ExecuteChildWorkflow(c1Ctx, "doesnt-exist").GetChildWorkflowExecution().Get(ctx, nil); err != nil {
return err
}
// Start latest child
c2Ctx := workflow.WithChildOptions(ctx, workflow.ChildWorkflowOptions{WorkflowID: childId2, TaskQueue: taskQueue, VersioningIntent: worker.UseDefaultVersion})
// Start default child
c2Ctx := workflow.WithChildOptions(ctx, workflow.ChildWorkflowOptions{WorkflowID: childId2, TaskQueue: taskQueue, VersioningIntent: temporal.VersioningIntentDefault})
if err := workflow.ExecuteChildWorkflow(c2Ctx, "doesnt-exist").GetChildWorkflowExecution().Get(ctx, nil); err != nil {
return err
}
Expand All @@ -1998,12 +1998,9 @@ func (s *advancedVisibilitySuite) Test_BuildIdIndexedOnCompletion_VersionedWorke
startedCh <- info.WorkflowExecution.RunID
}
workflow.GetSignalChannel(ctx, "continue").Receive(ctx, nil)
// TODO: shouldn't be WithChildOptions
useLatestCtx := workflow.WithChildOptions(ctx, workflow.ChildWorkflowOptions{
VersioningIntent: worker.UseDefaultVersion,
})
useDefault := workflow.WithWorkflowVersioningIntent(ctx, temporal.VersioningIntentDefault)
// Finally continue-as-new to latest
return workflow.NewContinueAsNewError(useLatestCtx, "doesnt-exist")
return workflow.NewContinueAsNewError(useDefault, "doesnt-exist")
}

// Declare v1
Expand Down
20 changes: 4 additions & 16 deletions tests/versioning_test.go
Expand Up @@ -477,12 +477,12 @@ func (s *versioningIntegSuite) dispatchActivity() {
fut1 := workflow.ExecuteActivity(workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
ScheduleToCloseTimeout: time.Minute,
DisableEagerExecution: true,
VersioningIntent: worker.CompatibleVersion,
VersioningIntent: temporal.VersioningIntentCompatible,
}), "act")
fut2 := workflow.ExecuteActivity(workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
ScheduleToCloseTimeout: time.Minute,
DisableEagerExecution: true,
VersioningIntent: worker.UseDefaultVersion, // this one should go to latest
VersioningIntent: temporal.VersioningIntentDefault, // this one should go to default
}), "act")
var val1, val2 string
s.NoError(fut1.Get(ctx, &val1))
Expand Down Expand Up @@ -558,7 +558,7 @@ func (s *versioningIntegSuite) dispatchChildWorkflow() {
// run two child workflows
fut1 := workflow.ExecuteChildWorkflow(workflow.WithChildOptions(ctx, workflow.ChildWorkflowOptions{}), "child")
fut2 := workflow.ExecuteChildWorkflow(workflow.WithChildOptions(ctx, workflow.ChildWorkflowOptions{
VersioningIntent: worker.UseDefaultVersion, // this one should go to latest
VersioningIntent: temporal.VersioningIntentDefault, // this one should go to default
}), "child")
var val1, val2 string
s.NoError(fut1.Get(ctx, &val1))
Expand Down Expand Up @@ -626,11 +626,6 @@ func (s *versioningIntegSuite) dispatchContinueAsNew() {
wf1 := func(ctx workflow.Context, attempt int) (string, error) {
started1 <- struct{}{}
workflow.GetSignalChannel(ctx, "wait").Receive(ctx, nil)
// TODO: shouldn't be WithChildOptions
newCtx := workflow.WithChildOptions(ctx, workflow.ChildWorkflowOptions{
VersioningIntent: worker.UseDefaultVersion, // this one should go to latest
})
_ = newCtx
switch attempt {
case 0:
// TODO: after fixing stickiness, comment this out:
Expand All @@ -645,15 +640,12 @@ func (s *versioningIntegSuite) dispatchContinueAsNew() {
wf11 := func(ctx workflow.Context, attempt int) (string, error) {
started11 <- struct{}{}
workflow.GetSignalChannel(ctx, "wait").Receive(ctx, nil)
newCtx := workflow.WithChildOptions(ctx, workflow.ChildWorkflowOptions{
VersioningIntent: worker.UseDefaultVersion,
})
_ = newCtx
switch attempt {
case 0:
// TODO: after fixing stickiness, uncomment this:
// return "", workflow.NewContinueAsNewError(ctx, "wf", attempt+1)
case 1:
newCtx := workflow.WithWorkflowVersioningIntent(ctx, temporal.VersioningIntentDefault) // this one should go to default
return "", workflow.NewContinueAsNewError(newCtx, "wf", attempt+1)
case 2:
// return "done!", nil
Expand All @@ -663,10 +655,6 @@ func (s *versioningIntegSuite) dispatchContinueAsNew() {
wf2 := func(ctx workflow.Context, attempt int) (string, error) {
started2 <- struct{}{}
workflow.GetSignalChannel(ctx, "wait").Receive(ctx, nil)
newCtx := workflow.WithChildOptions(ctx, workflow.ChildWorkflowOptions{
VersioningIntent: worker.UseDefaultVersion,
})
_ = newCtx
switch attempt {
case 0:
// return "",workflow.NewContinueAsNewError(ctx, "wf", attempt+1)
Expand Down

0 comments on commit 188a7ec

Please sign in to comment.