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

Redo search attribute management apis #37

Open
wants to merge 5 commits into
base: abhinav/enums/identityEnums
Choose a base branch
from

Conversation

anekkanti
Copy link
Member

  • Deprecates the search attribute in the namespace resource.
  • Introduces new set of search attribute APIs.

@anekkanti anekkanti changed the base branch from main to abhinav/enums/identityEnums August 7, 2024 21:39
Comment on lines 179 to 180
STATE_ADDING= 1; // The region is being added to the namespace.
STATE_ACTIVE= 2; // The namespace is active in this region.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
STATE_ADDING= 1; // The region is being added to the namespace.
STATE_ACTIVE= 2; // The namespace is active in this region.
STATE_ADDING = 1; // The region is being added to the namespace.
STATE_ACTIVE = 2; // The namespace is active in this region.

STATE_FAILED = 3; // The operation failed, check failure_reason for more details.
STATE_CANCELLED = 4; // The operation was cancelled.
STATE_FULFILLED = 5; // The operation was fulfilled.
STATE_ADDING= 1; // The region is being added to the namespace.
Copy link
Member

Choose a reason for hiding this comment

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

The changes to this enum seem unrelated to the current PR, is it intentional?

// The type of the search attribute cannot be changed once set.
SearchAttributeType type = 2;

enum SearchAttributeType {
Copy link
Member

Choose a reason for hiding this comment

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

You are inconsistent with how you prefix your inner enums/types. You have SearchAttributeSpec.SearchAttributeType here and SearchAttribute.State below.

}

// Add a new search attribute to a namespace.
rpc AddSearchAttribute(AddSearchAttributeRequest) returns (AddSearchAttributeResponse) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
rpc AddSearchAttribute(AddSearchAttributeRequest) returns (AddSearchAttributeResponse) {
rpc AddSearchAttribute (AddSearchAttributeRequest) returns (AddSearchAttributeResponse) {

This spacing is inconsistent (throughout this file, I just haven't really mentioned it before)

string namespace = 1;
// The requested size of the page to retrieve - optional.
// Cannot exceed 1000. Defaults to 100.
int32 page_size = 2;
Copy link
Member

Choose a reason for hiding this comment

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

I understand the desire to match other pagination here, but I can't see a world where so many search attributes would come back where pagination would be needed. And then if we accept that you'll always get the full set of search attributes on every call, it is much easier on users if search attributes are a map.

Having said that, I am ok with this too, just wanted to bring it up.


enum State {
STATE_UNSPECIFIED = 0;
STATE_ADDING = 1; // The search attribute is being added.
Copy link
Member

Choose a reason for hiding this comment

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

Confirmed in descriptor that trailing comments on the same line are treated as comments for the item same as if they are above, but I think it's more consistent to always put comments for a construct above the construct.

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