Browse Source

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
changes/72/529872/4
Emilien Macchi 4 years ago
parent
commit
cbe4d9322f
  1. 11
      doc/source/configuration.rst
  2. 3
      examples/openstack-gertty.yaml
  3. 1
      gertty/config.py
  4. 3
      gertty/view/change.py

11
doc/source/configuration.rst

@ -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
+++++++++++++++

3
examples/openstack-gertty.yaml

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

1
gertty/config.py

@ -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}

3
gertty/view/change.py

@ -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,

Loading…
Cancel
Save