-
Notifications
You must be signed in to change notification settings - Fork 406
Add GetComponentListRequest endpoint. #2011
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
base: master
Are you sure you want to change the base?
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf CI / validate (pull_request).
|
2d51d39 to
fe09e05
Compare
| // JSON string containing the lists of available components. | ||
| string components_json = 1; |
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.
How much more information can we infer here from the proto, is it just a stringifed JSON? Can it be a more specific map of processors, inputs, outputs and other component types?
We are going to be using protovalidate in the future and this would be a great addition
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.
I can return a more structured response if that's helpful
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.
@eblairmckee let us know what else you need, to make your life on the UI easier, I think having better types coming back from frontend will mean you have less heavy lifting/transformations to do.
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.
updated the return schema, does it look ok?
| message GetComponentListRequest { | ||
| // Regex pattern to filter component types. | ||
| // Examples: "inputs|outputs", "processors", ".*" (for all) | ||
| string component_type_regex = 1; |
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.
i suggest to follow the existing pattern for filters: putting into a filter struct: https://github.com/redpanda-data/console/blob/master/proto/redpanda/api/dataplane/v1/topic.proto#L120
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.
I added read_mask, it covers per-component filtering as well
| string component_type_regex = 1; | ||
|
|
||
| // List of component fields to skip in the response. | ||
| repeated string skip_fields = 2; |
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.
this sounds like a read_mask, https://github.com/redpanda-data/cloudv2/blob/main/proto/descriptors/redpanda/iam/v1/user_service.proto#L125
you can then use our fieldmask library in pkg to strip fields not covered by read mask
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.
the idea here was to allow to skip examples which weight a lot. The config can be nested, I think we are not able to build fieldmask to filter it on all levels, e.g. (don't have examples here but we can look at description):
{
"components": {
"inputs": [
{
"name": "amqp_0_9",
"type": "input",
"status": "stable",
"summary": "Connects to an AMQP (0.91) queue. AMQP is a messaging protocol used by various message brokers, including RabbitMQ.",
"description": "xxx",
"categories": [
"Services"
],
"config": {
"type": "object",
"kind": "scalar",
"children": [
{
"name": "urls",
"type": "string",
"kind": "array",
"description": "A list of URLs to connect to. The first URL to successfully establish a connection will be used until the connection is closed. If an item of the list contains commas it will be expanded into multiple URLs.",
"version": "3.58.0"
},
{
"name": "queue",
"type": "string",
"kind": "scalar",
"description": "An AMQP queue to consume from."
},
{
"name": "queue_declare",
"type": "object",
"kind": "scalar",
"description": "Allows you to passively declare the target queue. If the queue already exists then the declaration passively verifies that they match the target fields.",
"children": [
{
"name": "enabled",
"type": "bool",
"kind": "scalar",
"description": "Whether to enable queue declaration."
},
...
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.
it doesn't look right:
["inputs.name", "inputs.type", "inputs.kind",
"inputs.config.name", "inputs.config.type", "inputs.config.kind",
"inputs.config.children.name", "inputs.config.children.type", "inputs.config.children.kind",
"inputs.config.children.children.name", "inputs.config.children.children.type", "inputs.config.children.children.kind",
...]
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.
I checked the examples actually does not weight so much, so I don't think we need to complicate here. Still users can use read_mask
|
i like the direction, to have a rich grpc api instead of the YAML. it will make this much easier to consume. |
| message BloblangMethodSpec { | ||
| string name = 1; | ||
| string description = 2; | ||
| string status = 3; |
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.
Shouldn't this be an enum instead of a string?
| // ComponentList contains the structured component data. | ||
| message ComponentList { | ||
| string version = 1; | ||
| string date = 2; |
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.
shouldn't this be a Timestamp? or is it just stringified date
| } | ||
|
|
||
| // GetComponentList returns a JSON containing lists of allowed components based on component type filter. | ||
| rpc GetComponentList(GetComponentListRequest) returns (GetComponentListResponse) { |
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.
[nit] I think ListComponents would be better? Usually we reserve Get prefix for obtaining 1 item
|
|
||
| // ComponentList contains the structured component data. | ||
| message ComponentList { | ||
| string version = 1; |
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.
Is there any extra validation that could be set at the proto level? For example I imagine this would be a semver regex
| string default_value = 8; | ||
| repeated string examples = 9; | ||
| repeated FieldSpec children = 10; | ||
| map<string, string> annotated_options = 11; |
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.
[question] Is this just a metadata with any arbitrary key value items?
| } | ||
|
|
||
| // FieldSpec represents a field specification. | ||
| message FieldSpec { |
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 confirm this includes all fields requested, thank you!
|
I am a bit out of loop and have a couple questions: How is the frontend going to work with that information @eblairmckee & @malinskibeniamin ? Eventually we need to translate this back into RPCN pipelines / yaml config. Where does this translation happen? |
No description provided.