Browse Source

Document size-column setting

And change the value from splitGraph to split-graph for consistency.

Change-Id: Ia98aac367702933b205b4d8cea5b5579ebd9a062
changes/75/549175/2
James E. Blair 4 years ago
parent
commit
57626e4f3b
  1. 36
      doc/source/configuration.rst
  2. 9
      examples/openstack-gertty.yaml
  3. 9
      examples/reference-gertty.yaml
  4. 2
      gertty/config.py
  5. 2
      gertty/view/change_list.py

36
doc/source/configuration.rst

@ -431,3 +431,39 @@ General Options
following line. The time interval is specified in the same way as
the "age:" term in Gerrit's search syntax. To disable it
altogether, set the value to the empty string.
**size-column**
By default, the size column is a pair of stacked logarithmic graphs.
The top, red graph represents the number of lines removed, the
bottom, green graph the number added. For an alternate
representation, use this setting.
**type**
A string with one of the following values:
**graph**
The default stacked bar graphs.
**split-graph**
Rather than vertically stacked, the bar graphs are side-by-side
**number**
A single number which represents the number of lines changed
(added and removed).
**thresholds**
A list of integers to determine the magnitude of the graph
increments, or the color coding of the number. If the type is
``graph`` or ``split-graph``, the list should be four elements
long. The default is 1, 10, 100, 1000 for a logarithmic
representation. If the type is ``number``, the list should be
eight elements long; the default in that case is 1, 10, 100, 200,
400, 600, 800, 1000.
Example:
.. code-block: yaml
size-column:
type: graph
thresholds: [1, 10, 100, 1000]

9
examples/openstack-gertty.yaml

@ -143,12 +143,3 @@ reviewkeys:
- key: 'meta 4'
approvals: []
message: "recheck"
# 'size-column' is a set of customize parameters for the 'Size' column
# on your dashboard.
# 'type' must be 'graph' or 'number'. Default is 'graph'.
# 'thresholds' is for bar graphs width (when graph) or color styles
# (when number).
size-column:
type: 'graph'
thresholds: [1, 10, 100, 1000]

9
examples/reference-gertty.yaml

@ -246,3 +246,12 @@ reviewkeys:
- category: 'Code-Review'
value: 2
submit: True
# 'size-column' is a set of customize parameters for the 'Size' column
# on your dashboard.
# 'type' must be 'graph', 'split-graph' or 'number'. Default is 'graph'.
# 'thresholds' is for bar graphs width (when graph) or color styles
# (when number).
# size-column:
# type: 'graph'
# thresholds: [1, 10, 100, 1000]

2
gertty/config.py

@ -112,7 +112,7 @@ class ConfigSchema(object):
keymaps = [keymap]
thresholds = [int, int, int, int, int, int, int, int]
size_column = {v.Required('type'): v.Any('graph', 'splitGraph', 'number',
size_column = {v.Required('type'): v.Any('graph', 'split-graph', 'number',
'disabled', None),
v.Optional('thresholds'): thresholds}

2
gertty/view/change_list.py

@ -279,7 +279,7 @@ class ChangeRow(urwid.Button, ChangeListColumns):
elif (total_added_removed >= thresholds[0]):
size_style = 'line-count-threshold-1'
self.size.set_text((size_style, str(total_added_removed)))
elif self.app.config.size_column['type'] == 'splitGraph':
elif self.app.config.size_column['type'] == 'split-graph':
self.size.set_text(self._makeSizeSplitGraph(total_added,
total_removed))
else:

Loading…
Cancel
Save