Review Board 1.0.5.1

Add ircbot Command Queue

Updated 8 months ago

Andrew Schurman Reviewers
Basie-Dev
None Basie SVN
Add a command queue to the database to allow the ircbot to process commands given from other sources. Rather than build a separate system for dealing with specific command messages, we use the supybot plugin system to process commands. Therefore commands are sent to the bot supybot style: [<plugin>.]<command> [<args>]. This should provide adequate facility to control the bot remotely given the proper plugins are loaded.
- Added passing tests
- Running ircbot appears to log that commands were processed even though there wasn't any (tested with bin/django runircbot -s 10)
Posted 8 months, 2 weeks ago (November 10th, 2009, 11:16 p.m.)
Was trying out the parent diff feature of Review Board, but it doesn't seem to allow you to download it. The only thing it does allow is diffing off revisions of files that have yet to be committed to the repository. Use the diff at http://review.basieproject.org/r/453/ before you use this one to fix patch errors.
Review request changed
Updated 8 months, 2 weeks ago (November 14th, 2009, 5:23 p.m.)
- Update commands module with refactoring from project mapping review
- Update tests with proper way handle arguments
Posted 8 months, 2 weeks ago (November 16th, 2009, 12:44 a.m.)
A few minor things - unnecessary import statements (unless you're importing them for their side effects), and one of your comments state bad commands lead to undefined behaviour (can the end-user create bad commands, or will they always be generated by our code?).

--sleep should never be zero or negative. If it is, the job constantly checks for queued commands, and it's hard to kill.
/trunk/apps/ircbot/commands.py (Diff revision 3)
 
 
These imports aren't used.
Indent and split into two lines so it doesn't break the 80 columns limit. (Good proactive testing, though.)
Doesn't seem like this import is used.
/trunk/apps/ircbot/models.py (Diff revision 3)
 
 
The Commands model is only used behind the scenes, and doesn't accept end-user input, correct?
  1. That is correct. I was attempting to make an API such that if we use it elsewhere, the users (devs) know what to expect.
Import not used.
Review request changed
Updated 8 months, 1 week ago (November 17th, 2009, 11:45 p.m.)
- Fix commands module API user from causing errors when re-reading the users databasee
- Remove useless imports
- Check for small sleep values
- Add translation to logging lines
- Updated diff to latest from repository
Posted 8 months ago (November 26th, 2009, 7:27 p.m.)

   

  
  1. Things look good now, just a few minor nitpicks.
/trunk/apps/ircbot/commands.py (Diff revision 4)
 
Keep within 79 characters (also line 65, 109).
/trunk/apps/ircbot/commands.py (Diff revision 4)
 
 
 
 
 
 
 
command_str isn't used elsewhere.
Keep within 79 character limit when possible (also lines 111, 139).
/trunk/apps/ircbot/management/commands/runircbot.py (Diff revision 4)
 
 
 
 
 
 
These error messages should be translated.
Stay within 79 character limit when possible (also lines 77, 81).
Review request changed
Updated 8 months ago (November 27th, 2009, 3:02 p.m.)
Update as per comments.
Ship it!
Posted 8 months ago (November 27th, 2009, 3:59 p.m.)
Great.