Difficulties to interface with bugzilla API

Guillaume Rousse Guillaume.Rousse at inria.fr
Sun Jan 21 19:47:25 UTC 2007


Hello.

I'm interfacing with bugzilla from another perl application. The
interface code is available at
http://www.zarb.org/cgi-bin/viewvc.cgi/soft/core/trunk/lib/Youri/Bugzilla.pm?root=youri&view=markup

They are some issues that make me thinks than current Bugzilla API is
quite misadapted to a general usage scenario, meaning not from bugzilla
CGI or mod_perl handlers.

First, loading Bugzilla module, the main API entry point, immediatly
triggers environment cleanup, such as deleting PATH, for instance. This
may be adequate from CGI programs, but for trusted environment, this has
 heavy side-effects. I had to localize ENV for avoiding it.

Second, the END block at the end of this module close database
connection. As END block are processed LIFO, this means calling code has
no chance to finish any live statement handle before it occurs. I had to
avoid using Bugzilla::dbh, and call Bugzilla::DB::connect directly in
order to avoid it.

I could have faked mod_perl environment also, but this has additional
side-effect than make this trick unusable.



More information about the developers mailing list