-
Notifications
You must be signed in to change notification settings - Fork 5
/
README
149 lines (111 loc) · 6.27 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
Bugzilla Push Extension
-----------------------
This extension sends messages to a message broker via AMQP or STOMP
whenever an object (bug, keyword, component, etc) is created or modified.
For more information, read these blog posts:
* http://christian.legnitto.com/blog/2010/08/20/push-notifications-for-bugzilla/
* http://christian.legnitto.com/blog/2010/09/10/bugzilla-amqp-is-now-buzgilla-push-supports-the-stomp-protocol/
You can also view these demo videos. Warning, they are large (recorded off a
24 inch monitor) but the actual file size is small:
* http://people.mozilla.org/~clegnitto/broker/demo.theora.ogv (OGG Theora)
* http://people.mozilla.org/~clegnitto/broker/demo.webm (WebM)
Please note this has not been tested in production yet! This is a very early
release, and though it works please proceed with caution. On the plus side,
it doesn't modify any Bugzilla data--the worst that can happen is
your Bugzilla installation fails until you deactivate the extension. I have
tested it locally against Bugzilla's trunk. If you find problems with older
releases, let me know.
You can deactivate the extension by moving it out of the Bugzilla extension
directory or placing an empty file named "disabled" in the extension directory
and then restarting your webserver.
WARNING! WARNING! WARNING!
The message fields/formats *will likely change* in future revisions. Currently
the messages look like:
_meta:
'routing_key' => 'The routing key'
'time' => 'Time the message was created'
payload:
OBJECT_TYPE => {DUMP OF BUGZILLA OBJECT}
'change' => {DUMP OF BUGZILLA CHANGE REPRESENTATION}
(for changed messages)
Both the envelope format and the format of the raw data will likely change.
I am currently doing mapping for types, but the mapping may change until I
"officially" decide the interface is frozen. When possible, I tried to copy
the WebServices. All times/dates are in iso8601 format.
Questions, comments, concerns: email Christian Legnitto <[email protected]>
Requirements
-----------------------
* You need to patch Bugzilla with the patch from
https://bugzilla.mozilla.org/show_bug.cgi?id=587793.
(the patch is trivial and will be integrated in a later Bugzilla release)
* If you want comment messages, you need to patch Bugzilla with the patch from
https://bugzilla.mozilla.org/show_bug.cgi?id=590334. The extension should
still work without the patch, but no messages will be sent for any events
related to comments
* Perl module Net::RabbitFoot
(if you want to use AMQP)
* You should probably patch Net::RabbitFoot with the patch from
http://github.com/cooldaemon/RabbitFoot/commit/ec13602e3bb4d676f750a22e659bc8aedc09f16f
until an updated version gets in cpan (or build from RabbitFoot's source)
* Perl module Net::Stomp
(if you want to use STOMP)
* Perl module Scalar::Util
(used to determine type of object we are messaging about, already required)
* Perl module JSON >= 2.07
(used to serialize the message, already required)
Installation
-----------------------
1. Copy the Push directory to the Bugzilla "extensions" directory
2. (optional) sudo perl /path/to/bugzilla/install-module.pl [Requirements above]
3. Login to your Bugzilla installation as an administrator
4. Click "Administration"
5. Click "Parameters"
6. Click "Push Integration" in the left menu
7. Insert data specific to your broker setup
Known Issues / TODO
-----------------------
* Messages are always serialized with JSON. Support for other schemes will be
added in the future
* The exchanges are currently hardcoded as durable topic exchanges. I intend
to make this configurable via the admin interface
* I need to come up with stable object mappings so that consumers don't
break when Bugzilla changes the internal representations. I'm mostly there
* Comments only send comment.new messages. I want them also to send bug changed
messages as well (perhaps with configurable behavior)
* Custom fields are supported as simple strings rather than objects. I plan
to make this support more robust in the future
* Vhosts other than "/" have not been tested, though they probably work
* I want to make the message verbosity configurable. Currently it resolves and
includes most embedded objects, which may not be ideal for every use-case
* Due to the way Bugzilla extensions work, the message is sent during a
database transaction. If the transaction is rolled back the message will still
be sent. I'm thinking of ways to mitigate/fix this, but it should generally
be a non-issue for now
* Currently messages are sent for each change. In the future I want to make it
configrable between current behavior, current behavior + a changeset message,
and only a changeset message
* Related to the previous, I want to break additions (changes where the value
before wasn't set) removals (changes where the value was set before and not
after) and general changes (fields that had a value that changed) into seperate
messages so consumers don't have to know stuff like '---' means the field was
cleared, etc
* Be aware, if you choose to send messages about secure bugs and allow public
access to your broker you are esentially removing the bug security.
In the future I intend to allow publishing secure bug messages to a different
different exchange or server as well as disallowing any messages a public
bugzilla user couldn't see
* Bug closed messages are not sent. Currently, consumers will need to listen to
bug changed messages and look at 'is_open' in the status. I intend to make
this configurable so that you can send closed and reopened messages
* Object deletion messages are not sent. This is a future feature I want to add
if at all possible
* It would be nice in the future for the connection and channel to stay open
between Bugzilla and the broker (for simplicity and performance). I'm not sure
this is possible with the current extension system
* There has been no performance testing, but I will (hopefully) be testing
soon. Whenever I saw a chance to speed things up / return early I did though.
* The coding style doesn't match Bugzilla's coding guidelines
* I am not a Perl programmer, so I am sure there are better ways to write
portions of the extension. I'll be doing more general code cleanup and
solidifying as time goes on
* This file is pretty much the only documentation. I need to write more!