forked from valhallasw/pywikibugs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
46 lines (31 loc) · 1.7 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
wikibugs is a project on Tool Labs to take over the job of the current wikibugs bot.
The bot is currently alpha stage, being tested in a few IRC channels.
The entire project is Python 3.4 / asyncio based.
Steps from change to IRC
------------------------
1. User makes a change on Bugzilla
2. Bugzilla sends an e-mail to [email protected]
3. Tools mail server receives the e-mail. .forward pipes it to toredis.py
4. toredis.py sends the e-mail to Redis ('PUBLISH')
The Redis step is useful because the mail and exec hosts are not necessarily the
same. Making them find eachother is also not completely trivial.
5. The IRC bot listens to events on Redis ('SUBSCRIBE')
6. The IRC bot receives the new e-mail
7. bzparser.py parses the e-mail into a dict
8. Asynchronously, bzparser.py retrieves real names for e-mail addresses.
If no response is received within 30 seconds, the request is stopped. (pywikibugs.parse_email.fixup_future)
9. For each channel, pywikibugs.send_messages builds a message (via build_message) and dispatches it to the IRC channel
Deploying
---------
cd src/pywikibugs && git pull && cd ~ && ./start_pywikibugs.sh
This will kill the current SGE job and start a new one.
Adding a new channel
--------------------
Adapt the pywikibugs.channels dict. The format is:
<channel name> => (filter function, parameters for build_message)
The filter function gets the bug change dict passed as parameter.
e.g.
{"#pywikipediabot": (lambda x: x.get("X-Bugzilla-Product", None) == "Pywikibot", {})}
will filter all Pywikibot bugs, without sending any special parameters to build_message.
{"#somechannel": (lambda x: True, {'hide_product': True})}
would send all bugs to #somechannel, but hides the product names.