Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = Gerrit Code Review - Review Labels |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 2 | |
| 3 | As part of the code review process, reviewers score each change with |
| 4 | values for each label configured for the project. The label values that |
| 5 | a given user is allowed to set are defined according to the |
Fredrik Luthander | ac8af9e | 2013-05-08 01:06:25 +0200 | [diff] [blame] | 6 | link:access-control.html#category_review_labels[access controls]. Gerrit |
| 7 | comes pre-configured with the Code-Review label that can be granted to |
| 8 | groups within projects, enabling functionality for that group's members. |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 9 | |
| 10 | |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 11 | [[label_Code-Review]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 12 | == Label: Code-Review |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 13 | |
Gert van Dijk | bc683f2 | 2017-08-28 01:30:47 +0200 | [diff] [blame] | 14 | The Code-Review label is configured upon the creation of a Gerrit |
| 15 | instance. It may have any meaning the project desires. It was |
| 16 | originally invented by the Android Open Source Project to mean |
| 17 | 'I read the code and it seems reasonably correct'. |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 18 | |
| 19 | The range of values is: |
| 20 | |
Paul Fertser | 2474e52 | 2014-01-23 10:00:59 +0400 | [diff] [blame] | 21 | * -2 This shall not be merged |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 22 | + |
| 23 | The code is so horribly incorrect/buggy/broken that it must not be |
| 24 | submitted to this project, or to this branch. This value is valid |
| 25 | across all patch sets in the same change, i.e. the reviewer must |
| 26 | actively change his/her review to something else before the change |
| 27 | is submittable. |
| 28 | + |
| 29 | *Any -2 blocks submit.* |
| 30 | |
Paul Fertser | 2474e52 | 2014-01-23 10:00:59 +0400 | [diff] [blame] | 31 | * -1 I would prefer this is not merged as is |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 32 | + |
| 33 | The code doesn't look right, or could be done differently, but |
| 34 | the reviewer is willing to live with it as-is if another reviewer |
| 35 | accepts it, perhaps because it is better than what is currently in |
| 36 | the project. Often this is also used by contributors who don't like |
| 37 | the change, but also aren't responsible for the project long-term |
| 38 | and thus don't have final say on change submission. |
| 39 | + |
| 40 | Does not block submit. |
| 41 | |
| 42 | * 0 No score |
| 43 | + |
| 44 | Didn't try to perform the code review task, or glanced over it but |
| 45 | don't have an informed opinion yet. |
| 46 | |
| 47 | * +1 Looks good to me, but someone else must approve |
| 48 | + |
| 49 | The code looks right to this reviewer, but the reviewer doesn't |
| 50 | have access to the `+2` value for this category. Often this is |
| 51 | used by contributors to a project who were able to review the change |
| 52 | and like what it is doing, but don't have final approval over what |
| 53 | gets submitted. |
| 54 | |
| 55 | * +2 Looks good to me, approved |
| 56 | + |
| 57 | Basically the same as `+1`, but for those who have final say over |
| 58 | how the project will develop. |
| 59 | + |
| 60 | *Any +2 enables submit.* |
| 61 | |
| 62 | For a change to be submittable, the latest patch set must have a |
| 63 | `+2 Looks good to me, approved` in this category, and no |
| 64 | `-2 Do not submit`. Thus `-2` on any patch set can block a submit, |
| 65 | while `+2` on the latest patch set can enable it. |
| 66 | |
| 67 | If a Gerrit installation does not wish to use this label in any project, |
| 68 | the `[label "Code-Review"]` section can be deleted from `project.config` |
| 69 | in `All-Projects`. |
| 70 | |
| 71 | If a Gerrit installation or project wants to modify the description text |
| 72 | associated with these label values, the text can be updated in the |
| 73 | `label.Code-Review.value` fields in `project.config`. |
| 74 | |
| 75 | Additional entries could be added to `label.Code-Review.value` to |
| 76 | further extend the negative and positive range, but there is likely |
| 77 | little value in doing so as this only expands the middle region. This |
| 78 | label is a `MaxWithBlock` type, which means that the lowest negative |
| 79 | value if present blocks a submit, while the highest positive value is |
| 80 | required to enable submit. |
| 81 | |
Shawn Pearce | 77d9662 | 2013-03-28 18:02:19 -0400 | [diff] [blame] | 82 | [[label_Verified]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 83 | == Label: Verified |
Shawn Pearce | 77d9662 | 2013-03-28 18:02:19 -0400 | [diff] [blame] | 84 | |
| 85 | The Verified label was originally invented by the Android Open Source |
| 86 | Project to mean 'compiles, passes basic unit tests'. Some CI tools |
| 87 | expect to use the Verified label to vote on a change after running. |
| 88 | |
Gert van Dijk | bc683f2 | 2017-08-28 01:30:47 +0200 | [diff] [blame] | 89 | During site initialization the administrator may have chosen to |
| 90 | configure the default Verified label for all projects. In case it is |
| 91 | desired to configure it at a later time, administrators can do this by |
| 92 | adding the following to `project.config` in `All-Projects`: |
Shawn Pearce | 77d9662 | 2013-03-28 18:02:19 -0400 | [diff] [blame] | 93 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 94 | ---- |
Shawn Pearce | 77d9662 | 2013-03-28 18:02:19 -0400 | [diff] [blame] | 95 | [label "Verified"] |
Edwin Kempin | ba8cdd8 | 2013-04-03 15:35:06 +0200 | [diff] [blame] | 96 | function = MaxWithBlock |
Shawn Pearce | 77d9662 | 2013-03-28 18:02:19 -0400 | [diff] [blame] | 97 | value = -1 Fails |
Dave Borowitz | 085209e | 2017-11-20 15:18:15 -0500 | [diff] [blame] | 98 | value = 0 No score |
Shawn Pearce | 77d9662 | 2013-03-28 18:02:19 -0400 | [diff] [blame] | 99 | value = +1 Verified |
Gert van Dijk | bc683f2 | 2017-08-28 01:30:47 +0200 | [diff] [blame] | 100 | copyAllScoresIfNoCodeChange = true |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 101 | ---- |
Shawn Pearce | 77d9662 | 2013-03-28 18:02:19 -0400 | [diff] [blame] | 102 | |
| 103 | The range of values is: |
| 104 | |
| 105 | * -1 Fails |
| 106 | + |
| 107 | Tried to compile, but got a compile error, or tried to run tests, |
| 108 | but one or more tests did not pass. |
| 109 | + |
| 110 | *Any -1 blocks submit.* |
| 111 | |
| 112 | * 0 No score |
| 113 | + |
| 114 | Didn't try to perform the verification tasks. |
| 115 | |
| 116 | * +1 Verified |
| 117 | + |
| 118 | Compiled (and ran tests) successfully. |
| 119 | + |
| 120 | *Any +1 enables submit.* |
| 121 | |
| 122 | For a change to be submittable, the change must have a `+1 Verified` |
| 123 | in this label, and no `-1 Fails`. Thus, `-1 Fails` can block a submit, |
| 124 | while `+1 Verified` enables a submit. |
| 125 | |
| 126 | Additional values could also be added to this label, to allow it to |
| 127 | behave more like `Code-Review` (below). Add -2 and +2 entries to the |
| 128 | `label.Verified.value` fields in `project.config` to get the same |
| 129 | behavior. |
| 130 | |
| 131 | |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 132 | [[label_custom]] |
David Pursehouse | 584aa19 | 2017-02-28 16:28:43 +0900 | [diff] [blame] | 133 | == Customized Labels |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 134 | |
David Pursehouse | 584aa19 | 2017-02-28 16:28:43 +0900 | [diff] [blame] | 135 | Site administrators and project owners can define their own labels, |
| 136 | or customize labels inherited from parent projects. |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 137 | |
| 138 | See above for descriptions of how <<label_Verified,`Verified`>> |
| 139 | and <<label_Code-Review,`Code-Review`>> work, and add your own |
| 140 | label to `project.config` to get the same behavior over your own range |
| 141 | of values, for any label you desire. |
| 142 | |
| 143 | Just like the built-in labels, users need to be given permissions to |
| 144 | vote on custom labels. Permissions can either be added by manually |
| 145 | editing project.config when adding the labels, or, once the labels are |
| 146 | added, permission categories for those labels will show up in the |
| 147 | permission editor web UI. |
| 148 | |
| 149 | Labels may be added to any project's `project.config`; the default |
David Pursehouse | 584aa19 | 2017-02-28 16:28:43 +0900 | [diff] [blame] | 150 | labels are defined in `All-Projects`. |
| 151 | |
| 152 | [[label_inheritance]] |
| 153 | === Inheritance |
| 154 | |
| 155 | Labels are inherited from parent projects. A child project may add, |
David Pursehouse | 9c333f0 | 2017-02-28 16:35:27 +0900 | [diff] [blame] | 156 | override, or remove labels defined in its parents. |
| 157 | |
| 158 | Overriding a label in a child project overrides all its properties and |
| 159 | values. It is not possible to modify an inherited label by adding |
| 160 | properties in the child project's configuration; all properties from |
| 161 | the parent definition must be redefined in the child. |
| 162 | |
| 163 | To remove a label in a child project, add an empty label with the same |
Han-Wen Nienhuys | f6b0bb8 | 2018-04-23 16:38:44 +0200 | [diff] [blame] | 164 | name as in the parent. This will override the parent label with |
| 165 | a label containing the defaults (`function = MaxWithBlock`, |
| 166 | `defaultValue = 0` and no further allowed values) |
David Pursehouse | 584aa19 | 2017-02-28 16:28:43 +0900 | [diff] [blame] | 167 | |
| 168 | [[label_layout]] |
| 169 | === Layout |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 170 | |
Nigel Babu | 46bb5c7 | 2017-12-19 11:21:32 +0530 | [diff] [blame] | 171 | Labels are laid out in alphabetical order. |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 172 | |
| 173 | [[label_name]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 174 | === `label.Label-Name` |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 175 | |
| 176 | The name for a label, consisting only of alphanumeric characters and |
| 177 | `-`. |
| 178 | |
| 179 | |
| 180 | [[label_value]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 181 | === `label.Label-Name.value` |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 182 | |
| 183 | A multi-valued key whose values are of the form `"<#> Value description |
| 184 | text"`. The `<#>` may be any positive or negative number with an |
| 185 | optional leading `+`. |
| 186 | |
| 187 | |
Khai Do | 4c91b00 | 2014-04-06 23:27:43 -0700 | [diff] [blame] | 188 | [[label_defaultValue]] |
| 189 | === `label.Label-Name.defaultValue` |
| 190 | |
| 191 | The default value (or score) for the label. The defaultValue must be |
| 192 | within the range of valid label values. It is an optional label setting, |
| 193 | if not defined the defaultValue for the label will be 0. When a |
| 194 | defaultValue is defined, that value will get set in the Reply dialog |
| 195 | by default. |
| 196 | |
| 197 | A defaultValue can be set to a score that is outside of the permissible |
| 198 | range for a user. In that case the score that will get set in the Reply |
| 199 | box will be either the lowest or highest score in the permissible range. |
| 200 | |
| 201 | |
Edwin Kempin | ba8cdd8 | 2013-04-03 15:35:06 +0200 | [diff] [blame] | 202 | [[label_function]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 203 | === `label.Label-Name.function` |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 204 | |
| 205 | The name of a function for evaluating multiple votes for a label. This |
| 206 | function is only applied if the default submit rule is used for a label. |
| 207 | If you write a link:prolog-cookbook.html#HowToWriteSubmitRules[custom |
| 208 | submit rule] (and do not call the default rule), the function name is |
| 209 | ignored and may be treated as optional. |
| 210 | |
| 211 | Valid values are: |
| 212 | |
| 213 | * `MaxWithBlock` (default) |
| 214 | + |
| 215 | The lowest possible negative value, if present, blocks a submit, while |
| 216 | the highest possible positive value is required to enable submit. There |
| 217 | must be at least one positive value, or else submit will never be |
| 218 | enabled. To permit blocking submits, ensure a negative value is defined. |
| 219 | |
Khai Do | d44ea94 | 2013-07-31 07:45:17 -0700 | [diff] [blame] | 220 | * `AnyWithBlock` |
| 221 | + |
Maxime Guerreiro | c275089 | 2018-03-16 15:05:36 +0100 | [diff] [blame] | 222 | The label is not mandatory but the lowest possible negative value, |
| 223 | if present, blocks a submit. To permit blocking submits, ensure that a |
| 224 | negative value is defined. |
Khai Do | d44ea94 | 2013-07-31 07:45:17 -0700 | [diff] [blame] | 225 | |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 226 | * `MaxNoBlock` |
| 227 | + |
| 228 | The highest possible positive value is required to enable submit, but |
| 229 | the lowest possible negative value will not block the change. |
| 230 | |
| 231 | * `NoBlock`/`NoOp` |
| 232 | + |
| 233 | The label is purely informational and values are not considered when |
| 234 | determining whether a change is submittable. |
| 235 | |
Nasser Grainawi | 240ea29 | 2015-11-09 09:56:56 -0800 | [diff] [blame] | 236 | * `PatchSetLock` |
| 237 | + |
| 238 | The `PatchSetLock` function provides a locking mechanism for patch |
| 239 | sets. This function's values are not considered when determining |
| 240 | whether a change is submittable. When set, no new patchsets can be |
Han-Wen Nienhuys | 159f03b | 2018-08-07 19:26:58 +0200 | [diff] [blame] | 241 | created and rebase and abandon are blocked. This is useful to prevent |
| 242 | updates to a change while (potentially expensive) CI |
| 243 | validation is running. |
Nasser Grainawi | 240ea29 | 2015-11-09 09:56:56 -0800 | [diff] [blame] | 244 | + |
| 245 | This function is designed to allow overlapping locks, so several lock |
| 246 | accounts could lock the same change. |
| 247 | + |
| 248 | Allowed range of values are 0 (Patch Set Unlocked) to 1 (Patch Set |
| 249 | Locked). |
| 250 | |
Dave Borowitz | 20d71e5 | 2016-11-15 17:02:16 -0800 | [diff] [blame] | 251 | [[label_allowPostSubmit]] |
| 252 | === `label.Label-Name.allowPostSubmit` |
| 253 | |
| 254 | If true, the label may be voted on for changes that have already been |
| 255 | submitted. If false, the label will not appear in the UI and will not |
| 256 | be accepted when reviewing a closed change. |
| 257 | |
| 258 | In either case, voting on a label after submission is only permitted if |
| 259 | the new vote is at least as high as the old vote by that user. This |
| 260 | avoids creating the false impression that a post-submit vote can change |
| 261 | the past and affect submission somehow. |
| 262 | |
| 263 | Defaults to true. |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 264 | |
| 265 | [[label_copyMinScore]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 266 | === `label.Label-Name.copyMinScore` |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 267 | |
| 268 | If true, the lowest possible negative value for the label is copied |
Marco Miller | 5f83471 | 2015-03-13 17:20:44 -0400 | [diff] [blame] | 269 | forward when a new patch set is uploaded. Defaults to false, except |
| 270 | for All-Projects which has it true by default. |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 271 | |
Shawn Pearce | a7c4a3a | 2013-03-26 15:58:51 -0400 | [diff] [blame] | 272 | [[label_copyMaxScore]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 273 | === `label.Label-Name.copyMaxScore` |
Shawn Pearce | a7c4a3a | 2013-03-26 15:58:51 -0400 | [diff] [blame] | 274 | |
| 275 | If true, the highest possible positive value for the label is copied |
| 276 | forward when a new patch set is uploaded. This can be used to enable |
| 277 | sticky approvals, reducing turn-around for trivial cleanups prior to |
Marco Miller | 5f83471 | 2015-03-13 17:20:44 -0400 | [diff] [blame] | 278 | submitting a change. Defaults to false. |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 279 | |
Maxime Guerreiro | afda80f | 2018-05-25 09:38:35 +0000 | [diff] [blame] | 280 | [[label_copyAllScoresOnMergeFirstParentUpdate]] |
| 281 | === `label.Label-Name.copyAllScoresOnMergeFirstParentUpdate` |
Dariusz Luksza | cedbbee | 2016-01-29 12:06:20 +0100 | [diff] [blame] | 282 | |
| 283 | This policy is useful if you don't want to trigger CI or human |
| 284 | verification again if your target branch moved on but the feature |
| 285 | branch being merged into the target branch did not change. It only |
| 286 | applies if the patch set is a merge commit. |
| 287 | |
| 288 | If true, all scores for the label are copied forward when a new |
| 289 | patch set is uploaded that is a new merge commit which only |
Dave Borowitz | 2878bb5 | 2016-02-08 09:44:32 -0500 | [diff] [blame] | 290 | differs from the previous patch set in its first parent, or has |
| 291 | identical parents. The first parent would be the parent of the merge |
| 292 | commit that is part of the change's target branch, whereas the other |
| 293 | parent(s) refer to the feature branch(es) to be merged. |
| 294 | |
Dariusz Luksza | cedbbee | 2016-01-29 12:06:20 +0100 | [diff] [blame] | 295 | Defaults to false. |
| 296 | |
Edwin Kempin | f5c0841 | 2013-09-18 09:41:01 +0200 | [diff] [blame] | 297 | [[label_copyAllScoresOnTrivialRebase]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 298 | === `label.Label-Name.copyAllScoresOnTrivialRebase` |
Edwin Kempin | f5c0841 | 2013-09-18 09:41:01 +0200 | [diff] [blame] | 299 | |
| 300 | If true, all scores for the label are copied forward when a new patch |
| 301 | set is uploaded that is a trivial rebase. A new patch set is considered |
| 302 | as trivial rebase if the commit message is the same as in the previous |
| 303 | patch set and if it has the same code delta as the previous patch set. |
Dave Borowitz | 2878bb5 | 2016-02-08 09:44:32 -0500 | [diff] [blame] | 304 | This is the case if the change was rebased onto a different parent, or |
| 305 | if the parent did not change at all. |
| 306 | |
Edwin Kempin | f5c0841 | 2013-09-18 09:41:01 +0200 | [diff] [blame] | 307 | This can be used to enable sticky approvals, reducing turn-around for |
Zalan Blenessy | ae47686 | 2015-02-13 14:06:57 +0100 | [diff] [blame] | 308 | trivial rebases prior to submitting a change. |
Edwin Kempin | 09f7f7b | 2015-04-28 10:43:26 +0200 | [diff] [blame] | 309 | For the pre-installed Code-Review label this is enabled by default. |
Dave Borowitz | 2878bb5 | 2016-02-08 09:44:32 -0500 | [diff] [blame] | 310 | |
Zalan Blenessy | ae47686 | 2015-02-13 14:06:57 +0100 | [diff] [blame] | 311 | Defaults to false. |
Edwin Kempin | f5c0841 | 2013-09-18 09:41:01 +0200 | [diff] [blame] | 312 | |
Edwin Kempin | 54122d3 | 2013-09-18 13:46:14 +0200 | [diff] [blame] | 313 | [[label_copyAllScoresIfNoCodeChange]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 314 | === `label.Label-Name.copyAllScoresIfNoCodeChange` |
Edwin Kempin | 54122d3 | 2013-09-18 13:46:14 +0200 | [diff] [blame] | 315 | |
| 316 | If true, all scores for the label are copied forward when a new patch |
Zalan Blenessy | ae47686 | 2015-02-13 14:06:57 +0100 | [diff] [blame] | 317 | set is uploaded that has the same parent tree as the previous patch |
Edwin Kempin | 54122d3 | 2013-09-18 13:46:14 +0200 | [diff] [blame] | 318 | set and the same code delta as the previous patch set. This means only |
| 319 | the commit message is different. This can be used to enable sticky |
| 320 | approvals on labels that only depend on the code, reducing turn-around |
| 321 | if only the commit message is changed prior to submitting a change. |
Gert van Dijk | bc683f2 | 2017-08-28 01:30:47 +0200 | [diff] [blame] | 322 | For the Verified label that is optionally installed by the |
| 323 | link:pgm-init.html[init] site program this is enabled by default. |
Dave Borowitz | 2878bb5 | 2016-02-08 09:44:32 -0500 | [diff] [blame] | 324 | |
Edwin Kempin | 54122d3 | 2013-09-18 13:46:14 +0200 | [diff] [blame] | 325 | Defaults to false. |
| 326 | |
Zalan Blenessy | ae47686 | 2015-02-13 14:06:57 +0100 | [diff] [blame] | 327 | [[label_copyAllScoresIfNoChange]] |
| 328 | === `label.Label-Name.copyAllScoresIfNoChange` |
| 329 | |
| 330 | If true, all scores for the label are copied forward when a new patch |
| 331 | set is uploaded that has the same parent tree, code delta, and commit |
| 332 | message as the previous patch set. This means that only the patch |
| 333 | set SHA1 is different. This can be used to enable sticky |
| 334 | approvals, reducing turn-around for this special case. |
| 335 | It is recommended to leave this enabled for both Verified and |
Dave Borowitz | 2878bb5 | 2016-02-08 09:44:32 -0500 | [diff] [blame] | 336 | Code-Review labels. |
| 337 | |
| 338 | Defaults to true. |
Zalan Blenessy | ae47686 | 2015-02-13 14:06:57 +0100 | [diff] [blame] | 339 | |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 340 | [[label_canOverride]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 341 | === `label.Label-Name.canOverride` |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 342 | |
| 343 | If false, the label cannot be overridden by child projects. Any |
| 344 | configuration for this label in child projects will be ignored. Defaults |
| 345 | to true. |
| 346 | |
Bruce Zu | 9b22c3a | 2013-09-06 01:23:03 +0800 | [diff] [blame] | 347 | [[label_branch]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 348 | === `label.Label-Name.branch` |
Bruce Zu | 9b22c3a | 2013-09-06 01:23:03 +0800 | [diff] [blame] | 349 | |
| 350 | By default a given project's label applicable scope is all changes |
| 351 | on all branches of this project and its child projects. |
| 352 | |
| 353 | Label's applicable scope can be branch specific via configuration. |
| 354 | E.g. create a label `Video-Qualify` on parent project and configure |
| 355 | the `branch` as: |
| 356 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 357 | ---- |
Bruce Zu | 9b22c3a | 2013-09-06 01:23:03 +0800 | [diff] [blame] | 358 | [label "Video-Qualify"] |
| 359 | branch = refs/heads/video-1.0/* |
| 360 | branch = refs/heads/video-1.1/Kino |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 361 | ---- |
Bruce Zu | 9b22c3a | 2013-09-06 01:23:03 +0800 | [diff] [blame] | 362 | |
| 363 | Then *only* changes in above branch scope of parent project and child |
| 364 | projects will be affected by `Video-Qualify`. |
| 365 | |
Michael Ochmann | 8129ece | 2016-07-08 11:25:25 +0200 | [diff] [blame] | 366 | [NOTE] |
| 367 | The `branch` is independent from the branch scope defined in `access` |
Bruce Zu | 9b22c3a | 2013-09-06 01:23:03 +0800 | [diff] [blame] | 368 | parts in `project.config` file. That means from the UI a user can always |
| 369 | assign permissions for that label on a branch, but this permission is then |
| 370 | ignored if the label doesn't apply for that branch. |
Luca Milanesio | 4ab7582 | 2017-05-31 17:44:49 +0100 | [diff] [blame] | 371 | Additionally, the `branch` modifier has no effect when the submit rule |
| 372 | is customized in the rules.pl of the project or inherited from parent projects. |
Patrick Hiesel | 7e50ec9 | 2018-07-09 16:06:21 +0200 | [diff] [blame] | 373 | Branch can be a ref pattern similar to what is documented |
| 374 | link:access-control.html#reference[here], but must not contain `${username}` or |
| 375 | `${shardeduserid}`. |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 376 | |
Patrick Hiesel | 12c87c7 | 2018-09-03 13:19:08 +0200 | [diff] [blame] | 377 | [[label_ignoreSelfApproval]] |
| 378 | === `label.Label-Name.ignoreSelfApproval` |
| 379 | |
| 380 | If true, the label may be voted on by the uploader of the latest patch set, |
| 381 | but their approval does not make a change submittable. Instead, a |
| 382 | non-uploader who has the right to vote has to approve the change. |
| 383 | |
| 384 | Defaults to false. |
| 385 | |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 386 | [[label_example]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 387 | === Example |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 388 | |
| 389 | To define a new 3-valued category that behaves exactly like `Verified`, |
| 390 | but has different names/labels: |
| 391 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 392 | ---- |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 393 | [label "Copyright-Check"] |
Edwin Kempin | ba8cdd8 | 2013-04-03 15:35:06 +0200 | [diff] [blame] | 394 | function = MaxWithBlock |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 395 | value = -1 Do not have copyright |
Dave Borowitz | 085209e | 2017-11-20 15:18:15 -0500 | [diff] [blame] | 396 | value = 0 No score |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 397 | value = +1 Copyright clear |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 398 | ---- |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 399 | |
| 400 | The new column will appear at the end of the table, and `-1 Do not have |
| 401 | copyright` will block submit, while `+1 Copyright clear` is required to |
| 402 | enable submit. |
Edwin Kempin | 5beb89d | 2013-03-15 08:03:12 +0100 | [diff] [blame] | 403 | |
Khai Do | 4c91b00 | 2014-04-06 23:27:43 -0700 | [diff] [blame] | 404 | === Default Value Example |
| 405 | |
| 406 | This example attempts to describe how a label default value works with the |
| 407 | user permissions. Assume the configuration below. |
| 408 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 409 | ---- |
Khai Do | 4c91b00 | 2014-04-06 23:27:43 -0700 | [diff] [blame] | 410 | [access "refs/heads/*"] |
| 411 | label-Snarky-Review = -3..+3 group Administrators |
| 412 | label-Snarky-Review = -2..+2 group Project Owners |
| 413 | label-Snarky-Review = -1..+1 group Registered Users |
| 414 | [label "Snarky-Review"] |
| 415 | value = -3 Ohh, hell no! |
| 416 | value = -2 Hmm, I'm not a fan |
| 417 | value = -1 I'm not sure I like this |
Dave Borowitz | 085209e | 2017-11-20 15:18:15 -0500 | [diff] [blame] | 418 | value = 0 No score |
Khai Do | 4c91b00 | 2014-04-06 23:27:43 -0700 | [diff] [blame] | 419 | value = +1 I like, but need another to like it as well |
| 420 | value = +2 Hmm, this is pretty nice |
| 421 | value = +3 Ohh, hell yes! |
| 422 | defaultValue = -3 |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 423 | ---- |
Khai Do | 4c91b00 | 2014-04-06 23:27:43 -0700 | [diff] [blame] | 424 | |
| 425 | Upon clicking the Reply button: |
Edwin Kempin | ec7397e | 2015-04-07 09:34:56 +0200 | [diff] [blame] | 426 | |
Khai Do | 4c91b00 | 2014-04-06 23:27:43 -0700 | [diff] [blame] | 427 | * Administrators have all scores (-3..+3) available, -3 is set as the default. |
| 428 | * Project Owners have limited scores (-2..+2) available, -2 is set as the default. |
| 429 | * Registered Users have limited scores (-1..+1) available, -1 is set as the default. |
| 430 | |
Alexandre Philbert | b7d3c72 | 2016-01-28 09:04:06 -0500 | [diff] [blame] | 431 | === Patch Set Lock Example |
| 432 | |
| 433 | This example shows how a label can be configured to have a standard patch set lock. |
| 434 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 435 | ---- |
Alexandre Philbert | b7d3c72 | 2016-01-28 09:04:06 -0500 | [diff] [blame] | 436 | [access "refs/heads/*"] |
| 437 | label-Patch-Set-Lock = +0..+1 group Administrators |
| 438 | [label "Patch-Set-Lock"] |
| 439 | function = PatchSetLock |
| 440 | value = 0 Patch Set Unlocked |
| 441 | value = +1 Patch Set Locked |
| 442 | defaultValue = 0 |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 443 | ---- |
Alexandre Philbert | b7d3c72 | 2016-01-28 09:04:06 -0500 | [diff] [blame] | 444 | |
Edwin Kempin | 5beb89d | 2013-03-15 08:03:12 +0100 | [diff] [blame] | 445 | GERRIT |
| 446 | ------ |
| 447 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 448 | |
| 449 | SEARCHBOX |
| 450 | --------- |