Integration Goodies for Git, Gerrit and Mylyn

by Steffen Pingel, October 3rd, 2011

It’s always a good time when you meet people in person that you otherwise only interact with through the Eclipse.org Bugzilla. Recently, Matthias Sohn organized a week long hackathon at the SAP offices in Walldorf bringing together committers from EGit, Mylyn, Gerrit and the community. From Tasktop, Benjamin Muskalla and I joined the hackathon. We enjoyed lots of free SAP coffee and had a great time working with the rest of the team. We started the first day with a brainstorm session which resulted in a task board full of story cards.

My first goal was to get the Mylyn Gerrit connector working with the latest version of Gerrit. Since the early days of Mylyn we have worked bootstrapped feeling the same pains as everyone else using our tools. We know how important it is to eat our own dogfood and now that code reviews in Gerrit have (almost) become routine in our everyday workflows. Updating the tooling to work with the server used by the Mylyn project was an obvious step.

I’m happy that we made good progress during the week in Walldorf and the connector now works with Gerrit 2.2 while maintaining backwards compatibility with Gerrit 2.1.

Since the Mylyn instance is configured for OpenID authentication I also added support for that. It was an interesting exercise to extend the tasks framework to allow authentication through a browser window in a way that works across Windows, Linux and Mac.

Once the connector was working with the latest Gerrit, I took the opportunity to work with Dariusz from EGit Sychronize view fame. Dariusz knew instantly what classes to look at to enable navigating through patch sets from the Synchronize view.

The feature is still a work in progress but basic functionality is already available in the latest weekly build: The compare action in the review editor fetches the patch set and opens the corresponding changes in the Sychronize view.

Another useful enhancement to the Gerrit Connector was committed by Sascha Scholz who added a field for specifying free form queries.

We had lively discussions with Stefan Lay, Matthias Sohn, Benjamin Muskalla, Manuel Donninger and others around automating task-based branching. Not surprisingly everyone in the room had slightly different ways of working when it came to Git and there was no straight forward answer how to best automate this. I believe we settled on a nice workflow that is not intrusive:

  1. On task deactivation, the checked out branches for all repositories connected to projects referenced in the task context are remembered
  2. On task activation, branches that were checked out on last deactivation (if any) are automatically checked out again restoring the same workbench state

To support that Matthias committed a change in EGit that accelerates creating new branches by making the “Switch To” menu top-level in the popup menu of the Git repositories view. Additionally, Manuel proposed an enhancement to pre-populate the branch name based on the summary of the active task literally reducing the click count for creating a task branch to 4 clicks.

Based on the progress that Manuel had already made, a number of additional changes to persist branch information per task for Mylyn were proposed that are currently under review. If you have any input, please comment on bug 309578.

A number of other features that are beyond the scope of this post were being worked on throughout the week including significant performance improvements for EGit. Of course we didn’t limit our activities to coding but socialising was a big part of the hackathon.

Thanks to Matthias for organizing the meeting. Hopefully we’ll get a chance to repeat this in the future!

6 Responses to “Integration Goodies for Git, Gerrit and Mylyn”

  1. Oliver Gierke Says:

    Wow, this is just brilliant. Time to update my “Increase developer productivity with Mylyn” talk ;).

  2. Ron Says:

    Hi,

    The latest version of the Gerrit Connector seems to be 0.8.0 from June. The nightly update site seems to contain nothing (at least, that’s what Eclipse tells me).

    BUt this blog post indicates that OpenID in the connector arrived at October…

    So, how can one use the connector to authenticate with OpenID? For that matter, we can’t login except as anonymous, to any Gerrit installation. Any help would be appreciated!

  3. Steffen Pingel Says:

    Thanks for pointing that out. The nightly site was indeed pointing to a non existing repository. I have fixed that. The nightly site should now work again.

    I would recommend the Mylyn Snapshots update site that is listed at http://eclipse.org/mylyn/downloads/ to consume the latest weekly build of the Gerrit connector. It sometimes lags a few days behind the nightly site but it has all required Mylyn dependencies that are required to install the Gerrit connector.

  4. Ron Says:

    Thanks, we’ll try that.

    Is there a mailing list or forum where one can give feedback or ask questions about the Gerrit Connector?

    Best regards

  5. Steffen Pingel Says:

    You can use the Mylyn forum for questions: http://www.eclipse.org/forums/index.php?t=thread&frm_id=83&S=df429d3c2bf78bb5c03317ff90c312ae and Bugzilla for defects or suggestions for enhancement: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Mylyn%20Reviews.

    For development related discussions I would recommend the project’s mailing list: https://dev.eclipse.org/mailman/listinfo/mylyn-reviews-dev

    Thanks for trying out the connector! Please let us know what you think.

  6. vas Says:

    Hi How did you get the openid login screen in eclipse . I am struggling for the past few days i am not able to get it work . My gerrit is running on http://10.1.10.176:8081/gerrit

    When i click on validate credentials in Eclipse gerrit connector this is the message i get. Please help.

    “Unable to login to http://10.1.10.176:8081/gerrit. Please validate credentials via Task Repositories view.”

Leave a Reply