Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Sep 10, 2015
2 parents 170b45b + 31b1fbb commit 5bee1c4
Show file tree
Hide file tree
Showing 18 changed files with 317 additions and 85 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
1.2.0 ----- Lots of updates from various contributors: - Enable setuptools test command `d38fad025 <https://github.com/ralphbean/bugwarrior/commit/d38fad0256ff76129630cf0c636690e6654c153a>`_ - Merge pull request #222 from koobs/patch-2 `7f9cdce9c <https://github.com/ralphbean/bugwarrior/commit/7f9cdce9cf893bb14bbc917d775010ffb575d7dd>`_ - Added only_if_assigned to gitlab `0f6fea7fc <https://github.com/ralphbean/bugwarrior/commit/0f6fea7fc7d57af6faf7193fc30f36be020f3f3b>`_ - Merge pull request #224 from qwertos/feature-gitlab_only_assigned `156b5a908 <https://github.com/ralphbean/bugwarrior/commit/156b5a908f2a2d16b514a6f5c0bcb3bb812d34b4>`_ - Add a taskwarrior UDA for bugzilla status `2be150f6a <https://github.com/ralphbean/bugwarrior/commit/2be150f6a9e72f7ce9765158eb90b92cba811338>`_ - Make BZ bug statuses configurable `ac30a2241 <https://github.com/ralphbean/bugwarrior/commit/ac30a2241af5fedc4b4c7e382f82511fe1535d2d>`_ - Ooops, add status field to tests `6411e4803 <https://github.com/ralphbean/bugwarrior/commit/6411e48038d25369b9494e36d121d1472265133c>`_ - Merge pull request #226 from ryansb/feature/moarBugzillaStatus `90c81db1b <https://github.com/ralphbean/bugwarrior/commit/90c81db1b12d1adf22b0d7545ca63734103e9375>`_ - [notifications] only_on_new_tasks option `b4a67ebfd <https://github.com/ralphbean/bugwarrior/commit/b4a67ebfd7e1c31ccc51bdd01cf76ef95c765df0>`_ - Merge pull request #228 from devenv/only_on_new_tasks `89ef3d746 <https://github.com/ralphbean/bugwarrior/commit/89ef3d746ed354338486f2bc865cb25a5f9da2fe>`_ - jira estimate UDA `2317a0516 <https://github.com/ralphbean/bugwarrior/commit/2317a0516d3d680291d205b7badaeb78e5ec1799>`_ - Merge pull request #227 from devenv/jira_est `06adc5b16 <https://github.com/ralphbean/bugwarrior/commit/06adc5b166be618641283dff2b85e07cd6d91bb0>`_ - Include an option to disable HTTPS for GitLab. `616a389d7 <https://github.com/ralphbean/bugwarrior/commit/616a389d75900b407ad813739c8ba0eb27e07fff>`_ - Support needinfo bugs where you are not CC/assignee/reporter `8ef53be9f <https://github.com/ralphbean/bugwarrior/commit/8ef53be9f4edc8ba0f9c06135fb98886d049a852>`_ - gitlab: work around gitlab pagination bug `4caaa28ed <https://github.com/ralphbean/bugwarrior/commit/4caaa28edccb5ae1c8f4f83d83594afa3c6d8cb6>`_ - gitlab: add uda for work-in-progress flag `fe940c268 <https://github.com/ralphbean/bugwarrior/commit/fe940c2686632e79acef382fd72b721b2bf5659f>`_ - githubutils: allow getting a key from the result `28e37218c <https://github.com/ralphbean/bugwarrior/commit/28e37218cbccc45c00b77694ab6e4ffb94330013>`_ - github: add involved_issues option `67b93eb6e <https://github.com/ralphbean/bugwarrior/commit/67b93eb6e34d404574ea0c7a91601bbe45d4cb1e>`_ - gitlab: bail on empty or False results `62008a22d <https://github.com/ralphbean/bugwarrior/commit/62008a22d9d9528d5642aa00e7f8c969967c833c>`_ - Only import active Gitlab issues and merge requests `5890fe9ad <https://github.com/ralphbean/bugwarrior/commit/5890fe9ad3dc6a373e4e1ad097219de2d25534f8>`_ - Merge pull request #231 from ryansb/feature/needinfos `6722d2b96 <https://github.com/ralphbean/bugwarrior/commit/6722d2b96be217db035e7ecad9ebef104deee164>`_ - Merge pull request #233 from mathstuf/gitlab-work-in-progress-flag `c4bbd955d <https://github.com/ralphbean/bugwarrior/commit/c4bbd955d9ffcc0026985c88242ce178b3b0df1b>`_ - Merge pull request #234 from mathstuf/github-involved-issues `6ff7cfc7d <https://github.com/ralphbean/bugwarrior/commit/6ff7cfc7d0792583cca8dd093cfe996fc11b4f14>`_ - Merge pull request #235 from LordGaav/feature/close-gitlab-issues `0664bd02c <https://github.com/ralphbean/bugwarrior/commit/0664bd02cc9754f308a39f0fbcc938161fb6f134>`_ - Merge pull request #232 from mathstuf/handle-broken-gitlab-pagination `1677807bf <https://github.com/ralphbean/bugwarrior/commit/1677807bffb182d0654f61d84d0548507fbb47e5>`_ - Add Gitlab's assignee and author field to tasks `b7dd5c3e2 <https://github.com/ralphbean/bugwarrior/commit/b7dd5c3e2b2f775870a33b8ccacf1c0ef66ba413>`_ - Add documentation on UDA fields `c88209063 <https://github.com/ralphbean/bugwarrior/commit/c88209063475d236123a4f95533a0ef7d169606d>`_ - Add config option `8c2c8c0c9 <https://github.com/ralphbean/bugwarrior/commit/8c2c8c0c9f5866b6629d6be0bb14fdbc2767e69b>`_ - ewwwww, trailing whitespace `c48348fbb <https://github.com/ralphbean/bugwarrior/commit/c48348fbb0f7baf378a04ff2a7bd5c49d6fca576>`_ - Make comment annotation configurable `1667619bf <https://github.com/ralphbean/bugwarrior/commit/1667619bf8d099efbf4b8f509544ade28417254b>`_ - Clarify annotating by inverting conditional for `annotation_comments` `31c3ecdd3 <https://github.com/ralphbean/bugwarrior/commit/31c3ecdd3162714d6675a5d22a09dda6bc745a88>`_ - Merge pull request #237 from ryansb/feature/noAnnotations `1887d7095 <https://github.com/ralphbean/bugwarrior/commit/1887d7095187ba2100706830ae2f9a9fa9b58555>`_ - Merge pull request #236 from LordGaav/feature/gitlab-author-assignee-field `f84eca72f <https://github.com/ralphbean/bugwarrior/commit/f84eca72f6bdde9c480d56c72bf7c47a335a9e57>`_ - Document use_https for gitlab. `5d95424f6 <https://github.com/ralphbean/bugwarrior/commit/5d95424f6f0c09bf0e54683ac1fa0c52ca2a3d11>`_ - Merge branch 'https-or-http' into develop `f3b63baf1 <https://github.com/ralphbean/bugwarrior/commit/f3b63baf1298f64d95d6f39656520b4261150edd>`_
Changelog
=========

