-
Notifications
You must be signed in to change notification settings - Fork 911
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
Remove unnecessary aliasing/unaliasing of scheduled workflow search attributes #3943
Conversation
if err != nil { | ||
return err | ||
} | ||
if err := wh.validateSearchAttributes(unaliasedStartWorkflowSas, namespaceName); err != nil { |
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 actually don't like bellow lint message. I always do explicit error return. Because what it suggests looks like the function returns results of another 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.
Yeah, this contradicts the standard Go style of having the error path exit early and the happy path flow to the end of the function. Sometimes for short functions I might return a call directly but if there are other error returns I agree the last one should also be an error return for consistency
@@ -3164,22 +3170,6 @@ func (wh *WorkflowHandler) DescribeSchedule(ctx context.Context, request *workfl | |||
return err | |||
} | |||
|
|||
// map action search attributes |
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.
maybe just replace with a comment like
// Search attributes in the Action are already in external ("aliased") form. Do not alias them here.
@@ -3070,7 +3071,12 @@ func (wh *WorkflowHandler) validateStartWorkflowArgsForSchedule( | |||
return errIDReusePolicyNotAllowed | |||
} | |||
|
|||
if err := wh.validateSearchAttributes(startWorkflow.GetSearchAttributes(), namespaceName); err != nil { | |||
// Unalias startWorkflow search attributes only for validation. Keep aliases in request. |
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.
// Unalias startWorkflow search attributes only for validation. Keep aliases in request. | |
// Unalias startWorkflow search attributes only for validation. Keep aliases in the request, because the request will be sent back to frontend to start workflows, which will unalias at that point. |
What changed?
Remove unnecessary aliasing/unaliasing of scheduled workflow search attributes.
Why?
They are getting unaliases when workflow is actually started.
How did you test it?
Functional tests over sqlite.
Potential risks
No risks.
Is hotfix candidate?
No.