mardi 17 février 2009

Engineering dictator strikes back : querying your team repository

That post inaugurate a series of "modeling kata"'s. Modeling kata's are about basic usage of Eclipse modeling and related technologies to create fun stuffs, and more importantly doing it again and again using different ways and analysing the pros and cons of each solution. Of course the "kata" terminology is not from me.

Let's introduce the problem :

Taking my role of " Non Benevolent Dictator for Life " at work seriously, I like to keep an eye on the source code history of our products; on the mass of changes and on the places where the changes are made.

That was the idea behind the teamlog2rss.py script I wrote last year. But now, going a bit further in the "big brother" concepts, I hacked a small EMF model to retrieve the logs from the team repository and to generate reports, I'm then able to analyze the log messages and file uri's :)

The model is straightforward, here is a quick extract of the result :



The model implementation is querying Subversive to retrieve the logs through a "derived reference". That solution is quite crappy as accessing the model means going through the network (meaning - that's slow), but the advantage is : my EMF model is a plain old EMF model, and as such any tool will work with it.

Then I'm producing reports using Acceleo, for each week and commiter, I'm checking:
  • how many changes have been made
  • how many unique files have been changed
  • how many tests have been changed
  • how many "happy checkstyle" commits were done
  • commit activity concerning "bugfixing"
  • how many "happy boyscout" commits were done
here is an extract of the M2T template:



I'm then able to generate HTML, and even generate a small uri for Google charts to get nice pictures:


I'm even able to add the commiters picture in the "weekly hall of fame" through user code tags in the HTML :)

That said, M2T transformation is not the best pick for such a need, I really need to deduce new information from the original teamlog data to produce, afterwards, a nice report. Next try on this kata will probably involve M2M transformation to deduce the information, or Birt reporting... But, I don't want to spoil you, stay tuned ;)