Expand Down
26 changes: 14 additions & 12 deletions bugwarrior/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def _bool_option(section, option, default):
# Before running CRUD operations, call the pre_import hook(s).
run_hooks(conf, 'pre_import')

notify = _bool_option('notifications', 'notifications', 'False') and not dry_run
notify = _bool_option('notifications', 'notifications', False) and not dry_run

tw = TaskWarriorShellout(
config_filename=get_taskrc_path(conf, main_section),
Expand Down Expand Up @@ -444,17 +444,19 @@ def _bool_option(section, option, default):

# Send notifications
if notify:
send_notification(
dict(
description="New: %d, Changed: %d, Completed: %d" % (
len(issue_updates['new']),
len(issue_updates['changed']),
len(issue_updates['closed'])
)
),
'bw_finished',
conf,
)
only_on_new_tasks = _bool_option('notifications', 'only_on_new_tasks', False)
if not only_on_new_tasks or len(issue_updates['new']) + len(issue_updates['changed']) + len(issue_updates['closed']) > 0:
send_notification(
dict(
description="New: %d, Changed: %d, Completed: %d" % (
len(issue_updates['new']),
len(issue_updates['changed']),
len(issue_updates['closed'])
)
),
'bw_finished',
conf,
)


def build_key_list(targets):
Expand Down
5 changes: 5 additions & 0 deletions bugwarrior/docs/common_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Optional options include:
* ``shorten``: Set to ``True`` to shorten links.
* ``inline_link``: When ``False``, links are appended as an annotation.
Defaults to ``True``.
* ``annotation_links``: When ``True`` will include a link to the ticket as an
annotation. Defaults to ``False``.
* ``annotation_comments``: When ``True`` skips putting issue comments into
annotations. Defaults to ``True``.
* ``legacy_matching``: Set to ``False`` to instruct Bugwarrior to match
issues using only the issue's unique identifiers (rather than matching
on description).
Expand Down Expand Up @@ -158,6 +162,7 @@ by ``bugwarrior-pull``::
backend = growlnotify
finished_querying_sticky = False
task_crud_sticky = True
only_on_new_tasks = True

Backend options:

Expand Down
59 changes: 32 additions & 27 deletions bugwarrior/docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ Example Configuration
::

