Subversion Integration with fixx
by Damian Nicholson Under api, fixxSince publishing the fixx api in January, we have received a number of requests for source control integration. As a result I’ve gone ahead and created a nice script to get the ball rolling on this front, to be ran as part of the post commit hook. A post commit hook is a script that is ran after checking in some new code to your SCM repository. Lifted directly from the svnbook itself:
Most people use this hook to send out descriptive emails about the commit or to notify some other tool (such as an issue tracker) that a commit has happened.
This opens up the opportunity for us to latch onto the post commit hook whenever we commit new code into our repository, and feed the recently changed knowledge into fixx using our api. This has a number of advantages, as it means that fixing bugs and your SCM system are no longer disjointed processes.
I bet you’ve done the equivalent of this before svn commit -m ''. Well now that commit message gets logged in fixx for everyone to see. Therefore it’s worth getting into the good practice of inputting descriptive commit messages.
If you think about regression bugs this is also ideal as you can see all the files that were changed/added in originally “fixing” that issue. This is just one of many reasons consolidating your SCM with fixx has value and is beneficial to your workflow.
Here at hedgehog lab we primarily use Subversion as our source control system for most projects, and this script in particular is tailored to work with Subversion through the magic that is svnlook. But I’m confident that this can be easily adapted to fit whatever SCM your currently using.
Note: For this script to work properly the only prerequisites are that you have a copy of fixx running, and both Subversion and Ruby installed.
Basically the script looks for the issue id, prefixed by a hashtag as part of the commit message in order to log the changes in this revision in fixx.
So if I committed some CSS changes to improve the rendering of fixx, my commit could go something like this:
svn commit -m '#12 Dashboard CSS Tweaks'
A new comment would be created under issue 12, with the following content.
Commited by: Damian Nicholson Commit message: Dashboard CSS Tweaks Files changed: U style.css
Just to point out that the #issueId can be placed anywhere in the commit message, though if one is not present, it won’t be logged in fixx.
Since we want to bridge the gap between SCM and fixx completely, we have also roadmapped in new api functionality, so other options will be able to be supplied with the commit message to create, resolve and close issues in fixx sometime in the near future.
Instructions on how to go about using the script can be found within the script itself, which you can find here so enjoy!