Include details of failed check into checks notification email

If a check fails and posting it causes the combined check state to be
updated

a) from anything to FAILED
b) from anything but FAILED to WARNING

the user likely wants to know which check failed, hence the details of
this check should be included into the combined check state updated
email notifications.

This means check details are always included if the combined check state
is updated to a less good value (from anything to FAILED, from anything
but FAILED to WARNING). An update of the combined check state from
FAILED to WARNING is never caused by posting a failed check (but e.g, by
rerunning a FAILED required checker or updating the check state for a
required checker from FAILED to SUCCESSFUL). Hence in this case no check
details are included.

The logic to include check details into the notification emails is fully
implemented in the soy templates. For this we provide more data (old
combined check state, checker data, check data) to the template. This
has the advantage that everyone can easily modify and adapt the email
contents.

Since checkers and checks have some optional fields (checker URL, check
message, check URL), which should be included into the email if they are
present, the conditional logic in the soy templates is a little more
complex, hence there are dedeciated tests for these optional fields that
cover this logic.

Bug: Issue 11730
Change-Id: I797d895d9c12ed7d82b3d7d55c81d5117762b998
Signed-off-by: Edwin Kempin <ekempin@google.com>
5 files changed
tree: e91d82ef94d14bde5954e72ceff053f51c233762
  1. gr-checks/
  2. java/
  3. javatests/
  4. proto/
  5. resources/
  6. test/
  7. .gitignore
  8. bower.json
  9. BUILD
  10. LICENSE
  11. README.md
README.md

Gerrit Code Review Checks Plugin

This plugin provides a unified experience for checkers (CI systems, static analyzers, etc.) to integrate with Gerrit Code Review.

This plugin uses polymer-cli to test.

After bower install, running polymer test -l chrome will run all tests in Chrome, and running polymer serve and navigating to http://127.0.0.1:8081/components/checks/gr-checks/gr-checks-view_test.html allows for manual debugging.