[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Machine readable interface



On Thu, Jun 26, 2003 at 06:44:21PM +0100, Mark Howard wrote:
> To help solve the second point, I would like to have a machine-friendly
> interface to the bts. The attached cgi scripts hope to do this. 
> 
> I'm not a perl programmer, so I apologise for any stupid mistakes. I
> don't have access to a debbug installation to test them on, so they are
> untested.
> Much of the code in machpkg.cgi is copied from common and pkgreport. If
> you choose to use these scripts, it would probably be better to allow
> this code to be shared. 

The code should definitely be shared; see the existing code for examples
of simple CGI argument parsing which you can use. Also, I think the
output format is a bit too unstructured and will cause compatibility
problems as more fields are added (the VERSION header helps but it would
be easier if the output were somewhat self-versioning so that clients
don't *have* to be updated every time a new field is added).

How about a simple Debian control file-style output, a.k.a. RFC822, so
that the bugreport.cgi?bug=nnnnn&rfc822=yes output would look like this:

  Output-Version: 1
  Package: foo
  Severity: wishlist
  Submitter: Helpful User <user@example.com>

Dead easy to generate and parse.

If you want the log as well, it should come out in parsed format, one
message at a time; you don't want all the control characters that are
used as record separators in the real log file. I'm not sure I can think
of a good way to represent this in RFC822. How about a newline after all
the headers above, after which follows something like the output you
currently get from bugreport.cgi?bug=nnnnn&mbox=yes? We've got the code
for that bit already.

Similar for pkgreport.cgi, and you probably want modifications to
pkgindex.cgi too.

> [Please CC me - I'm not on the list]

A Mail-Followup-To: header saying that would be helpful, if you can.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: