From 188a7ec84648c49e7277b5d26f471bc80c13e675 Mon Sep 17 00:00:00 2001 From: Roey Berman Date: Thu, 25 May 2023 17:32:32 -0700 Subject: [PATCH] Update API and SDK to latest master (#4402) Note: This commit came from a feature branch and is not expected to build. --- go.mod | 2 +- go.sum | 3 ++- tests/advanced_visibility_test.go | 13 +++++-------- tests/versioning_test.go | 20 ++++---------------- 4 files changed, 12 insertions(+), 26 deletions(-) diff --git a/go.mod b/go.mod index a439cc0b3a7..b9cab53f811 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 0642de53ce4..c92b13cbed5 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/tests/advanced_visibility_test.go b/tests/advanced_visibility_test.go index 7c58b859d3f..0a344c9f36e 100644 --- a/tests/advanced_visibility_test.go +++ b/tests/advanced_visibility_test.go @@ -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 } @@ -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 diff --git a/tests/versioning_test.go b/tests/versioning_test.go index 95b933b957a..6550a0219fa 100644 --- a/tests/versioning_test.go +++ b/tests/versioning_test.go @@ -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)) @@ -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)) @@ -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: @@ -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 @@ -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)