Using Mylyn with GForge

In the Planets project we use GForge for issue tracking, which is not specifically supported by Mylyn. That’s a pity, as Mylyn makes me actually use these tracking systems, I guess because integrated they provide benefit instead of being overhead (pretty much the same topic as in a recent posting actually).

The great thing is Mylyn has a generic Web repository connector. I could not find much info on setting that up for GForge elsewhere, and the included GForge template (for a specific site) didn’t work for me (their setup seems all different), so I make the stuff I figured out available here:

  • Server: Specify full path to the actual project under GForge, e.g. http://gforge.planets-project.eu/gf/project/if_sp
  • Under “Additional settings” add a parameter called tracker_id with the value of one of your trackers, e.g. 17 (bug, feature, etc. trackers)
  • Task URL: ${serverUrl}/tracker/?action=TrackerItemEdit&tracker_item_id=
  • New Task URL: ${serverUrl}/tracker/?action=TrackerItemAdd&tracker_id=${tracker_id}
  • Query Request URL: ${serverUrl}/tracker/?action=TrackerItemBrowse&tracker_id=${tracker_id}
  • Query Pattern: <tr +id="content." valign="top" ?><td ?>({Id}\d+?)</td><td ?><a href="[\w="/;&?]+?">({Description}[^<]+)</a></td><td bgcolor="#\w+?">({Type}\d)</td><td ?>(?:(?:<a href="[\w=/]+?">)?({Owner}[^<]+)(:?</a>)?<br ?/>)+</td><td ?><a href="[\w=/]+?">[^<]+</a></td><td ?>({Status}[^<]+)</td>

The pattern is a bit obscure but it works and supports unassigned tasks and multiple assignees (but as Mylyn expects only one, others are ignored) and might still work if in the future a few arbitrary blanks in the GForge HTML are removed. I’m not using a “.” anywhere as Mylyn creates a Pattern object with the Pattern.DOTALL option, which caused trouble here (hail to open source, I would have never figured out why it was not working without checking what it’s actually doing).

Now when creating a query, you can specify the desired tracker by changing the tracker_id parameter (for the bug, feature, etc. trackers) and refine the query by changing the values in the pattern. For instance, to see open tasks only, replace ({Status}[^<]+) with ({Status}Open) or just Open. In the same way you could specify to query only tasks assigned to you, etc.

The most recent Mylyn version won’t complain when a query is empty (like the query for open tasks assigned to you when all your work is done), making all of this quite usable once the queries are set up. If you need to log in to access your GForge site, check the Mylyn User Guide.
.


About this entry