Subversion BugZilla Integration




Samartha InfoSolutions Pvt Ltd.

#190, 2nd phase, 2nd Stage,
WOC Road, Service Road,
Bangalore560 086
Karnataka, INDIA.

Contact Us




            In Software lifecycle, there are several phases like requirement, design, coding, testing etc.. We use tools in each phase to streamline the development & release process. Subversion & BugZilla are such tools used for Configuration Management (Version control) & Bug tracking. These are two independent products. In SDLC, it will be very useful if SCM & Bug tracking tools are integrated.  


            Samartha InfoSolutions is an IT Service industry, having its core strength in providing SCM implementation & maintenance support, have come out with this integration solution to meet the SDLC requirement & its customer expectation.


            This document briefs about how this integration can be done considering one Use Case.


            The scope of this document is restricted to Subversion as SCM tool & Bugzilla as bug tracking system. But the logic which is used to develop this can be leveraged to any such tools.


Note: Please use this document carefully and Samartha InfoSolutions is not responsible for any damages caused.




Subversion should installed and configured

Bugzilla should installed and configured




Following are the requirements:

1)      Subversion on Linux/Unix platform

2)      PHP on Subversion server

3)      MySql

4)      Apache

5)      BugZilla

6)      Subversion clients on the client desktops





Requirement: Each change to a Source file needs to have a standard comment in a predefined format with BUG ID in it. Only the user assigned for work on a specific bug will be allowed to checkin for the bug.


By just using subversion, it is not possible to force this to happen. There should be a stable process which forces to use a perfect format of putting comments during check in.


To accomplish this, write a pre operation trigger which gets invoked as soon as a check in operation is performed & does the following actions.

1)      Check if the comment is provided or not.

2)      Check if this comment is in accordance with the predefined format.

3)      Get the bug ID, User who is checking in & the actual comment from this.

4)      Verify the BugID & User in the BugZilla database.

5)      If all the above steps are successful, perform the Checkin & Update the bugzilla database with comment.

6)      Otherwise abort the check in process.




There is no change in the usage of Subversion or Bugzilla. The integration will just force the format of the comment. The format of comment should be

<Bug ID> <BugZilla User ID> <Actual Comment>



123 Checking in to test.



123” is the bug ID” is the bugzilla user ID

Checking in to test” is the actual comment.




Pseudo code

Subversion has 9 types of HOOKs. The integration script is called from pre-commit hook.

  1. Invoke integration script from pre-commit hook

  2. Validate the pattern of the comment

  3. Check the bug-id, user id against Bugzilla database

  4. If matches allow the code check-in into Subversion and insert the comment into Bugzilla

  5. Otherwise stop the check-in and display error message on the Subversion client GUI.