Fix review labels with AnyWithBlock function The review labels with AnyWithBlock with 0 and +1 values blocked submit when reviewers were added. According to the documentation, a label with the function AnyWithBlock only blocks submit when a negative value is defined. Also, the bug is reproduced only when reviewers are added. After this fix, the review labels with AnyWithBlock with 0 and +1 values no longer block submit in these conditions. In addition to the acceptance test, it is tested manually using the following steps: 1. Add a label with function AnyWithBlock to a project without defining a negative value 2. Create a change in the project 3. Add a reviewer to the change 4. Refresh the browser 5. Verify that the label is not blocking submit 6. Add more reviewers to the change 7. Refresh the browser again 8. Verify that the label is not blocking submit Also, this fix discovered a new bug related to the label coloring. This new bug is reported as Issue 3592 and is not being fixed in this commit. Bug: Issue 3574 Change-Id: I314ce7e2859e29a5c128058042d2a9df1b4ef1e7
diff --git a/gerrit-server/src/main/prolog/gerrit_common.pl b/gerrit-server/src/main/prolog/gerrit_common.pl index 2a45819..9a4e77c 100644 --- a/gerrit-server/src/main/prolog/gerrit_common.pl +++ b/gerrit-server/src/main/prolog/gerrit_common.pl
@@ -283,6 +283,7 @@ %% - The maximum is never used. %% any_with_block(Label, Min, reject(Who)) :- + Min < 0, check_label_range_permission(Label, Min, ok(Who)), ! .