Ravenbrook / Projects / Perforce Defect Tracking Integration / Tools / Bugzilla Schema


Bugzilla Schema Documentation Generation Code

Nick Barnes, Ravenbrook Limited, 2008-05-12

1. Introduction

This document describes the code and documents used to generate the online Bugzilla schema documentation, produced as a side-benefit of the Perforce Defect Tracking Integration project.

Please note that all this code was written and has been maintained in a very ad-hoc fashion, and the job which it aims to achieve is intrinsically complex. We are not proud of this code, and publish it only because others have expressed an interest in it and we hope it might be useful.

This document will be modified as this tool is developed.

The readership of this document is anyone interested in the project.

This document is not confidential.

2. Index

pickle_schema.py A Python module to interrogate MySQL to obtain a live database schema, and to write a "pickled" version of that schema into a file in the "pickles" directory.
pickles A directory containing pickled versions of every Bugzilla database schema, generated by pickle_schema.py. Each pickle is named after the first version of Bugzilla which had that schema.
get_schema.py A Python module to read a pickled schema from the "pickles" directory, annotate it with data from schema_remarks.py, and convert it to a canonical Python dictionary form.
schema_remarks.py A Python module defining all the comments and running text which are ever used in the generated documentation (excluding automatically-generated text such as field names, types, attributes, and notes on schema changes). Also lists the schemas available in "pickles", and provides the mapping from Bugzilla version to schema version name.
make_schema_doc.py The main Python documentation generation module. Uses the unpickled schemas fetched by get_schema.py, compares them to identify schema changes and colour the resulting charts, processes the text to include comments appropriate to the range of schemas requested, and automated comments reflecting the schema version ranges specific to particular pieces of commentary, and produces the resulting HTML document.
index.py The front-end CGI script which presents a form, validates input through the form, and drives make_schema_doc to produce the schema documentation.
index.cgi A tiny Python script which uses index.py to do all of the CGI work. The two files are separated so that the source of index.py can be published directly through the web interface.

A. References

B. Document History

2008-05-12 NB Created.

This document is copyright © 2008 Perforce Software, Inc. All rights reserved.

Redistribution and use of this document in any form, with or without modification, is permitted provided that redistributions of this document retain the above copyright notice, this condition and the following disclaimer.

This document is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright holders and contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this document, even if advised of the possibility of such damage.

$Id: //info.ravenbrook.com/project/p4dti/tool/cgi/bugzilla-schema/code.html#3 $

Ravenbrook / Projects / Perforce Defect Tracking Integration / Tools / Bugzilla Schema