Skip to content
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

Change search attribute validator to expect field names instead of alias #3398

Merged
merged 3 commits into from
Sep 16, 2022

Conversation

rodrigozhou
Copy link
Contributor

@rodrigozhou rodrigozhou commented Sep 16, 2022

What changed?
Changed search attribute validator to expect the map to contain field names instead of alias.

Changed error type in ValidateSize to serviceerror.InvalidArgument so it can go through gRPC correctly.

Fixed the validation for upsert search attribute as it was merging a map with field names with a map with alias names.

Why?
ValidateSize should be for field names instead of alias since field names are the values to be stored. In order to be consistent, Validate was also changed to expect the same input.

How did you test it?
Updated unit tests.

Potential risks
Small search attribute alias might increase in size as being mapped to field name, and fail the size validation.

Is hotfix candidate?
No.

@rodrigozhou rodrigozhou requested a review from a team as a code owner September 16, 2022 02:24
common/searchattribute/validator.go Outdated Show resolved Hide resolved
common/searchattribute/validator.go Outdated Show resolved Hide resolved
common/searchattribute/validator.go Outdated Show resolved Hide resolved
@rodrigozhou rodrigozhou merged commit de91ae4 into temporalio:master Sep 16, 2022
@rodrigozhou rodrigozhou deleted the sa-validator-field-name branch September 16, 2022 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants