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
Emilien Macchi 1 year ago
parent
commit
cbe4d9322f
4 changed files with 15 additions and 3 deletions
  1. 9
    2
      doc/source/configuration.rst
  2. 3
    0
      examples/openstack-gertty.yaml
  3. 1
    0
      gertty/config.py
  4. 2
    1
      gertty/view/change.py

+ 9
- 2
doc/source/configuration.rst View File

@@ -380,12 +380,16 @@ Reviewkeys appear in the help text for the change screen.
380 380
     **value**
381 381
       The value for this approval.
382 382
 
383
+  **message**
384
+    Optional, it can be used to include a message during the review.
385
+
383 386
   **submit**
384 387
     Set this to `true` to instruct Gerrit to submit the change when
385 388
     this reviewkey is activated.
386 389
 
387
-The following example includes a reviewkey that clears all labels, as
388
-well as one that leaves a +1 "Code-Review" approval.
390
+The following example includes a reviewkey that clears all labels,
391
+one that leaves a +1 "Code-Review" approval and another one that
392
+leaves 'recheck' on a review.
389 393
 
390 394
 .. code-block: yaml
391 395
 
@@ -396,6 +400,9 @@ well as one that leaves a +1 "Code-Review" approval.
396 400
        approvals:
397 401
          - category: 'Code-Review'
398 402
            value: 1
403
+     - key: 'meta 2'
404
+       approvals: []
405
+       message: 'recheck'
399 406
 
400 407
 General Options
401 408
 +++++++++++++++

+ 3
- 0
examples/openstack-gertty.yaml View File

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

+ 1
- 0
gertty/config.py View File

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

+ 2
- 1
gertty/view/change.py View File

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

Loading…
Cancel
Save