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:
parent
cb12ada037
commit
cbe4d9322f
|
@ -380,12 +380,16 @@ Reviewkeys appear in the help text for the change screen.
|
||||||
**value**
|
**value**
|
||||||
The value for this approval.
|
The value for this approval.
|
||||||
|
|
||||||
|
**message**
|
||||||
|
Optional, it can be used to include a message during the review.
|
||||||
|
|
||||||
**submit**
|
**submit**
|
||||||
Set this to `true` to instruct Gerrit to submit the change when
|
Set this to `true` to instruct Gerrit to submit the change when
|
||||||
this reviewkey is activated.
|
this reviewkey is activated.
|
||||||
|
|
||||||
The following example includes a reviewkey that clears all labels, as
|
The following example includes a reviewkey that clears all labels,
|
||||||
well as one that leaves a +1 "Code-Review" approval.
|
one that leaves a +1 "Code-Review" approval and another one that
|
||||||
|
leaves 'recheck' on a review.
|
||||||
|
|
||||||
.. code-block: yaml
|
.. code-block: yaml
|
||||||
|
|
||||||
|
@ -396,6 +400,9 @@ well as one that leaves a +1 "Code-Review" approval.
|
||||||
approvals:
|
approvals:
|
||||||
- category: 'Code-Review'
|
- category: 'Code-Review'
|
||||||
value: 1
|
value: 1
|
||||||
|
- key: 'meta 2'
|
||||||
|
approvals: []
|
||||||
|
message: 'recheck'
|
||||||
|
|
||||||
General Options
|
General Options
|
||||||
+++++++++++++++
|
+++++++++++++++
|
||||||
|
|
|
@ -140,3 +140,6 @@ reviewkeys:
|
||||||
value: 2
|
value: 2
|
||||||
- category: 'Workflow'
|
- category: 'Workflow'
|
||||||
value: 1
|
value: 1
|
||||||
|
- key: 'meta 4'
|
||||||
|
approvals: []
|
||||||
|
message: "recheck"
|
||||||
|
|
|
@ -93,6 +93,7 @@ class ConfigSchema(object):
|
||||||
v.Required('value'): int}
|
v.Required('value'): int}
|
||||||
|
|
||||||
reviewkey = {v.Required('approvals'): [reviewkey_approval],
|
reviewkey = {v.Required('approvals'): [reviewkey_approval],
|
||||||
|
v.Optional('message'): str,
|
||||||
'submit': bool,
|
'submit': bool,
|
||||||
v.Required('key'): str}
|
v.Required('key'): str}
|
||||||
|
|
||||||
|
|
|
@ -1155,8 +1155,9 @@ class ChangeView(urwid.WidgetWrap):
|
||||||
self.app.log.debug("Reviewkey %s with approvals %s" %
|
self.app.log.debug("Reviewkey %s with approvals %s" %
|
||||||
(reviewkey['key'], approvals))
|
(reviewkey['key'], approvals))
|
||||||
row = self.revision_rows[self.last_revision_key]
|
row = self.revision_rows[self.last_revision_key]
|
||||||
|
message = reviewkey.get('message', '')
|
||||||
submit = reviewkey.get('submit', False)
|
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):
|
def saveReview(self, revision_key, approvals, message, upload, submit):
|
||||||
message_keys = self.app.saveReviews([revision_key], approvals,
|
message_keys = self.app.saveReviews([revision_key], approvals,
|
||||||
|
|
Loading…
Reference in New Issue