From e8cc575e80457eda5a367024ea309b36ad838b9e Mon Sep 17 00:00:00 2001 From: Quanzheng Long Date: Thu, 10 Jun 2021 10:35:49 -0700 Subject: [PATCH] Add version check for JavaConsistentQuery --- common/client/versionChecker.go | 5 ++++- common/client/versionChecker_test.go | 2 +- common/types/mapper/proto/api_test.go | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/client/versionChecker.go b/common/client/versionChecker.go index 739f056af29..6f0fd7736b2 100644 --- a/common/client/versionChecker.go +++ b/common/client/versionChecker.go @@ -45,7 +45,7 @@ const ( // SupportedGoSDKVersion indicates the highest go sdk version server will accept requests from SupportedGoSDKVersion = "1.7.0" // SupportedJavaSDKVersion indicates the highest java sdk version server will accept requests from - SupportedJavaSDKVersion = "1.4.0" + SupportedJavaSDKVersion = "1.5.0" // SupportedCLIVersion indicates the highest cli version server will accept requests from SupportedCLIVersion = "1.7.0" @@ -59,6 +59,8 @@ const ( GoWorkerConsistentQueryVersion = "1.5.0" // JavaWorkerRawHistoryQueryVersion indicates the minimum client version of the java worker which supports RawHistoryQuery JavaWorkerRawHistoryQueryVersion = "1.3.0" + // JavaWorkerConsistentQueryVersion indicates the minimum client version of the java worker which supports ConsistentQuery + JavaWorkerConsistentQueryVersion = "1.5.0" // GoWorkerRawHistoryQueryVersion indicates the minimum client version of the go worker which supports RawHistoryQuery GoWorkerRawHistoryQueryVersion = "1.6.0" // CLIRawHistoryQueryVersion indicates the minimum CLI version of the go worker which supports RawHistoryQuery @@ -161,6 +163,7 @@ func NewVersionChecker() VersionChecker { }, JavaSDK: { stickyQuery: mustNewConstraint(fmt.Sprintf(">=%v", JavaWorkerStickyQueryVersion)), + consistentQuery: mustNewConstraint(fmt.Sprintf(">=%v", JavaWorkerConsistentQueryVersion)), rawHistoryQuery: mustNewConstraint(fmt.Sprintf(">=%v", JavaWorkerRawHistoryQueryVersion)), workflowAlreadyCompletedError: mustNewConstraint(fmt.Sprintf(">=%v", JavaWorkflowAlreadyCompletedVersion)), }, diff --git a/common/client/versionChecker_test.go b/common/client/versionChecker_test.go index 483724c0539..d9fced85c2c 100644 --- a/common/client/versionChecker_test.go +++ b/common/client/versionChecker_test.go @@ -225,7 +225,7 @@ func (s *VersionCheckerSuite) TestSupportsConsistentQuery() { }, { clientImpl: JavaSDK, - clientFeatureVersion: "1.5.0", + clientFeatureVersion: "1.4.0", expectErr: true, }, { diff --git a/common/types/mapper/proto/api_test.go b/common/types/mapper/proto/api_test.go index c52abdbd36d..07d78b17a3b 100644 --- a/common/types/mapper/proto/api_test.go +++ b/common/types/mapper/proto/api_test.go @@ -769,7 +769,7 @@ func TestParentExecutionInfo(t *testing.T) { } func TestParentExecutionInfoFields(t *testing.T) { assert.Nil(t, FromParentExecutionInfoFields(nil, nil, nil, nil)) - assert.Panics(t, func() { FromParentExecutionInfoFields(nil, &testdata.ParentExecutionInfo.Domain, nil, nil)} ) + assert.Panics(t, func() { FromParentExecutionInfoFields(nil, &testdata.ParentExecutionInfo.Domain, nil, nil) }) info := FromParentExecutionInfoFields(nil, &testdata.ParentExecutionInfo.Domain, testdata.ParentExecutionInfo.Execution,