-
Notifications
You must be signed in to change notification settings - Fork 19
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
Don't use the same Filter for multiple messages (proto) #1053
Comments
Ah, it seems all the filter of the service were merged into a single one. Looks like we need distinct filter objects and then the question is: Is that worth it? Or would it be better just to have a common handling of the filter fields in the service implementation? |
We could also embed the filter type directly into the message like this: message ListResourcesRequest {
message Filter {
optional string type = 1;
optional string cloud_service_id = 2;
}
optional Filter filter = 1;
int32 page_size = 10;
string page_token = 11;
string order_by = 12;
bool asc = 13;
} although this creates a type called Probably renaming the type to message ListResourcesRequest {
optional ListResourcesFilter filter = 1;
int32 page_size = 10;
string page_token = 11;
string order_by = 12;
bool asc = 13;
}
message ListResourcesFilter {
optional string type = 1;
optional string cloud_service_id = 2;
} or |
I like more the upper one with the filter embedded in the message. |
Tricky question. I kinda dislike one filter for multiple requests. But, on the other side, if we have one such big filter and comment appropriately to which Requests they belong and also do the handling of these filters in the implementation (like you mentioned), it could work. Otherwise, I would prefer the embedded option in the case of single filters. |
We need to check, if the "new" approach (unique filter message in request) is used everywhere. |
clouditor/api/orchestrator/orchestrator.proto
Lines 468 to 477 in cf4cfd9
Here, the
Filter
is used for bothListAssessmentResultsRequest
andListAssessmentToolsRequest
. I guess the fields are not appropriate for both cases? In addition, the comments refer only to assessment results.The text was updated successfully, but these errors were encountered: