Skip to content

Conversation

@tomasz-sadura
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

The latest Buf updates on your PR. Results from workflow Buf CI / validate (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedNov 6, 2025, 3:08 PM

@tomasz-sadura tomasz-sadura force-pushed the ts/add-get-component-list-endpoint branch from 2d51d39 to fe09e05 Compare November 3, 2025 11:45
@tomasz-sadura tomasz-sadura marked this pull request as ready for review November 3, 2025 16:04
Comment on lines 685 to 686
// JSON string containing the lists of available components.
string components_json = 1;
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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

Copy link
Contributor Author

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;
Copy link
Contributor

@birdayz birdayz Nov 5, 2025

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

https://google.aip.dev/157

you can then use our fieldmask library in pkg to strip fields not covered by read mask

Copy link
Contributor Author

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."
                },
...

Copy link
Contributor Author

@tomasz-sadura tomasz-sadura Nov 5, 2025

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", 
...]

Copy link
Contributor Author

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

@birdayz birdayz requested review from Jeffail and weeco November 5, 2025 10:07
@birdayz
Copy link
Contributor

birdayz commented Nov 5, 2025

i like the direction, to have a rich grpc api instead of the YAML. it will make this much easier to consume.
@Jeffail i would like to get your buy-in to this approach, does the approach make sense to you?

@tomasz-sadura tomasz-sadura requested a review from birdayz November 6, 2025 16:56
message BloblangMethodSpec {
string name = 1;
string description = 2;
string status = 3;
Copy link
Contributor

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;
Copy link
Contributor

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) {
Copy link
Contributor

@malinskibeniamin malinskibeniamin Nov 11, 2025

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;
Copy link
Contributor

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;
Copy link
Contributor

@malinskibeniamin malinskibeniamin Nov 11, 2025

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 {
Copy link
Contributor

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!

@weeco
Copy link
Contributor

weeco commented Nov 12, 2025

I am a bit out of loop and have a couple questions:
@tomasz-sadura Is this just an API proposal or where does the translation happen between the RPCN schema and proto? Is this going to happen with protojson somehow semi automatically? Also wondering how we can ensure that new RPCN schema changes will be supported so that we don't necessarily have to update the proto specs and remain somewhat decoupled from the RPCN versioning.

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?

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.

6 participants