Make NoBlock and NoOp approval category functions work

The approval category functions NoBlock and NoOp have not worked
since the integration of Prolog, and this commit makes a number of
changes to remedy this.

MAY is being introduced as a new submit record status to complement
OK, REJECT, NEED, and IMPOSSIBLE. This allows the expression of
approval categories (labels) that are optional, i.e. could either be
set or unset without ever influencing whether the change could be
submitted. Previously there was no way to express this property in
the submit record.

This enables the NoBlock and NoOp approval category functions to work
as they now emit may() terms from the Prolog rules. Previously they
returned ok() terms lacking a nested user term, leading to exceptions
in code that expected a user context if the label was OK.

A side-effect is the addition of an "optional" boolean property of
the LabelInfo JSON objects, indicating whether the label in question
is may be omitted and still submit the change.

Change-Id: I02bedf892564f759418fa7427ac226970f9a6ef5
This commit is contained in:
Magnus Bäck
2012-05-10 11:33:47 -07:00
committed by Shawn O. Pearce
parent 277ce33c33
commit a6ce960fa1
9 changed files with 47 additions and 17 deletions

View File

@@ -67,6 +67,12 @@ public class SubmitRecord {
*/
NEED,
/**
* The label may be set, but it's neither necessary for submission
* nor does it block submission if set.
*/
MAY,
/**
* The label is required for submission, but is impossible to complete.
* The likely cause is access has not been granted correctly by the