Skip to content

Commit 14849bd

Browse files
committed
cli: Add modify --minor-update option
This adds support for the minor_update bugzilla option that is in bugzilla.git: bugzilla/bugzilla@1d96fa1 It disables sending email notifications for the bug change Resolves: #94 Signed-off-by: Cole Robinson <[email protected]>
1 parent 60b42ae commit 14849bd

6 files changed

Lines changed: 16 additions & 2 deletions

File tree

bugzilla/_cli.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ def _parser_add_bz_fields(rootp, command):
231231
p.add_argument('--cc', action="append", help="CC list")
232232
p.add_argument('-a', '--assigned_to', '--assignee', help="Bug assignee")
233233
p.add_argument('-q', '--qa_contact', help='QA contact')
234+
if cmd_modify:
235+
p.add_argument("--minor-update", action="store_true",
236+
help="Request bugzilla to not send any "
237+
"email about this change")
234238

235239
if not cmd_new:
236240
p.add_argument('-f', '--flag', action='append',
@@ -1028,6 +1032,8 @@ def _do_modify(bz, parser, opt):
10281032
update_opts["flags"] = flags
10291033
if opt.comment_tag:
10301034
update_opts["comment_tags"] = opt.comment_tag
1035+
if opt.minor_update:
1036+
update_opts["minor_update"] = opt.minor_update
10311037

10321038
update = bz.build_update(**update_opts)
10331039

bugzilla/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,8 @@ def build_update(self,
14441444
internal_whiteboard=None,
14451445
sub_component=None,
14461446
flags=None,
1447-
comment_tags=None):
1447+
comment_tags=None,
1448+
minor_update=None):
14481449
"""
14491450
Returns a python dict() with properly formatted parameters to
14501451
pass to update_bugs(). See bugzilla documentation for the format
@@ -1531,6 +1532,7 @@ def c(val):
15311532
s("work_time", work_time, float)
15321533
s("flags", flags)
15331534
s("comment_tags", comment_tags, listify)
1535+
s("minor_update", minor_update, bool)
15341536

15351537
add_dict("blocks", blocks_add, blocks_remove, blocks_set,
15361538
convert=int)

man/bugzilla.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,10 @@ Reset assignee to component default
396396

397397
Reset QA contact to component default
398398

399+
- ``--minor-update``
400+
401+
Request bugzilla to not send any email about this change
402+
399403

400404
‘new’ specific options
401405
======================

tests/data/mockargs/test_modify5.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
'depends_on': {'add': [2234], 'remove': [2235], 'set': []},
1212
'groups': {'add': ['foogroup']},
1313
'keywords': {'add': ['newkeyword'], 'remove': ['byekeyword'], 'set': []},
14+
'minor_update': True,
1415
'op_sys': 'windows',
1516
'platform': 'mips',
1617
'priority': 'high',

tests/test_cli_modify.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def test_modify(run_cli):
8585
cmd += "--devel_whiteboard =DEVBOARD --internal_whiteboard =INTBOARD "
8686
cmd += "--qa_whiteboard =QABOARD "
8787
cmd += "--comment-tag FOOTAG --field bar=foo "
88+
cmd += "--minor-update "
8889
fakebz = tests.mockbackend.make_bz(rhbz=True,
8990
bug_update_args="data/mockargs/test_modify5.txt",
9091
bug_update_return={})

tests/test_rw_functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def test03NewBugBasic(run_cli, backends):
9696
assert hasattr(bug, "bug_id")
9797

9898
# Close the bug
99-
run_cli("bugzilla modify --close NOTABUG %s" % bug.id, bz)
99+
run_cli("bugzilla modify --close NOTABUG %s --minor-update" % bug.id, bz)
100100
bug.refresh()
101101
assert bug.status == "CLOSED"
102102
assert bug.resolution == "NOTABUG"

0 commit comments

Comments
 (0)