ALM Open-Source Tools – Eclipse Mylyn, Subclipse, Trac & Subversion

Posted on August 19, 2010

0


I have been using Eclipse with Mylyn & Subclipse plug-ins, Trac for ticket/task/defect tracking and subversion for source control, for some time now. My main goal was to see how well these products are integrated to help a developer in associating tickets/tasks/defects stored in trac and the source code files stored in SVN, from a very popular Eclipse IDE used by developers. I must say that the currently available integration is quite good & useful, but I do not how many development teams have realized the benefits of doing this source code change audit trail to tasks/defects. The benefits will be elaborated in a separate post but in this post, I will just focus on some of the details of this integration.

As always, it is better to explain the integration using the following picture:

Terminology

Let me first define some standard terminology before giving the details:

Subversion Changeset: a simple definition of changeset would be a collection of changes with a unique name.

Subversion Version Tree: Subversion manages versioned trees as first-order objects (the repository is an array of trees), and the changesets are things that are derived (by comparing adjacent trees).

Subversion Global VersionNumber: names a tree in the repository, it’s the way the repository looked after the Nth commit. It’s also the name of an implicit changeset: if you compare tree N with tree N-1, you can derive the exact patch that was committed. After each commit, this version number is printed as shown below:

Adding         S101g-XtnTmpl/docs/custom-pdf-output-unix.xsl

Adding         S101g-XtnTmpl/docs/images

Adding  (bin)  S101g-XtnTmpl/docs/images/tejas-logo.jpg

Adding         S101g-XtnTmpl/build.xml

Committed revision 64.

Trac ticket: is similar to a change-request but can be used to manage enhancements, tasks and defects.

Guidelines

To have proper audit trail of the changes in the Version Control System (VCS) or S/W configuration management  (SCM)system, one should associate a change-set with one or more tickets. Better if is associated with only one ticket since identifiable change-sets should be as granular as the tickets. Similarly if each ticket is not too broad to take weeks to complete, it should be implemented in just one change-set – thus achieving a one-to-one mapping between tickets and change-sets. Some Change Management or Defect Tracking systems provide a concept of sub-task which should be used in breaking macro or mega-tasks to smaller easily implementable tasks.

Eclipse Integration with Trac & SVN

Eclipse Mylyn Plug-in for SVN/Trac Integration requires the installation of  connector for Trac & the  Subclipse plug-in for committing changes to SVN. There is also Subclipse integration for Mylyn which allows you to add templates for commit messages and for tracking change-sets. The main features in Mylyn are task-focused editing and creating filtered task-lists which are kept in sync with the Task Repository

Trac & SVN Integration

One needs to configure source repositories in Trac admin screens to make the Trac source code browser to work and also for change-sets to be displayed. Also the Trac Commit Ticket Updater plug-in which is bundled with Trac has to be enabled. The Ticket changesets plug-in has to be installed & enabled. This allows associating SVN commits & tickets with special string in commit messages such as: “Fixes #42 and #43”, etc. Also, on the SVN side, the post-commit & post-prop-change hooks have to be defined which invokes the appropriate trac-admin commands for informing Trac about new change-sets and the need for SVN repository synchronization.

Gotchas to Watch Out For & Subtilities

There are certain things which I encountered and which can be remedied as follows:

  1. In MacOS, while running trac-admin, one gets the “ValueError: expected only letters, got ‘utf-8′”, this can be fixed by setting the LANGUAGE to en_US.
  2. While referring to change-sets using Trac wiki using [N], one gets no default SVN repository error. An SVN repository can be made default by having an empty string as name.
  3. The SVN pre-revprop-change hook has to be defined for allowing changes to the commit log (svn:log) property. This can be done by renaming the pre-revprop-change.tmpl file to pre-revprop-change only.
  4. Sometimes, one needs to change the commit message for existing SVN version tree – for example if you want to add additional CRs to that revision. This can be done by the command:
    • svn propset svn:log ‘Fixes #<CR1>, #<CR2>’ -r<revNo> –revprop

Conclusion

To get correct audit trail of the changes in the SCM to the task repository, the developer needs to follow some amount of discipline, but that discipline is greatly simplified & burden reduced through the use of nice Eclipse Mylyn plug-in, other plug-ins available in Trac and SVN hooks.

Advertisements
Posted in: Open-Source