Function "MaxWithBlock"

475 views
Skip to first unread message

Doruntine Fejzovski

unread,
Sep 29, 2023, 11:15:44 AM9/29/23
to Repo and Gerrit Discussion
Hello,

I want to change the project.config file for Gerrit by adding a new label


```
[label "Proper-Code"]
        description = Standards and programmation rules respected
        function = MaxWithBlock
        value = -1 Fails
        value = 0 No score
        value = +1 Verified
        defaultValue = 0

```
Unfortunately I get the following error `Value 'MaxWithBlock' of 'label.Proper-Code.function' is not allowed and cannot be set. Label functions can only be set to {NO_BLOCK, NO_OP, PATCH_SET_LOCK}. Use submit requirements instead of label functions.`

I saw that `label.Label-Name.function` is deprecated and that it is advised to set the function to `NoBlock` and add a `submit-requirement` for the label.

Is it how the problem should be fixed ? What can be the best replacement for `MaxWithBlock` ?

Also every other label we have is with `function = MaxWithBlock` so do I have to change every other labels with `NoBlock` submit requirements ?

I tried to take off `function = MaxWithBlock` since this is the default value but I still got the same error message.

```
[label "Proper-Code"]
        description = Standards and programmation rules respected
        value = -1 Fails
        value = 0 No score
        value = +1 Verified
        defaultValue = 0

```

Does someone know how to change the project.config file ?

Clark Boylan

unread,
Sep 29, 2023, 12:36:29 PM9/29/23
to Doruntine Fejzovski, Repo and Gerrit Discussion
Yes, you need to set the function on the label to NoOp and add a
submit requirement to enforce the rule. On our Verified label we use
this submit requirement in place of MaxWithBlock: `label:Verified=MAX
AND -label:Verified=MIN`. This means the maximum value is required and
the minimum value cannot be set.

Clark
Reply all
Reply to author
Forward
0 new messages