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

Fix namespace interceptor to allow search attributes operations #3899

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

rodrigozhou
Copy link
Contributor

What changed?
Let search attributes operations requests to pass without namespace set in the namespace interceptor.

Why?
Namespace interceptor validates the namespace argument of all requests if present.
However, this argument is optional for search attributes operations.

How did you test it?
Start server, and run tctl operations for search attributes no longer returns error "Namespace not set on request".

Potential risks
None.

Is hotfix candidate?
No.

@rodrigozhou rodrigozhou requested a review from a team as a code owner February 3, 2023 18:24
Comment on lines +212 to +220
string namespace = 3;
}

message RemoveSearchAttributesResponse {
}

message GetSearchAttributesRequest {
string index_name = 1;
string namespace = 4;
string namespace = 2;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a fix in the arguments numbers. These are new arguments, and were not updated in tctl or cli yet. It should be safe.

*operatorservice.ListSearchAttributesRequest:
// Namespace is optional for search attributes operations.
// It's required when using SQL DB for visibility, but not when using Elasticsearch.
if !namespaceName.IsEmpty() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Spikhalskiy
Copy link
Contributor

Should here be a unit test fixing the behavior?

Copy link
Contributor

@mindaugasrukas mindaugasrukas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rodrigozhou
Copy link
Contributor Author

@Spikhalskiy Added unit tests.

@rodrigozhou rodrigozhou merged commit e95e082 into temporalio:master Feb 3, 2023
@rodrigozhou rodrigozhou deleted the fix-ns-interceptor branch February 3, 2023 21:58
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.

3 participants