-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: add siren proto with validation #27
Conversation
odpf/siren/siren.proto
Outdated
string updated_at = 8; | ||
} | ||
|
||
message Annotations { |
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.
Lets use singular word for object/message name?
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.
Actually, each key inside this message is an "Annotation". So that's why it makes more sense to call it plural.
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.
@rahmatrhd Changed Alerts to Alert
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.
LGTM
4c64b1e
to
5723a55
Compare
odpf/siren/v1/siren.proto
Outdated
string namespace = 4 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; | ||
string group_name = 5 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; | ||
string template = 6 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; | ||
string status = 7 [(validate.rules).string = {in: ["enabled", "disabled"]}]; |
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.
Can we can convert status field to enum?
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.
Not doing this because downstream service accepts strings
in order to implement this we need to put unnecessary type conversion in the middle which I would like to avoid.
odpf/siren/v1/siren.proto
Outdated
string entity = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; | ||
string message = 3; | ||
string receiver_name = 4 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"]; | ||
string receiver_type = 5 [(validate.rules).string = {in: ["channel", "user"]}];; |
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.
here also, can we make reciever_type as enum? wdyt?
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.
Not doing this too, First, we will need to find a solution for Enum proto to pass case insensitive
string.
e5f53ab
to
968ce0e
Compare
33ccc3e
to
75a4cf4
Compare
…ange code, alert credentials api
Co-authored-by: Abhishek <abhi.sah.97@gmail.com>
Co-authored-by: Abhishek <abhi.sah.97@gmail.com>
Co-authored-by: Abhishek <abhi.sah.97@gmail.com>
Co-authored-by: Abhishek <abhi.sah.97@gmail.com>
Co-authored-by: Abhishek <abhi.sah.97@gmail.com>
Co-authored-by: Abhishek <abhi.sah.97@gmail.com>
Added all proto required to generate GRPC code for siren