Skip to content

Commit

Permalink
Make BZ bug statuses configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansb committed Jul 23, 2015
1 parent 2be150f commit ac30a22
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
7 changes: 7 additions & 0 deletions bugwarrior/docs/services/bugzilla.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ There is an option to ignore bugs that you are only cc'd on::
But this will continue to include bugs that you reported, regardless of
whether they are assigned to you.

If your bugzilla "actionable" bugs only include ON_QA, FAILS_QA, PASSES_QA, and POST::

bugzilla.open_statuses = ON_QA,FAILS_QA,PASSES_QA,POST

This won't create tasks for bugs in other states. The default open statuses:
"NEW,ASSIGNED,NEEDINFO,ON_DEV,MODIFIED,POST,REOPENED,ON_QA,FAILS_QA,PASSES_QA"

If the filtering options are not sufficient to find the set of bugs you'd like,
you can tell Bugwarrior exactly which bugs to sync by pasting a full query URL
from your browser into the ``bugzilla.query_url`` option::
Expand Down
31 changes: 18 additions & 13 deletions bugwarrior/services/bz.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,24 @@ def get_default_description(self):
)


_open_statuses = [
'NEW',
'ASSIGNED',
'NEEDINFO',
'ON_DEV',
'MODIFIED',
'POST',
'REOPENED',
'ON_QA',
'FAILS_QA',
'PASSES_QA',
]


class BugzillaService(IssueService):
ISSUE_CLASS = BugzillaIssue
CONFIG_PREFIX = 'bugzilla'

OPEN_STATUSES = [
'NEW',
'ASSIGNED',
'NEEDINFO',
'ON_DEV',
'MODIFIED',
'POST',
'REOPENED',
'ON_QA',
'FAILS_QA',
'PASSES_QA',
]
COLUMN_LIST = [
'id',
'status',
Expand All @@ -95,6 +97,9 @@ def __init__(self, *args, **kw):
self.ignore_cc = self.config_get_default('ignore_cc', default=False,
to_type=lambda x: x == "True")
self.query_url = self.config_get_default('query_url', default=None)
self.open_statuses = self.config_get_default(
'open_statuses', _open_statuses, to_type=lambda x: x.split(','))
log.name(self.target).debug(" filtering on statuses: {0}", self.open_statuses)

# So more modern bugzilla's require that we specify
# query_format=advanced along with the xmlrpc request.
Expand Down Expand Up @@ -183,7 +188,7 @@ def issues(self):
else:
query = dict(
column_list=self.COLUMN_LIST,
bug_status=self.OPEN_STATUSES,
bug_status=self.open_statuses,
email1=email,
emailreporter1=1,
emailassigned_to1=1,
Expand Down

0 comments on commit ac30a22

Please sign in to comment.