Skip to content

Commit

Permalink
Add version check for JavaConsistentQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng authored Jun 10, 2021
1 parent 8143d55 commit e8cc575
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion common/client/versionChecker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
Expand Down Expand Up @@ -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)),
},
Expand Down
2 changes: 1 addition & 1 deletion common/client/versionChecker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (s *VersionCheckerSuite) TestSupportsConsistentQuery() {
},
{
clientImpl: JavaSDK,
clientFeatureVersion: "1.5.0",
clientFeatureVersion: "1.4.0",
expectErr: true,
},
{
Expand Down
2 changes: 1 addition & 1 deletion common/types/mapper/proto/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e8cc575

Please sign in to comment.