Allow plugins to define custom data in SubmitRequirement

Replace the raw short/long reasons of SubmitRequirement with a dynamic
type and map, allowing for more powerful implementations later.
Also remove the label field, superseeded by the data Map.

Use AutoValues for the SubmitRequirement class, as it is marked
GwtIncompatible.

The idea behind this change is to provide a future proof API that
both plugins and end users will enjoy. A user interface is being
worked on, and will benefit of these changes.

Change-Id: I030609cd164d308f2231a2abba2eb16b09524b7f
This commit is contained in:
Maxime Guerreiro
2018-04-03 17:26:28 +00:00
parent 3817100d4a
commit 36c9725f3f
8 changed files with 106 additions and 78 deletions

View File

@@ -185,14 +185,16 @@ in order for the change to be submittable.
[[requirement]]
== requirement
Information about a requirement (not met) in order to submit a change.
Information about a requirement in order to submit a change.
shortReason:: A short description of the requirement (a hint).
fallbackText:: A human readable description of the requirement.
fullReason:: A longer and descriptive message explaining what needs to
be changed to meet the requirement.
type:: Alphanumerical (plus hyphens or underscores) string to identify what the requirement is and
why it was triggered. Can be seen as a class: requirements sharing the same type were created for a
similar reason, and the data structure will follow one set of rules.
label:: (Optional) The name of the linked label, if set by a pre-submit rule.
data:: (Optional) Additional key-value data linked to this requirement. This is used in templates to
render rich status messages.
[[label]]
== label