← Back to team overview

arsenal-devel team mailing list archive

Re: Thoughts on refactoring process-new-bugs.py

 

On 03/24/2010 02:28 PM, Bryce Harrington wrote:
process-new-bugs.py is a horribly ugly hack of a script.  It's also
probably the most helpful script in arsenal.  It needs TLC.

After chatting with Brad about it last Friday, I looked through his
changes and the code in general, and itemized some refactoring tasks
would strongly improve the script.  See below.

Brad, if you're interested in implementing some of these things, let me
know so we can coordinate efforts.  Or if you

  * Could append_tag() and append_tags() be merged into one routine?  If
    not, then append_tag() should just be a wrapper around append_tags().


Since the arguments are essentially typeless, this is difficult to do. The
only thing I can think of right off they top of my head is to use 'type()'
to figure out if the argument is a simple string or a list and handle it
appropriately.

  * Be better at detecting workflow bugs ("Please...", "Needs sync...",
    etc.) and not asking for files in these cases.

  * Redo the attachment detection/classification code.

    + Move into Arsenal itself for general use
    + Recognize a wider variety of attachments
    + Recognize and flag patches
    + Differentiate between debdiffs and regular patches
    + Recognize tarballs and compressed files and flag them as such


Not overly difficult, just a bit of work to do. Also, we need to recognize
that different teams/source-packages require different logs. However, the
actuall processing of the logs independent of which ones we require should
be centralized.

  * Create an AttachmentParser virtual class, with subclasses that can
    parse specific attachments of interest:

    + dmesg
    + lspci
    + dmidecode
    + Xorg.0.log

Agree, have done some work in this area already that should be useful.


  * Symptom tagging.

    + Extract logic from process-tagging.py, which is more polished.
      Move into Arsenal library proper

    + The tags_regex table is X.org-specific.  We need an easy way for
      other teams to provide their own tables.  Maybe load from a config
      file or something.

Agree. A config file could do it easily especially if the config file were
a json file which we load.


  * Distro tagging ('lucid', 'kubuntu', etc.) should be a general routine
    in Arsenal itself.  Several scripts are doing this.

Agree, this is a standalone script I'm going to start on soon with the
intention of the core being put into the Arsenal library.


  * Message replies.  I am not happy with how this is implemented in
    process-new-bugs.py.  My ideal would be some magic routine which
    could write a customized reply specific to what it sees, so it's
    specific and doesn't sound so canned.  This is what I was shooting
    for with the ArsenalReply class, but that's unfinished.  This needs
    to be heavily re-thought out.

    + Use the identified symptoms to determine if the appropriate
      attachments are present on the bug.  If not, prompt the user to add
      them.

    + Use the identified symptoms to give advice (or wiki pages) with
      info about working around the problem.

    + Identify if bug was reported against a released version and prompt
      use to test the development version (if appropriate).


This all sounds good, just going to take a bit of work to implement.


_______________________________________________
Mailing list: https://launchpad.net/~arsenal-devel
Post to     : arsenal-devel@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~arsenal-devel
More help   : https://help.launchpad.net/ListHelp

My comments aren't very insightful but there you are.

Brad
--
Brad Figg brad.figg@xxxxxxxxxxxxx http://www.canonical.com



Follow ups

References