# Example bugwarriorrc

# General stuff.
[general]
# Here you define a comma separated list of targets. Each of them must have a
# section below determining their properties, how to query them, etc. The name
# is just a symbol, and doesn't have any functional importance.
targets = my_github, my_bitbucket, paj_bitbucket, moksha_trac, bz.redhat

# If unspecified, the default taskwarrior config will be used.
#taskrc = /path/to/.taskrc

# Setting this to true will shorten links with http://da.gd/
#shorten = False

Expand All @@ -28,24 +28,28 @@ Example Configuration
# Setting this to True will include a link to the ticket as an annotation
annotation_links = True

# Setting this to True will include issue comments and author name in task
# annotations
annotation_comments = True

# Defines whether or not issues should be matched based upon their description.
# For historical reasons, and by default, we will attempt to match issues
# based upon the presence of the '(bw)' marker in the task description.
# If this is false, we will only select issues having the appropriate UDA
# fields defined
#legacy_matching=False

# log.level specifices the verbosity. The default is DEBUG.
# log.level can be one of DEBUG, INFO, WARNING, ERROR, CRITICAL, DISABLED
#log.level = DEBUG

# If log.file is specified, output will be redirected there. If it remains
# unspecified, output is sent to sys.stderr
#log.file = /var/log/bugwarrior.log

# Configure the default description or annotation length.
#annotation_length = 45

# Use hooks to run commands prior to importing from bugwarrior-pull.
# bugwarrior-pull will run the commands in the order that they are specified
# below.
Expand All @@ -56,7 +60,7 @@ Example Configuration
# exit early.
[hooks]
pre_import = /home/someuser/backup.sh, /home/someuser/sometask.sh

# This section is for configuring notifications when bugwarrior-pull runs,
# and when issues are created, updated, or deleted by bugwarrior-pull.
# Three backend are currently suported:
Expand All @@ -73,30 +77,31 @@ Example Configuration
# backend = growlnotify
# finished_querying_sticky = False
# task_crud_sticky = True
# only_on_new_tasks = True


# This is a github example. It says, "scrape every issue from every repository
# on http://github.com/ralphbean. It doesn't matter if ralphbean owns the issue
# or not."
[my_github]
service = github
default_priority = H
add_tags = open_source

# This specifies that we should pull issues from repositories belonging
# to the 'ralphbean' github account. See the note below about
# 'github.username' and 'github.login'. They are different, and you need
# both.
github.username = ralphbean

# I want taskwarrior to include issues from all my repos, except these
# two because they're spammy or something.
github.exclude_repos = project_bar,project_baz

# Working with a large number of projects, instead of excluding most of them I
# can also simply include just a limited set.
github.include_repos = project_foo,project_foz

# Note that login and username can be different: I can login as me, but
# scrape issues from an organization's repos.
#
Expand All @@ -106,30 +111,30 @@ Example Configuration
# issues for. It could be you, or some other user entirely.
github.login = ralphbean
github.password = OMG_LULZ


# Here's an example of a trac target.
[moksha_trac]
service = trac

trac.base_uri = fedorahosted.org/moksha
trac.username = ralph
trac.password = OMG_LULZ

only_if_assigned = ralph
also_unassigned = True
default_priority = H
add_tags = work

# Here's an example of a megaplan target.
[my_megaplan]
service = megaplan

megaplan.hostname = example.megaplan.ru
megaplan.login = alice
megaplan.password = secret
megaplan.project_name = example

# Here's an example of a jira project. The ``jira-python`` module is
# a bit particular, and jira deployments, like Bugzilla, tend to be
# reasonably customized. So YMMV. The ``base_uri`` must not have a
Expand All @@ -147,21 +152,21 @@ Example Configuration
# the dashboard.
jira.version = 5
add_tags = enterprisey work

# Here's an example of a phabricator target
[my_phabricator]
service = phabricator
# No need to specify credentials. They are gathered from ~/.arcrc

# Here's an example of a teamlab target.
[my_teamlab]
service = teamlab

teamlab.hostname = teamlab.example.com
teamlab.login = alice
teamlab.password = secret
teamlab.project_name = example_teamlab

# Here's an example of a redmine target.
[my_redmine]
service = redmine
Expand All @@ -170,14 +175,14 @@ Example Configuration
redmine.user_id = 7
redmine.project_name = redmine
add_tags = chiliproject

[activecollab]
service = activecollab
activecollab.url = https://ac.example.org/api.php
activecollab.key = your-api-key
activecollab.user_id = 15
add_tags = php

