Skip to content

Commit dc279b1

Browse files
authored
backend: add tags support to pipelines (#1657)
1 parent 1778d91 commit dc279b1

File tree

6 files changed

+722
-550
lines changed

6 files changed

+722
-550
lines changed

backend/pkg/protogen/redpanda/api/dataplane/v1/pipeline.pb.go

+634-547
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/pkg/protogen/redpanda/api/dataplane/v1/pipeline.pb.gw.go

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src/protogen/redpanda/api/dataplane/v1/pipeline_pb.ts

+36-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// @ts-nocheck
55

66
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
7-
import { Message, proto3 } from "@bufbuild/protobuf";
7+
import { FieldMask, Message, proto3 } from "@bufbuild/protobuf";
88

99
/**
1010
* Defines the pipeline resource.
@@ -68,6 +68,14 @@ export class Pipeline extends Message<Pipeline> {
6868
*/
6969
url = "";
7070

71+
/**
72+
* Tags are key-value pairs that can be assigned to a pipeline resource.
73+
* They help organize pipelines and enable filtering when listing them.
74+
*
75+
* @generated from field: map<string, string> tags = 11;
76+
*/
77+
tags: { [key: string]: string } = {};
78+
7179
constructor(data?: PartialMessage<Pipeline>) {
7280
super();
7381
proto3.util.initPartial(data, this);
@@ -84,6 +92,7 @@ export class Pipeline extends Message<Pipeline> {
8492
{ no: 7, name: "state", kind: "enum", T: proto3.getEnumType(Pipeline_State) },
8593
{ no: 8, name: "status", kind: "message", T: Pipeline_Status },
8694
{ no: 10, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */ },
95+
{ no: 11, name: "tags", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} },
8796
]);
8897

