-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added minor adjustments in the shadow status options #1359
base: master
Are you sure you want to change the base?
Changes from 1 commit
164508f
3f2c2fc
41c8e3e
aec2f51
75c4f1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -338,10 +338,9 @@ func (o *ShadowOptions) validateAndPopulateFields() error { | |
} | ||
statuses = append(statuses, status) | ||
} | ||
//All the open statuses are taken by default. This list seems to not work as expected. | ||
//TODO: verify that the status list works as expected. currently all wfs of all types get picked up. | ||
//This filter doesn't seem to be working as expected. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please elaborate in the comment what you mean There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This filter should have only taken open and closed wfs but it returns continue as new wfs as well. not sure if this is because of some other check somewhere or the query gets formed incorrectly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please elaborate on this in the comment so it will be easier to identify the problem. |
||
if len(statuses) == 0 { | ||
statuses = []WorkflowStatus{WorkflowStatusOpen} | ||
statuses = []WorkflowStatus{WorkflowStatusOpen, WorkflowStatusClosed} | ||
} | ||
queryBuilder.WorkflowStatus(statuses) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess modern DBs with good query analyzers will just drop this expression, but evaluation of this does not make any sense.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will incorporate this and update PR. Okay! so there's some other bug somewhere in there which created strange behavour in the filter so leaving the above as it is. I will be scrapping this piece anyway. I need this diff as an interim fix so that I ca continue working on the qb update without interrupting the customers. |
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -203,7 +203,7 @@ func (s *workflowShadowerSuite) TestShadowOptionsValidation() { | |
options: ShadowOptions{}, | ||
expectErr: false, | ||
validationFn: func(options *ShadowOptions) { | ||
s.Equal("(CloseTime = missing)", options.WorkflowQuery) | ||
s.Equal("(CloseTime = missing or CloseTime != missing)", options.WorkflowQuery) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is not this equivalent to empty query? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is but the query builder forms it this way because of open and closed statuses getting added together in the test. This portion of default status check needs a rewrite that I will be doing as a part of the shadower fix initiative. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we do have an ALL status filter somewhere but it barely gets used. Now the problem with that one is that it picks up everything present in that defaut list of statuses. |
||
s.Equal(1.0, options.SamplingRate) | ||
s.Equal(1, options.Concurrency) | ||
}, | ||
|
@@ -255,7 +255,7 @@ func (s *workflowShadowerSuite) TestShadowOptionsWithExcludeTypes() { | |
Mode: ShadowModeNormal, | ||
} | ||
expectedQuery := fmt.Sprintf( | ||
`(WorkflowType = "includedType1" or WorkflowType = "includedType2") and (WorkflowType != "excludedType1" and WorkflowType != "excludedType2") and (CloseTime = missing)`, | ||
`(WorkflowType = "includedType1" or WorkflowType = "includedType2") and (WorkflowType != "excludedType1" and WorkflowType != "excludedType2") and (CloseTime = missing or CloseTime != missing)`, | ||
) | ||
shadower, err := NewWorkflowShadower(s.mockService, "testDomain", options, ReplayOptions{}, nil) | ||
s.NoError(err) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can still leave it here in the mapping function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will readd it later. removed it to be sure that the status can not be used in any situation at all.