Skip to content

Commit 5ce91ec

Browse files
Variable naming to indicate pointer/value
1 parent 53878d6 commit 5ce91ec

1 file changed

Lines changed: 25 additions & 9 deletions

File tree

‎apis/workflows/v1/core.proto‎

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,9 @@ message TaskSubmission {
206206
// To reduce the serialization size, we keep a separate list/lookup table of unique task properties, that can then be
207207
// referenced by their index.
208208
message TaskSubmissions {
209-
// Concrete instantiations of tasks, grouped by their dependencies and dependants, and referencing entries in the
210-
// lookup tables also contained in this message by index.
209+
// Concrete instantiations of tasks, grouped by their dependencies and dependants. Each group is uniquely defined by
210+
// the set of groups that it depends on (dependencies_on_other_groups) and the set of groups that depend on it,
211+
// (which is implicitly given by the inverse of the dependencies on other groups).
211212
repeated TaskSubmissionGroup task_groups = 1;
212213
// Unique values of cluster slugs, referenced by index in the task instantiations.
213214
repeated string cluster_slug_lookup = 2;
@@ -225,9 +226,24 @@ message TaskSubmissions {
225226
// across groups, since there may be two groups sharing the same dependencies but having different dependants.
226227
message TaskSubmissionGroup {
227228
option (buf.validate.message).cel = {
228-
id: "task_submission_group.task_fields_size_match"
229-
message: "The length of the task related fields must match."
230-
expression: "this.inputs.size() == this.max_retries.size() && this.inputs.size() == this.identifier.size() && this.inputs.size() == this.cluster_slug.size() && this.inputs.size() == this.display.size() && this.inputs.size() == this.max_retries.size()"
229+
id: "task_submission_group.identifiers_size_match"
230+
message: "The number of inputs must match the number of task identifiers."
231+
expression: "this.inputs.size() == this.identifier_pointers.size()"
232+
};
233+
option (buf.validate.message).cel = {
234+
id: "task_submission_group.cluster_slugs_size_match"
235+
message: "The number of cluster slugs must match the number of inputs."
236+
expression: "this.inputs.size() == this.cluster_slug_pointers.size()"
237+
};
238+
option (buf.validate.message).cel = {
239+
id: "task_submission_group.displays_size_match"
240+
message: "The number of display pointers must match the number of inputs."
241+
expression: "this.inputs.size() == this.display_pointers.size()"
242+
};
243+
option (buf.validate.message).cel = {
244+
id: "task_submission_group.max_retries_size_match"
245+
message: "The number of max_retries_values must match the number of inputs."
246+
expression: "this.inputs.size() == this.max_retries_values.size()"
231247
};
232248

233249
// The indices of the groups that this submission group depends on. Indices refer to the groups field of the
@@ -239,15 +255,15 @@ message TaskSubmissionGroup {
239255
repeated bytes inputs = 2 [(buf.validate.field).repeated.items.bytes.max_len = 2048];
240256
// Index of the task identifier in the identifier_lookup field of the containing TaskSubmissions message
241257
// for each task.
242-
repeated uint64 identifier = 3;
258+
repeated uint64 identifier_pointers = 3;
243259
// Index of the cluster slug in the cluster_slug_lookup field of the containing TaskSubmissions message for each task,
244260
// indicating the cluster that the task should be run on.
245-
repeated uint64 cluster_slug = 4;
261+
repeated uint64 cluster_slug_pointers = 4;
246262
// Index of the display name in the display_lookup field of the containing TaskSubmissions message for each task,
247263
// specifying a human-readable description of the task.
248-
repeated uint64 display = 5;
264+
repeated uint64 display_pointers = 5;
249265
// The maximum number of retries for each task. Not a pointer to a lookup table, since we just inline the values.
250-
repeated int64 max_retries = 6;
266+
repeated int64 max_retries_values = 6;
251267
}
252268

253269
// A lease for a task.

0 commit comments

Comments
 (0)