8998
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Pipeline {
@@ -553,6 +562,13 @@ export class ListPipelinesRequest_Filter extends Message<ListPipelinesRequest_Fi
553562
*/
554563
nameContains = "";
555564

565+
/**
566+
* Filter pipelines that contain all of these key/value pairs.
567+
*
568+
* @generated from field: map<string, string> tags = 2;
569+
*/
570+
tags: { [key: string]: string } = {};
571+
556572
constructor(data?: PartialMessage<ListPipelinesRequest_Filter>) {
557573
super();
558574
proto3.util.initPartial(data, this);
@@ -562,6 +578,7 @@ export class ListPipelinesRequest_Filter extends Message<ListPipelinesRequest_Fi
562578
static readonly typeName = "redpanda.api.dataplane.v1.ListPipelinesRequest.Filter";
563579
static readonly fields: FieldList = proto3.util.newFieldList(() => [
564580
{ no: 1, name: "name_contains", kind: "scalar", T: 9 /* ScalarType.STRING */ },
581+
{ no: 2, name: "tags", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} },
565582
]);
566583

567584
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ListPipelinesRequest_Filter {
@@ -656,6 +673,14 @@ export class PipelineUpdate extends Message<PipelineUpdate> {
656673
*/
657674
resources?: Pipeline_Resources;
658675

676+
/**
677+
* A map of tags to add, update or delete.
678+
* If a tag's value is empty, the server interprets that as a deletion.
679+
*
680+
* @generated from field: map<string, string> tags = 7;
681+
*/
682+
tags: { [key: string]: string } = {};
683+
659684
constructor(data?: PartialMessage<PipelineUpdate>) {
660685
super();
661686
proto3.util.initPartial(data, this);
@@ -668,6 +693,7 @@ export class PipelineUpdate extends Message<PipelineUpdate> {
668693
{ no: 2, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ },
669694
{ no: 3, name: "config_yaml", kind: "scalar", T: 9 /* ScalarType.STRING */ },
670695
{ no: 6, name: "resources", kind: "message", T: Pipeline_Resources },
696+
{ no: 7, name: "tags", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} },
671697
]);
672698

673699
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): PipelineUpdate {
@@ -703,6 +729,14 @@ export class UpdatePipelineRequest extends Message<UpdatePipelineRequest> {
703729
*/
704730
pipeline?: PipelineUpdate;
705731

732+
/**
733+
* Specifies which fields should be updated. If not provided,
734+
* all fields will be updated.
735+
*
736+
* @generated from field: google.protobuf.FieldMask update_mask = 3;
737+
*/
738+
updateMask?: FieldMask;
739+
706740
constructor(data?: PartialMessage<UpdatePipelineRequest>) {
707741
super();
708742
proto3.util.initPartial(data, this);
@@ -713,6 +747,7 @@ export class UpdatePipelineRequest extends Message<UpdatePipelineRequest> {
713747
static readonly fields: FieldList = proto3.util.newFieldList(() => [
714748
{ no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
715749
{ no: 2, name: "pipeline", kind: "message", T: PipelineUpdate },
750+
{ no: 3, name: "update_mask", kind: "message", T: FieldMask },
716751
]);
717752

718753
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): UpdatePipelineRequest {

proto/gen/openapi/openapi.json

+1-1
Large diffs are not rendered by default.

proto/gen/openapi/openapi.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4259,7 +4259,7 @@ paths:
42594259
content:
42604260
multipart/form-data:
42614261
schema:
4262-
example: '{"name":"redact-orders", "input_topic_name":"orders", "output_topic_names":["orders-redacted"], "environment_variables":[{"key":"LOGGER_LEVEL", "value":"DEBUG"}]}'
4262+
example: '{"name":"redact-orders","input_topic_name":"orders","output_topic_names":["orders-redacted"],"environment_variables":[{"key":"LOGGER_LEVEL","value":"DEBUG"}]}'
42634263
properties:
42644264
metadata:
42654265
$ref: '#/components/schemas/DeployTransformRequest'

proto/redpanda/api/dataplane/v1/pipeline.proto

+32
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package redpanda.api.dataplane.v1;
55
import "buf/validate/validate.proto";
66
import "google/api/annotations.proto";
77
import "google/api/field_behavior.proto";
8+
import "google/protobuf/field_mask.proto";
89
import "protoc-gen-openapiv2/options/annotations.proto";
910
import "redpanda/api/auth/v1/authorization.proto";
1011

@@ -52,6 +53,15 @@ message Pipeline {
5253
// May be empty if no http_server is used.
5354
string url = 10;
5455

56+
// Tags are key-value pairs that can be assigned to a pipeline resource.
57+
// They help organize pipelines and enable filtering when listing them.
58+
map<string, string> tags = 11 [(buf.validate.field).map = {
59+
max_pairs: 16
60+
values: {
61+
string: {pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"}
62+
}
63+
}];
64+
5565
message Resources {
5666
// `memory_shares` is a string specifying the amount of memory to allocate for
5767
// the pipeline.
@@ -452,6 +462,14 @@ message ListPipelinesRequest {
452462
(buf.validate.field).string.pattern = "^[A-Za-z0-9-_ /]+$",
453463
(buf.validate.field).string.max_len = 128
454464
];
465+
466+
// Filter pipelines that contain all of these key/value pairs.
467+
map<string, string> tags = 2 [(buf.validate.field).map = {
468+
max_pairs: 16
469+
values: {
470+
string: {pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"}
471+
}
472+
}];
455473
}
456474
}
457475

@@ -486,6 +504,15 @@ message PipelineUpdate {
486504

487505
// The number of resources that are guaranteed to be assigned to the pipeline.
488506
Pipeline.Resources resources = 6;
507+
508+
// A map of tags to add, update or delete.
509+
// If a tag's value is empty, the server interprets that as a deletion.
510+
map<string, string> tags = 7 [(buf.validate.field).map = {
511+
max_pairs: 16
512+
values: {
513+
string: {pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"}
514+
}
515+
}];
489516
}
490517

491518
message UpdatePipelineRequest {
@@ -495,10 +522,15 @@ message UpdatePipelineRequest {
495522
(buf.validate.field).required = true,
496523
(buf.validate.field).string.pattern = "^[A-Za-z0-9-_/]+$"
497524
];
525+
498526
PipelineUpdate pipeline = 2 [
499527
(google.api.field_behavior) = REQUIRED,
500528
(buf.validate.field).required = true
501529
];
530+
531+
// Specifies which fields should be updated. If not provided,
532+
// all fields will be updated.
533+
google.protobuf.FieldMask update_mask = 3;
502534
}
503535

504536
message UpdatePipelineResponse {

0 commit comments

Comments
 (0)