reviewkeys: add 'message' parameter

Add 'message' optional parameter to reviewkeys which can be use to have
a shortcut to leave recheck in reviews (example of use case).

reviewkeys:
  - key: 'meta 4'
    approvals: []
    message: 'recheck'

It updates the doc and also the openstack-gertty.yaml since it can be
useful for all OpenStack reviewers.

Change-Id: I81f3cc8374fe1872efb71d4b2bc1c647b118d43f
This commit is contained in:
Emilien Macchi 2017-12-22 10:01:54 -08:00
parent cb12ada037
commit cbe4d9322f
4 changed files with 15 additions and 3 deletions

View File

@ -380,12 +380,16 @@ Reviewkeys appear in the help text for the change screen.
**value**
The value for this approval.
**message**
Optional, it can be used to include a message during the review.
**submit**
Set this to `true` to instruct Gerrit to submit the change when
this reviewkey is activated.
The following example includes a reviewkey that clears all labels, as
well as one that leaves a +1 "Code-Review" approval.
The following example includes a reviewkey that clears all labels,
one that leaves a +1 "Code-Review" approval and another one that
leaves 'recheck' on a review.
.. code-block: yaml
@ -396,6 +400,9 @@ well as one that leaves a +1 "Code-Review" approval.
approvals:
- category: 'Code-Review'
value: 1
- key: 'meta 2'
approvals: []
message: 'recheck'
General Options
+++++++++++++++

View File

@ -140,3 +140,6 @@ reviewkeys:
value: 2
- category: 'Workflow'
value: 1
- key: 'meta 4'
approvals: []
message: "recheck"

View File

@ -93,6 +93,7 @@ class ConfigSchema(object):
v.Required('value'): int}
reviewkey = {v.Required('approvals'): [reviewkey_approval],
v.Optional('message'): str,
'submit': bool,
v.Required('key'): str}

View File

@ -1155,8 +1155,9 @@ class ChangeView(urwid.WidgetWrap):
self.app.log.debug("Reviewkey %s with approvals %s" %
(reviewkey['key'], approvals))
row = self.revision_rows[self.last_revision_key]
message = reviewkey.get('message', '')
submit = reviewkey.get('submit', False)
self.saveReview(row.revision_key, approvals, '', True, submit)
self.saveReview(row.revision_key, approvals, message, True, submit)
def saveReview(self, revision_key, approvals, message, upload, submit):
message_keys = self.app.saveReviews([revision_key], approvals,