Rename Humbug-based variables in Trac plugin.
(imported from commit 5d406cb6c5fe7b1fbd4da706f7ac6bb6e381cadb)
This commit is contained in:
parent
4611b40b12
commit
0c3eba5331
|
@ -4,12 +4,11 @@
|
||||||
# Leaving all the instructions out of this file to avoid having to
|
# Leaving all the instructions out of this file to avoid having to
|
||||||
# sync them as we update the comments.
|
# sync them as we update the comments.
|
||||||
|
|
||||||
HUMBUG_USER = "trac-bot@zulip.com"
|
ZULIP_USER = "trac-bot@zulip.com"
|
||||||
HUMBUG_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
ZULIP_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"
|
||||||
|
|
||||||
TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution", "comment",
|
TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution", "comment", "owner"]
|
||||||
"owner"]
|
ZULIP_API_PATH = "/home/humbug/humbug/api"
|
||||||
HUMBUG_API_PATH = "/home/humbug/humbug/api"
|
ZULIP_SITE = "https://staging.zulip.com"
|
||||||
HUMBUG_SITE = "https://staging.zulip.com"
|
|
||||||
|
|
|
@ -21,15 +21,15 @@
|
||||||
# THE SOFTWARE.
|
# THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
# Zulip trac plugin -- sends humbugs when tickets change.
|
# Zulip trac plugin -- sends zulips when tickets change.
|
||||||
#
|
#
|
||||||
# Install by copying this file and zulip_trac_config.py to the trac
|
# Install by copying this file and zulip_trac_config.py to the trac
|
||||||
# plugins/ subdirectory, customizing the constants in
|
# plugins/ subdirectory, customizing the constants in
|
||||||
# zulip_trac_config.py, and then adding "humbug_trac" to the
|
# zulip_trac_config.py, and then adding "zulip_trac" to the
|
||||||
# components section of the conf/trac.ini file, like so:
|
# components section of the conf/trac.ini file, like so:
|
||||||
#
|
#
|
||||||
# [components]
|
# [components]
|
||||||
# humbug_trac = enabled
|
# zulip_trac = enabled
|
||||||
#
|
#
|
||||||
# You may then need to restart trac (or restart Apache) for the bot
|
# You may then need to restart trac (or restart Apache) for the bot
|
||||||
# (or changes to the bot) to actually be loaded by trac.
|
# (or changes to the bot) to actually be loaded by trac.
|
||||||
|
@ -41,14 +41,14 @@ import os.path
|
||||||
sys.path.insert(0, os.path.dirname(__file__))
|
sys.path.insert(0, os.path.dirname(__file__))
|
||||||
import zulip_trac_config as config
|
import zulip_trac_config as config
|
||||||
|
|
||||||
if config.HUMBUG_API_PATH is not None:
|
if config.ZULIP_API_PATH is not None:
|
||||||
sys.path.append(config.HUMBUG_API_PATH)
|
sys.path.append(config.ZULIP_API_PATH)
|
||||||
|
|
||||||
import zulip
|
import zulip
|
||||||
client = zulip.Client(
|
client = zulip.Client(
|
||||||
email=config.HUMBUG_USER,
|
email=config.ZULIP_USER,
|
||||||
site=config.HUMBUG_SITE,
|
site=config.ZULIP_SITE,
|
||||||
api_key=config.HUMBUG_API_KEY)
|
api_key=config.ZULIP_API_KEY)
|
||||||
|
|
||||||
def markdown_ticket_url(ticket, heading="ticket"):
|
def markdown_ticket_url(ticket, heading="ticket"):
|
||||||
return "[%s #%s](%s/%s)" % (heading, ticket.id, config.TRAC_BASE_TICKET_URL, ticket.id)
|
return "[%s #%s](%s/%s)" % (heading, ticket.id, config.TRAC_BASE_TICKET_URL, ticket.id)
|
||||||
|
@ -72,7 +72,7 @@ def send_update(ticket, content):
|
||||||
"subject": trac_subject(ticket)
|
"subject": trac_subject(ticket)
|
||||||
})
|
})
|
||||||
|
|
||||||
class HumbugPlugin(Component):
|
class ZulipPlugin(Component):
|
||||||
implements(ITicketChangeListener)
|
implements(ITicketChangeListener)
|
||||||
|
|
||||||
def ticket_created(self, ticket):
|
def ticket_created(self, ticket):
|
|
@ -20,11 +20,11 @@
|
||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
# THE SOFTWARE.
|
# THE SOFTWARE.
|
||||||
|
|
||||||
# See humbug_trac.py for installation and configuration instructions
|
# See zulip_trac.py for installation and configuration instructions
|
||||||
|
|
||||||
# Change these constants to configure the plugin:
|
# Change these constants to configure the plugin:
|
||||||
HUMBUG_USER = "trac-bot@example.com"
|
ZULIP_USER = "trac-bot@example.com"
|
||||||
HUMBUG_API_KEY = "0123456789abcdef0123456789abcdef"
|
ZULIP_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"
|
||||||
|
|
||||||
|
@ -41,12 +41,11 @@ TRAC_BASE_TICKET_URL = "https://trac.example.com/ticket"
|
||||||
# The following is the list of fields which can be changed without
|
# The following is the list of fields which can be changed without
|
||||||
# triggering a Zulip notification; change these to match your team's
|
# triggering a Zulip notification; change these to match your team's
|
||||||
# workflow.
|
# workflow.
|
||||||
TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution", "comment",
|
TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution", "comment", "owner"]
|
||||||
"owner"]
|
|
||||||
|
|
||||||
## If properly installed, the Zulip API should be in your import
|
## If properly installed, the Zulip 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
|
ZULIP_API_PATH = None
|
||||||
|
|
||||||
# This should not need to change unless you have a custom Zulip subdomain.
|
# This should not need to change unless you have a custom Zulip subdomain.
|
||||||
HUMBUG_SITE = "https://api.zulip.com"
|
ZULIP_SITE = "https://api.zulip.com"
|
||||||
|
|
Loading…
Reference in a new issue