Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 syntax = "proto3"; | 5 syntax = "proto3"; |
| 6 | 6 |
| 7 package messages; | 7 package messages; |
| 8 | 8 |
| 9 // A single access control rule. | |
| 10 message Acl { | |
| 11 enum Role { | |
| 12 // Can do read-only operations, such as listing invocations of a Job. | |
| 13 READER = 0; | |
| 14 // Same as READER + can modify state of a Job or Invocation such as aborting | |
| 15 // them. | |
| 16 WRITER = 1; | |
| 17 } | |
| 18 // Role denotes a list of actions that an identity can perform. | |
| 19 Role role = 1; | |
| 20 // A full identity string "kind:name", such as "group:xyz" or | |
| 21 // "email:mail@example.com". | |
|
nodir
2017/07/28 13:59:44
Consider supporting prefix-less user emails, e.g.
tandrii(chromium)
2017/07/28 15:15:12
Done.
| |
| 22 // For more details, see auth service on kinds of identities. | |
| 23 string identity = 2; | |
|
nodir
2017/07/28 13:59:44
I think the term "identity" is reserved for one id
tandrii(chromium)
2017/07/28 15:15:12
You are right https://cs.chromium.org/chromium/inf
| |
| 24 } | |
| 25 | |
| 26 // A set of Acl messages. Can be referenced in a Job or Trigger by name. | |
| 27 message AclSet { | |
| 28 // A name of the ACL set, unique for a project. | |
| 29 // Required. Must match regex '^[a-z0-9_]+$'. | |
| 30 string name = 1; | |
| 31 // List of access control rules. | |
| 32 // The order does not matter. | |
| 33 repeated Acl acls = 2; | |
| 34 } | |
| 9 | 35 |
| 10 // Job specifies a single regular job belonging to a project. | 36 // Job specifies a single regular job belonging to a project. |
| 11 // | 37 // |
| 12 // Such jobs runs on a schedule or can be triggered by some trigger. | 38 // Such jobs runs on a schedule or can be triggered by some trigger. |
| 13 message Job { | 39 message Job { |
| 14 // Id is a name of the job (unique for the project). | 40 // Id is a name of the job (unique for the project). |
| 15 // | 41 // |
| 16 // Must match '^[0-9A-Za-z_\-\.]{1,100}$'. | 42 // Must match '^[0-9A-Za-z_\-\.]{1,100}$'. |
| 17 string id = 1; | 43 string id = 1; |
| 18 | 44 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 38 | 64 |
| 39 // Disabled is true to disable this job. | 65 // Disabled is true to disable this job. |
| 40 bool disabled = 3; | 66 bool disabled = 3; |
| 41 | 67 |
| 42 // Task defines what exactly to execute. | 68 // Task defines what exactly to execute. |
| 43 // | 69 // |
| 44 // TODO(vadimsh): Remove this field once all configs are updated not to | 70 // TODO(vadimsh): Remove this field once all configs are updated not to |
| 45 // use it. | 71 // use it. |
| 46 TaskDefWrapper task = 4; | 72 TaskDefWrapper task = 4; |
| 47 | 73 |
| 74 // List of access control rules for the Job. | |
| 75 // The order does not matter. | |
| 76 repeated Acl acls = 5; | |
| 77 // A list of ACL set names. Each ACL in each referenced ACL set will be | |
| 78 // included in this Job. | |
| 79 // The order does not matter. | |
| 80 repeated string acl_sets = 6; | |
| 81 | |
| 48 // One and only one field below must be set. It defines what this job does. | 82 // One and only one field below must be set. It defines what this job does. |
| 49 | 83 |
| 50 // Noop is used for testing. It is "do nothing" task. | 84 // Noop is used for testing. It is "do nothing" task. |
| 51 NoopTask noop = 100; | 85 NoopTask noop = 100; |
| 52 // UrlFetch can be used to make a simple HTTP call. | 86 // UrlFetch can be used to make a simple HTTP call. |
| 53 UrlFetchTask url_fetch = 101; | 87 UrlFetchTask url_fetch = 101; |
| 54 // SwarmingTask can be used to schedule swarming job. | 88 // SwarmingTask can be used to schedule swarming job. |
| 55 SwarmingTask swarming = 102; | 89 SwarmingTask swarming = 102; |
| 56 // BuildbucketTask can be used to schedule buildbucket job. | 90 // BuildbucketTask can be used to schedule buildbucket job. |
| 57 BuildbucketTask buildbucket = 103; | 91 BuildbucketTask buildbucket = 103; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 69 string id = 1; | 103 string id = 1; |
| 70 | 104 |
| 71 // Schedule describes when to run this triggering job. | 105 // Schedule describes when to run this triggering job. |
| 72 // | 106 // |
| 73 // See Job.schedule fro more info. Default is "with 30s interval". | 107 // See Job.schedule fro more info. Default is "with 30s interval". |
| 74 string schedule = 2; | 108 string schedule = 2; |
| 75 | 109 |
| 76 // Disabled is true to disable this job. | 110 // Disabled is true to disable this job. |
| 77 bool disabled = 3; | 111 bool disabled = 3; |
| 78 | 112 |
| 113 // List of access control rules for the Job. | |
| 114 // The order does not matter. | |
| 115 repeated Acl acls = 4; | |
| 116 // A list of ACL set names. Each ACL in each referenced ACL set will be | |
| 117 // included in this Job. | |
| 118 // The order does not matter. | |
| 119 repeated string acl_sets = 5; | |
| 120 | |
| 79 // One and only one field below must be set. It defines what this job does. | 121 // One and only one field below must be set. It defines what this job does. |
| 80 | 122 |
| 81 // Noop is used for testing. It is "do nothing" trigger. | 123 // Noop is used for testing. It is "do nothing" trigger. |
| 82 NoopTask noop = 100; | 124 NoopTask noop = 100; |
| 83 // Gitiles is used to trigger jobs for new commits on Gitiles. | 125 // Gitiles is used to trigger jobs for new commits on Gitiles. |
| 84 GitilesTask gitiles = 101; | 126 GitilesTask gitiles = 101; |
| 85 } | 127 } |
| 86 | 128 |
| 87 | 129 |
| 88 // NoopTask is used for testing. It is "do nothing" task. | 130 // NoopTask is used for testing. It is "do nothing" task. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 | 206 |
| 165 | 207 |
| 166 // ProjectConfig defines a schema for config file that describe jobs belonging | 208 // ProjectConfig defines a schema for config file that describe jobs belonging |
| 167 // to some project. | 209 // to some project. |
| 168 message ProjectConfig { | 210 message ProjectConfig { |
| 169 // Job is a set of jobs defined in the project. | 211 // Job is a set of jobs defined in the project. |
| 170 repeated Job job = 1; | 212 repeated Job job = 1; |
| 171 | 213 |
| 172 // Trigger is a set of triggering jobs defined in the project. | 214 // Trigger is a set of triggering jobs defined in the project. |
| 173 repeated Trigger trigger = 2; | 215 repeated Trigger trigger = 2; |
| 216 | |
| 217 // A list of ACL sets. Names must be unique. | |
| 218 repeated AclSet acl_sets = 3; | |
| 174 } | 219 } |
| 175 | 220 |
| 176 //////////////////////////////////////////////////////////////////////////////// | 221 //////////////////////////////////////////////////////////////////////////////// |
| 177 // Internal stuff. | 222 // Internal stuff. |
| 178 | 223 |
| 179 // TaskDefWrapper is a union type of all possible tasks known to the scheduler. | 224 // TaskDefWrapper is a union type of all possible tasks known to the scheduler. |
| 180 // | 225 // |
| 181 // It is used internally when storing jobs in the datastore. | 226 // It is used internally when storing jobs in the datastore. |
| 182 // | 227 // |
| 183 // TODO(vadimsh): Remove '_task' suffixes once TaskDefWrapper is no longer | 228 // TODO(vadimsh): Remove '_task' suffixes once TaskDefWrapper is no longer |
| 184 // a part of 'Job' proto. | 229 // a part of 'Job' proto. |
| 185 message TaskDefWrapper { | 230 message TaskDefWrapper { |
| 186 NoopTask noop = 1; | 231 NoopTask noop = 1; |
| 187 UrlFetchTask url_fetch = 2; | 232 UrlFetchTask url_fetch = 2; |
| 188 SwarmingTask swarming_task = 3; | 233 SwarmingTask swarming_task = 3; |
| 189 BuildbucketTask buildbucket_task = 4; | 234 BuildbucketTask buildbucket_task = 4; |
| 190 GitilesTask gitiles_task = 5; | 235 GitilesTask gitiles_task = 5; |
| 191 } | 236 } |
| OLD | NEW |