Samartha InfoSolutions Pvt Ltd.
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.
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
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 email@example.com Checking in to test.
“123” is the bug ID
“firstname.lastname@example.org” is the bugzilla user ID
“Checking in to test” is the actual comment.
Subversion has 9 types of HOOKs. The integration script is called from pre-commit hook.
Invoke integration script from pre-commit hook
Validate the pattern of the comment
Check the bug-id, user id against Bugzilla database
If matches allow the code check-in into Subversion and insert the comment into Bugzilla
Otherwise stop the check-in and display error message on the Subversion client GUI.