[activecollab2]
service = activecollab2
activecollab2.url = http://ac.example.org/api.php
Expand Down
37 changes: 28 additions & 9 deletions bugwarrior/docs/services/bugzilla.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ 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 you're on a more recent Bugzilla install, the NEEDINFO status no longer
exists, and has been replaced by the "needinfo?" flag. Set
"bugzilla.include_needinfos" to "True" to have taskwarrior also add bugs where
information is requested of you. The "bugzillaneedinfo" UDA will be filled in
with the date the needinfo was set.

To see all your needinfo bugs, you can use "task bugzillaneedinfo.any: list".

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 All @@ -48,12 +63,16 @@ from your browser into the ``bugzilla.query_url`` option::
Provided UDA Fields
-------------------

+---------------------+---------------------+---------------------+
| Field Name | Description | Type |
+=====================+=====================+=====================+
| ``bugzillasummary`` | Summary | Text (string) |
+---------------------+---------------------+---------------------+
| ``bugzillaurl`` | URL | Text (string) |
+---------------------+---------------------+---------------------+
| ``bugzillabugid`` | Bug ID | Numeric (integer) |
+---------------------+---------------------+---------------------+
+----------------------+---------------------+---------------------+
| Field Name | Description | Type |
+======================+=====================+=====================+
| ``bugzillasummary`` | Summary | Text (string) |
+----------------------+---------------------+---------------------+
| ``bugzillaurl`` | URL | Text (string) |
+----------------------+---------------------+---------------------+
| ``bugzillabugid`` | Bug ID | Numeric (integer) |
+----------------------+---------------------+---------------------+
| ``bugzillastatus`` | Bugzilla Status | Text (string) |
+----------------------+---------------------+---------------------+
| ``bugzillaneedinfo`` | Needinfo | Date |
+----------------------+---------------------+---------------------+
11 changes: 11 additions & 0 deletions bugwarrior/docs/services/github.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ by adding the following configuration option::

github.filter_pull_requests = True

Get involved issues
+++++++++++++++++++

Instead of fetching issues and pull requests based on ``{{username}}``'s owned
repositories, you may instead get those that ``{{username}}`` is involved in.
This includes all issues and pull requests where the user is the author, the
assignee, mentioned in, or has commented on. To do so, add the following
configuration option::

github.involved_issues = True

Provided UDA Fields
-------------------

Expand Down
14 changes: 14 additions & 0 deletions bugwarrior/docs/services/gitlab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ by adding the following configuration option::

gitlab.filter_merge_requests = True

Use HTTP
++++++++

If your Gitlab instance is only available over HTTP, set::

gitlab.use_https = False


Provided UDA Fields
-------------------

Expand Down Expand Up @@ -110,3 +118,9 @@ Provided UDA Fields
+-----------------------+-----------------------+---------------------+
| ``gitlabdownvotes`` | Number of downvotes | Numeric |
+-----------------------+-----------------------+---------------------+
| ``gitlabwip`` | Work-in-Progress flag | Numeric |
+-----------------------+-----------------------+---------------------+
| ``gitlabauthor`` | Issue/MR author | Text (string) |
+-----------------------+-----------------------+---------------------+
| ``gitlabassignee`` | Issue/MR assignee | Text (string) |
+-----------------------+-----------------------+---------------------+
2 changes: 2 additions & 0 deletions bugwarrior/docs/services/jira.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,5 @@ Provided UDA Fields
+---------------------+---------------------+---------------------+
| ``jiraurl`` | URL | Text (string) |
+---------------------+---------------------+---------------------+
| ``jiraestimate`` | Estimate | Decimal (numeric) |
+---------------------+---------------------+---------------------+
29 changes: 18 additions & 11 deletions bugwarrior/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ def __init__(self, config, main_section, target):
config.get(self.main_section, 'annotation_links')
)

self.annotation_comments = True
if config.has_option(self.main_section, 'annotation_comments'):
self.annotation_comments = asbool(
config.get(self.main_section, 'annotation_comments')
)

self.shorten = False
if config.has_option(self.main_section, 'shorten'):
self.shorten = asbool(config.get(self.main_section, 'shorten'))
Expand Down Expand Up @@ -165,18 +171,19 @@ def build_annotations(self, annotations, url):
final = []
if self.annotation_links:
final.append(url)
for author, message in annotations:
message = message.strip()
if not message or not author:
continue
message = message.replace('\n', '').replace('\r', '')
final.append(
'@%s - %s%s' % (
author,
message[0:self.anno_len],
'...' if len(message) > self.anno_len else ''
if self.annotation_comments:
for author, message in annotations:
message = message.strip()
if not message or not author:
continue
message = message.replace('\n', '').replace('\r', '')
final.append(
'@%s - %s%s' % (
author,
message[0:self.anno_len],
'...' if len(message) > self.anno_len else ''
)
)
)
return final

@classmethod
Expand Down
Loading

0 comments on commit 5bee1c4

Please sign in to comment.