Git Product home page Git Product logo

pywikibugs's Introduction

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.

  1. The IRC bot listens to events on Redis ('SUBSCRIBE')
  2. The IRC bot receives the new e-mail
  3. bzparser.py parses the e-mail into a dict
  4. 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)
  5. 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.bash

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.

pywikibugs's People

Contributors

jdforrester avatar matmarex avatar somechris avatar valhallasw avatar yuvipanda avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.