humbug_trac: Make which field changes cause notifications customizable.

(imported from commit 91b138a0eaf3c3773752ae3a4c4599bd5c095497)
This commit is contained in:
Tim Abbott 2013-02-13 15:52:47 -05:00
parent f30e28dd20
commit df67499a35
3 changed files with 37 additions and 7 deletions

View file

@ -26,8 +26,24 @@ HUMBUG_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
STREAM_FOR_NOTIFICATIONS = "trac" STREAM_FOR_NOTIFICATIONS = "trac"
TRAC_BASE_TICKET_URL = "https://trac.humbughq.com/ticket" TRAC_BASE_TICKET_URL = "https://trac.humbughq.com/ticket"
# This should not need to change unless you have a custom Humbug subdomain. # Most people find that having every change in Trac result in a
HUMBUG_SITE = "https://staging.humbughq.com" # notification is too noisy -- in particular, when someone goes
# through recategorizing a bunch of tickets, that can often be noisy
# and annoying. We solve this issue by only sending a notification if
# one of the more important fields is changed or the person making the
# change makes a comment.
#
# Total list of fields is:
# (priority, milestone, cc, owner, keywords, component, severity,
# type, versions, description, resolution, summary)
#
# The following is the list of fields which can be changed without
# triggering a Humbug notification
TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution"]
## If properly installed, the Humbug API should be in your import ## If properly installed, the Humbug API should be in your import
## path, but if not, set a custom path below ## path, but if not, set a custom path below
HUMBUG_API_PATH = "/home/humbug/humbug/api" HUMBUG_API_PATH = "/home/humbug/humbug/api"
# This should not need to change unless you have a custom Humbug subdomain.
HUMBUG_SITE = "https://staging.humbughq.com"

View file

@ -89,9 +89,7 @@ class HumbugPlugin(Component):
`old_values` is a dictionary containing the previous values of the `old_values` is a dictionary containing the previous values of the
fields that have changed. fields that have changed.
""" """
if not comment and set(old_values.keys()) <= set(["priority", "milestone", if not comment and not set(old_values.keys()).intersection(set(config.TRAC_NOTIFY_FIELDS)):
"cc", "keywords",
"component"]):
# This is probably someone going through trac and updating # This is probably someone going through trac and updating
# the priorities; this can result in a lot of messages # the priorities; this can result in a lot of messages
# nobody wants to read, so don't send them without a comment. # nobody wants to read, so don't send them without a comment.

View file

@ -28,8 +28,24 @@ HUMBUG_API_KEY = "0123456789abcdef0123456789abcdef"
STREAM_FOR_NOTIFICATIONS = "trac" STREAM_FOR_NOTIFICATIONS = "trac"
TRAC_BASE_TICKET_URL = "https://trac.example.com/ticket" TRAC_BASE_TICKET_URL = "https://trac.example.com/ticket"
# This should not need to change unless you have a custom Humbug subdomain. # Most people find that having every change in Trac result in a
HUMBUG_SITE = "https://humbughq.com" # notification is too noisy -- in particular, when someone goes
# through recategorizing a bunch of tickets, that can often be noisy
# and annoying. We solve this issue by only sending a notification if
# one of the more important fields is changed or the person making the
# change makes a comment.
#
# Total list of fields is:
# (priority, milestone, cc, owner, keywords, component, severity,
# type, versions, description, resolution, summary)
#
# The following is the list of fields which can be changed without
# triggering a Humbug notification
TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution"]
## If properly installed, the Humbug API should be in your import ## If properly installed, the Humbug API should be in your import
## path, but if not, set a custom path below ## path, but if not, set a custom path below
HUMBUG_API_PATH = None HUMBUG_API_PATH = None
# This should not need to change unless you have a custom Humbug subdomain.
HUMBUG_SITE = "https://humbughq.com"