Skip to content

Commit d89a2eb

Browse files
authored
sift(refactor): remove protovalidate from client-side protos (#545)
1 parent 7075ca9 commit d89a2eb

23 files changed

Lines changed: 323 additions & 5330 deletions

File tree

protos/buf.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Generated by buf. DO NOT EDIT.
22
version: v1
33
deps:
4-
- remote: buf.build
5-
owner: bufbuild
6-
repository: protovalidate
7-
commit: 50325440f8f24053b047484a6bf60b76
8-
digest: shake256:32560c4bbc1689fcb893d4ea6c26a9c600300c3c7691abdadbbaa9348e16061c9e74dce96ac296fe561b1abb56ca4b5976619a1f0038981d876da7bc02e3c385
94
- remote: buf.build
105
owner: googleapis
116
repository: googleapis

protos/buf.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ lint:
1313
- sift/protobuf_descriptors/v2/channel_parsing_options.proto
1414
deps:
1515
- buf.build/googleapis/googleapis
16-
- buf.build/grpc-ecosystem/grpc-gateway
17-
- buf.build/bufbuild/protovalidate
16+
- buf.build/grpc-ecosystem/grpc-gateway

protos/sift/api_keys/v2/api_keys.proto

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ syntax = "proto3";
22

33
package sift.api_keys.v2;
44

5-
import "buf/validate/validate.proto";
65
import "google/api/annotations.proto";
76
import "google/api/field_behavior.proto";
87
import "google/protobuf/timestamp.proto";
@@ -113,18 +112,12 @@ message ListApiKeysResponse {
113112
message CreateApiKeyRequest {
114113
// The name for the new ApiKey. Required.
115114
string name = 1 [(google.api.field_behavior) = REQUIRED];
116-
string user_id = 2 [
117-
(google.api.field_behavior) = REQUIRED,
118-
(buf.validate.field).string.uuid = true
119-
];
115+
string user_id = 2 [(google.api.field_behavior) = REQUIRED];
120116
}
121117

122118
// The request for a call to ApiKeyService.DeleteApiKey.
123119
message DeleteApiKeyRequest {
124-
string api_key_id = 1 [
125-
(google.api.field_behavior) = REQUIRED,
126-
(buf.validate.field).string.uuid = true
127-
];
120+
string api_key_id = 1 [(google.api.field_behavior) = REQUIRED];
128121
}
129122

130123
message DeleteApiKeyResponse {}

protos/sift/common/type/v1/calculated_channels.proto

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@ syntax = "proto3";
22

33
package sift.common.type.v1;
44

5-
import "buf/validate/validate.proto";
65
import "google/api/field_behavior.proto";
76

87

98
// A dependency on another calculated channel.
109
message CalculatedChannelDependency {
11-
string calculated_channel_version_id = 1 [
12-
(google.api.field_behavior) = REQUIRED,
13-
(buf.validate.field).string.uuid = true
14-
];
10+
string calculated_channel_version_id = 1 [(google.api.field_behavior) = REQUIRED];
1511
}

protos/sift/common/type/v1/user_defined_functions.proto

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ syntax = "proto3";
22

33
package sift.common.type.v1;
44

5-
import "buf/validate/validate.proto";
65
import "google/api/field_behavior.proto";
76
import "google/protobuf/timestamp.proto";
87
import "sift/metadata/v1/metadata.proto";
@@ -39,10 +38,7 @@ message UserDefinedFunction {
3938
}
4039

4140
message FunctionDependency {
42-
string user_defined_function_version_id = 1 [
43-
(google.api.field_behavior) = REQUIRED,
44-
(buf.validate.field).string.uuid = true
45-
];
41+
string user_defined_function_version_id = 1 [(google.api.field_behavior) = REQUIRED];
4642
}
4743

4844
message FunctionInput {

protos/sift/runs/v2/runs.proto

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ syntax = "proto3";
22

33
package sift.runs.v2;
44

5-
import "buf/validate/validate.proto";
65
import "google/api/annotations.proto";
76
import "google/api/field_behavior.proto";
87
import "google/protobuf/duration.proto";
@@ -144,10 +143,7 @@ message Run {
144143
// The request for a call to `RunService_GetRun` to retrieve run.
145144
message GetRunRequest {
146145
// The ID of the run to retrieve.
147-
string run_id = 1 [
148-
(google.api.field_behavior) = REQUIRED,
149-
(buf.validate.field).string.uuid = true
150-
];
146+
string run_id = 1 [(google.api.field_behavior) = REQUIRED];
151147
}
152148

153149
// The response of a call to `RunService_GetRun` containing the requested run.
@@ -218,14 +214,7 @@ message CreateRunRequest {
218214
string organization_id = 7 [(google.api.field_behavior) = OPTIONAL];
219215

220216
// An arbitrary user-chosen key that uniquely identifies this run. Optional, though it is recommended to provide.
221-
optional string client_key = 8 [
222-
(google.api.field_behavior) = OPTIONAL,
223-
(buf.validate.field).cel = {
224-
id: "invalid_client_key"
225-
message: "client key must be 3-128 characters, start and end with an alphanumeric, and contain only [a-zA-Z0-9_~.-]."
226-
expression: "this.matches('^[a-zA-Z0-9][a-zA-Z0-9_~.-]{0,126}[a-zA-Z0-9]$')"
227-
}
228-
];
217+
optional string client_key = 8 [(google.api.field_behavior) = OPTIONAL];
229218

230219
// The metadata values associated with this run.
231220
repeated sift.metadata.v1.MetadataValue metadata = 9 [(google.api.field_behavior) = OPTIONAL];
@@ -242,34 +231,21 @@ message CreateRunResponse {
242231
// The request for a call to `RunService_CreateAdhocRun` to create an adhoc run.
243232
message CreateAdhocRunRequest {
244233
// The name that will be assigned to the new run.
245-
string name = 1 [
246-
(google.api.field_behavior) = REQUIRED,
247-
(buf.validate.field).string.min_len = 1
248-
];
234+
string name = 1 [(google.api.field_behavior) = REQUIRED];
249235
// A description about the new run.
250236
string description = 2 [(google.api.field_behavior) = REQUIRED];
251237
// The time at which data ingestion began for this new run. It must be before the `stop_time`
252238
google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED];
253239
// The time at which data ingestion concluded for this new run.
254240
google.protobuf.Timestamp stop_time = 4 [(google.api.field_behavior) = REQUIRED];
255241
// A list of asset IDs to associate with the new run.
256-
repeated string asset_ids = 5 [
257-
(google.api.field_behavior) = REQUIRED,
258-
(buf.validate.field).repeated.min_items = 1
259-
];
242+
repeated string asset_ids = 5 [(google.api.field_behavior) = REQUIRED];
260243
// Tags to associate with the new run.
261244
repeated string tags = 6 [(google.api.field_behavior) = OPTIONAL];
262245
// The metadata values associated with this run.
263246
repeated sift.metadata.v1.MetadataValue metadata = 7 [(google.api.field_behavior) = OPTIONAL];
264247
// An arbitrary user-chosen key that uniquely identifies this run. Optional, though it is recommended to provide.
265-
optional string client_key = 8 [
266-
(google.api.field_behavior) = OPTIONAL,
267-
(buf.validate.field).cel = {
268-
id: "invalid_client_key"
269-
message: "client key must be 3-128 characters, start and end with an alphanumeric, and contain only [a-zA-Z0-9_~.-]."
270-
expression: "this.matches('^[a-zA-Z0-9][a-zA-Z0-9_~.-]{0,126}[a-zA-Z0-9]$')"
271-
}
272-
];
248+
optional string client_key = 8 [(google.api.field_behavior) = OPTIONAL];
273249
}
274250

275251
// The response of a call to `RunService_CreateAdhocRun` containing the newly created adhoc run.
@@ -289,14 +265,7 @@ message UpdateRunRequest {
289265
// commences for this run, the `start_time` will be automatically overwritten and set to the timestamp
290266
// corresponding to the beginning of the latest run. Additionally, `client_key` can only be set once either in run creation or in update.
291267
// Any subsequent attempt to update `client_key` will result in an error.
292-
google.protobuf.FieldMask update_mask = 2 [
293-
(google.api.field_behavior) = REQUIRED,
294-
(buf.validate.field).cel = {
295-
id: "invalid_field_mask_path"
296-
message: "field mask path must be in ['name', 'description', 'start_time', 'startTime', 'stop_time', 'stopTime', 'is_pinned', 'isPinned', 'client_key', 'clientKey', 'tags', 'metadata', 'archived_date', 'is_archived', 'isArchived']"
297-
expression: "this.paths.all(path, path in ['name', 'description', 'start_time', 'startTime', 'stop_time', 'stopTime', 'is_pinned', 'isPinned', 'client_key', 'clientKey', 'tags', 'metadata', 'archived_date', 'is_archived', 'isArchived'])"
298-
}
299-
];
268+
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
300269
}
301270

302271
// The response of a call to `RunService_UpdateRun` containing the updated run.
@@ -306,10 +275,7 @@ message UpdateRunResponse {
306275

307276
message CreateAutomaticRunAssociationForAssetsRequest {
308277
// The ID of the run to associate the asset with.
309-
string run_id = 1 [
310-
(google.api.field_behavior) = REQUIRED,
311-
(buf.validate.field).string.uuid = true
312-
];
278+
string run_id = 1 [(google.api.field_behavior) = REQUIRED];
313279

314280
// A list of asset names to automatically associate with the run.
315281
// Any data that is received for these assets will automatically added to the run.
@@ -325,21 +291,15 @@ message CreateAutomaticRunAssociationForAssetsResponse {}
325291

326292
// The request for a call to `RunService_DeleteRun`.
327293
message DeleteRunRequest {
328-
string run_id = 1 [
329-
(google.api.field_behavior) = REQUIRED,
330-
(buf.validate.field).string.uuid = true
331-
];
294+
string run_id = 1 [(google.api.field_behavior) = REQUIRED];
332295
}
333296

334297
// The response of a call to `RunService_DeleteRun`.
335298
message DeleteRunResponse {}
336299

337300
// The request for a call to `RunService_StopRun` to stop a run.
338301
message StopRunRequest {
339-
string run_id = 1 [
340-
(google.api.field_behavior) = REQUIRED,
341-
(buf.validate.field).string.uuid = true
342-
];
302+
string run_id = 1 [(google.api.field_behavior) = REQUIRED];
343303
}
344304

345305
// The response of a call to `RunService_StopRun` to stop a run.

protos/sift/user_defined_functions/v1/user_defined_functions.proto

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ syntax = "proto3";
22

33
package sift.user_defined_functions.v1;
44

5-
import "buf/validate/validate.proto";
65
import "google/api/annotations.proto";
76
import "google/api/field_behavior.proto";
87
import "google/protobuf/field_mask.proto";
@@ -118,10 +117,7 @@ service UserDefinedFunctionService {
118117
// If `user_defined_function_id` is provided then all other arguments will be ignored. The argument `user_defined_function_id`
119118
// should not be used together with `name`.
120119
message GetUserDefinedFunctionRequest {
121-
string user_defined_function_id = 1 [
122-
(google.api.field_behavior) = OPTIONAL,
123-
(buf.validate.field).string.uuid = true
124-
];
120+
string user_defined_function_id = 1 [(google.api.field_behavior) = OPTIONAL];
125121
string name = 2 [(google.api.field_behavior) = OPTIONAL];
126122
}
127123

@@ -131,10 +127,7 @@ message GetUserDefinedFunctionResponse {
131127

132128
// The request for a call to `UserDefinedFunctionService_GetUserDefinedFunctionVersion` to retrieve a specific version of a user defined function.
133129
message GetUserDefinedFunctionVersionRequest {
134-
string user_defined_function_version_id = 1 [
135-
(google.api.field_behavior) = REQUIRED,
136-
(buf.validate.field).string.uuid = true
137-
];
130+
string user_defined_function_version_id = 1 [(google.api.field_behavior) = REQUIRED];
138131
}
139132

140133
message GetUserDefinedFunctionVersionResponse {
@@ -145,15 +138,9 @@ message GetUserDefinedFunctionVersionResponse {
145138
message GetUserDefinedFunctionDependentsRequest {
146139
uint32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
147140
oneof user_defined_function {
148-
string user_defined_function_id = 2 [
149-
(buf.validate.field).string.uuid = true,
150-
(google.api.field_behavior) = OPTIONAL
151-
];
141+
string user_defined_function_id = 2 [(google.api.field_behavior) = OPTIONAL];
152142
string user_defined_function_name = 3 [(google.api.field_behavior) = OPTIONAL];
153-
string user_defined_function_version_id = 4 [
154-
(buf.validate.field).string.uuid = true,
155-
(google.api.field_behavior) = OPTIONAL
156-
];
143+
string user_defined_function_version_id = 4 [(google.api.field_behavior) = OPTIONAL];
157144
}
158145
}
159146

@@ -168,25 +155,15 @@ message GetUserDefinedFunctionDependentsResponse {
168155

169156
// The request for a call to `UserDefinedFunctionService_GetUserDefinedFunctionVersions` to retrieve versions of user defined functions.
170157
message GetUserDefinedFunctionVersionsRequest {
171-
repeated string user_defined_function_version_ids = 1 [
172-
(google.api.field_behavior) = REQUIRED,
173-
(buf.validate.field).repeated.items.string.uuid = true
174-
];
158+
repeated string user_defined_function_version_ids = 1 [(google.api.field_behavior) = REQUIRED];
175159
}
176160

177161
message GetUserDefinedFunctionVersionsResponse {
178162
repeated sift.common.type.v1.UserDefinedFunction user_defined_functions = 1 [(google.api.field_behavior) = REQUIRED];
179163
}
180164

181165
message CreateUserDefinedFunctionRequest {
182-
string name = 1 [
183-
(google.api.field_behavior) = REQUIRED,
184-
(buf.validate.field).cel = {
185-
id: "invalid_name"
186-
message: "name must be 3-128 characters, start and end with an alphanumeric, and contain only [a-zA-Z0-9_~.-]."
187-
expression: "this.matches('^[a-zA-Z0-9][a-zA-Z0-9_~.-]{0,126}[a-zA-Z0-9]$')"
188-
}
189-
];
166+
string name = 1 [(google.api.field_behavior) = REQUIRED];
190167
optional string description = 2 [(google.api.field_behavior) = OPTIONAL];
191168
string expression = 3 [(google.api.field_behavior) = REQUIRED];
192169
repeated sift.common.type.v1.FunctionInput function_inputs = 4 [(google.api.field_behavior) = REQUIRED];

0 commit comments

Comments
 (0)