Two types of objects

So 03 července 2010

I was reminded by the Ehsan’s blogpost of one still not fully resolved problem with my bugzilla-triage script. The principal reason why I started working on my third rewrite of scripts (still in jetpack-prototype) was to make the script really useful over the different bugzilla instances (specifically MoFo bugzilla). I have found lovely variant of a similar script by Philipp Kewisch which I wanted to merge in mine.

Philipp uses quite a different style of UI than I do. I am persuaded that things like muscle memory and mouse clicks minimalization are important considerations so I generally prefer a lot of buttons spread all over the page (or in the places which I think are most appropriate), Phillip prefers to have a minimal disruptions to the page with just one scroll-up SELECT element. The second problem is of course what Ehsan mentioned: there are just things too different between different instances which cannot be coded over in one script. Ehsan mentions interleaving text between commemtns, I could see on the Red Hat bugzilla methods of XML-RPC (e.g., bugzilla.updateAttachMimeType) which are very important to me, but most likely not supported in the upstream code.

In the end I have decided to go after making the script palatable to everybody by two ways. First of all I have modified my configuration JSON file to allow adding items to the SELECT in the style Philipp prefers, so that I believe his style of bugzilla page modifications can be done only by the changes in the configuration file.

The second line of attack was to create inheritance of objects. There is a base object BZPage, which contains methods and properties useful on all bugzilla instances. And there are two (so far) child objects of it: RHBugzillaPage and MozillaBugzilla (the latter is just stub). RHBugzillaPage then contains a lot of code which is specific for RH Bugzilla but not for anybody else.

This is the idea, but the problem is that I work almost exclusively on (and bit of b.m.o but I cannot do much there) so I am afraid those two concepts got incredibly mixed together. I would really need somebody else to start using my code on b.m.o (or elsewhere) and hitting all those RH-centric warts.

The good news in all of this is that I have finally some real users in the BugZappers land (Fedora bug triagers) and after some little warts, it seems to work! Yay! So, now and then. WORLD DOMINATION!

In other news, I have repented and switched the repository back to Git. So the repository is now available at git:// (and we have gitweb as well).

Category: computer Tagged: jetpack firefox bugTriage