-
Notifications
You must be signed in to change notification settings - Fork 0
Add buf-plugin-required-fields plugin
#2
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
Conversation
|
@Robert-Stam @mikheillomidzeq executing it against the current public api, I get these linting issues: There are three options:
|
Add a plugin that checks that: - entity-related messages (e.g: Cluster) define a known set of common fields for the Qdrant Cloud API: `[id, name, account_id, created_at]`. - Request messages (e.g: ListClusters) define a known set of common fields for the Qdrant Cloud API: `[account_id]`.
8488e4b to
092c8ef
Compare
Robert-Stam
left a comment
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.
Small comments, further LGTM.
what about adding an annotation (extension) to proto which we can use to 'override' the default names per message, we we can configure the linter if we like?
We could do that. Another option if we don't want to clutter the proto definitions is to enable that kind of configuration using the plugins option. Could be something like (for some reason they don't support a map and we would need a little hack using I think for the current linting issues we have we could just add a comment in the proto file to ignore them and in the future we can implement one of the two options (proto extension or plugin config). Example ignoring linting in proto definition: |
Fine with |
| // Package main implements a plugin that checks that: | ||
| // - entity-related messages (e.g: Cluster) define a known set of common fields | ||
| // for the Qdrant Cloud API. Default values: id, name, account_id, created_at | ||
| // - Request messages (e.g: ListClusters) define a known set of common fields |
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.
ListClusters --> ListClustersRequest
Robert-Stam
left a comment
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.
one remark, further LGTM
Add a plugin that checks that:
[id, name, account_id, created_at].[account_id].The list of entity required fields can be configured using the plugin options.