config-submit-requirements.txt: Rework the decription of the label operator
* The existing description put too much focus on the
'user=non_contributor' argument, which is only relevant in special
cases. This was especially confusing if you followed the link in the
section about ignoreSelfApproval that gives an example with
`user=non_uploader' that was not mentioned in the label operator
section.
* Make the label operator section more generic and list the most common
ways how it is used in submit requirements.
* Link to the labels section of the user search documentation, instead
of just to the user search documentation.
Note, the link text for "user=non_uploader" must be quoted to prevent
that the text is interpreted as key-value property for the link.
Release-Notes: skip
Bug: Issue b/312890385
Change-Id: I9f1e6ed8edf5a34bfdc1b86fa8b8845472f56615
Signed-off-by: Edwin Kempin <ekempin@google.com>
diff --git a/Documentation/config-submit-requirements.txt b/Documentation/config-submit-requirements.txt
index 5f33cd6..48f084a 100644
--- a/Documentation/config-submit-requirements.txt
+++ b/Documentation/config-submit-requirements.txt
@@ -381,13 +381,25 @@
pattern.
[[operator_label]]
-label:labelName=+1,user=non_contributor::
+label:LabelExpression::
+
-Submit requirements support an additional `user=non_contributor` argument for
-labels that returns true if the change has a label vote matching the specified
-value and the vote is applied from a gerrit account that's not the uploader,
-author or committer of the latest patchset. See the documentation for the labels
-operator in the link:user-search.html[user search] page.
+The `label` operator allows to match changes that have votes matching the given
+`LabelExpression`. The `LabelExpression` can be anything that's supported for
+the link:user-search.html#labels[label] query operator.
++
+In submit requirements this operator is often used to check that:
++
+--
+* a label was approved: `label:My-Label=MAX`
+* a label has no veto: `-label:My-Label=MIN`
+* a label was not self-approved: `label:My-Label=MAX,user=non_uploader`
+--
++
+If used in submit requirement expressions, this operator supports an additional
+`user=non_contributor` argument. This argument works similar to the
+link:user-search.html#non_uploader["user=non_uploader"] argument and returns
+true if the change has a matching label vote that is applied by a user that's
+not the uploader, author or committer of the latest patchset.
[[unsupported_operators]]
=== Unsupported Operators
diff --git a/Documentation/user-search.txt b/Documentation/user-search.txt
index 0744ded..1095002 100644
--- a/Documentation/user-search.txt
+++ b/Documentation/user-search.txt
@@ -848,6 +848,7 @@
The special "owner" parameter corresponds to the change owner. Matches
all changes that have a +2 vote from the change owner.
+[[non_uploader]]
`label:Code-Review=+2,user=non_uploader`::
`label:Code-Review=ok,user=non_uploader`::
`label:Code-Review=+2,non_uploader`::