Friday, November 18, 2011

Automating (almost) everything using Git, Gerrit, Hudson and Mylyn

A presentation on how good open source tools can be integrated together to push development efficiency up.

Presentation slides here.

First, here are all the involved tools references
Git (Distributed Version Control System-DVCS tool)
Gerrit (Code Review tool)
Hudson + Jenkins (Continuous Integration-CI tools), known as Hudkins and
Mylyn (Eclipse-based Application Lifecycle Management-ALM tool)

Why GIT?
  • DVCS
  • Open Source
  • Airplane-friendly (all commits can be done offline since in DVCS, commits are done locally - a push is required to put it on remote servers)
  • Push and Pull (inter-developer direct exchange, no need to pass via central server)
  • Branching and Merging (amazing for this aspect - automatic merging tool which was required because of the so many Linux kernel contributors) - based on the if it hurts, do it more often!
Why Hudkins?
  • CI
  • Open Source
  • Large community
  • Lots of plugins
Why Gerrit?
  • Code reviews for GIT (line by line annotations)
  • Open Source
  • Permit to build a Workflow in the system
  • Access Control (originally created to manage Android contributions)
Why Mylyn?
  • 90% of IDE's content is irrelevant... (see image) - (lack of integration, information overload, context-loss when multi tasking or when exchanging tasks with another developer)
  • Open Source
  • Part of Eclipse 99% of the time
  • NOTES: Other IDEs supported? Seems not. Apparently, it has performance issues (Eclipse users seem to disable Mylyn right off the bat...)
Pie chart of a developers's day
see preso image, but essentially, a typical developer takes 34% of his day reading/writing code, 10% testing code and the rest of the day producing nothing significant (including a 22% for pure interruptions inefficiencies)

Why Mylyn part 2?
    • Mylin can track all you do within a task (what classes you changed, the web pages you access, etc.)
    • Ex: A guy goes on vacation; you can by reopening the task to complete it in his place, access the context that actually follows the tasks and thus see the relevant classes, web pages, etc.
    • Task focused interface (task system in the background - like JIRA, Bugzilla, etc.)
    • Over 60 ALM tools supported
    Contribution Workflow
    See image from preso
    Before: Patch based code reviews
    • essentially a back and forth thing between contributors and intergrators (code did not compile, then a test did not pass, etc.) - typically, it used to take approximately 2 days to integrate a piece of code into one of the open source projects listed above
    • Limited automation
    • Difficult to trace changes
    • cumbersome process
    • Late feedback
    After tools integration:
    • Code pushed to Gerrit (which acts as a GIT repository - with code review automation)
    • Code changes then pulled from Hudson, build is done and Hudson vote back to Gerrit based on all required gates passed or not (build OK: vote +1, tests OK: vote +1, etc.); if a step fail, data flows back into developer IDEs mentioning for example that a certain test failed, etc. the feedback is almost instantaneous.
    Demo: Collaboration
    A complete demo was conducted to show the previously discussed tools integration. Very interesting even though it was Eclipse-based ( ;-) )

    NOTE on Business Processes
    It is possible to model business processes at Gerrit level. For example, all developers could have access rights to commit to Gerrit, but only a certain predefined user can commit to the central repository.

    Awesome! How do we do it at home now?

    Setting up the server (in that order)
    • Install all the softwares and then:
    • Clone GIT repository
    • Initialize Gerrit
    • Register and configure a Gerrit human user
    • Register and configure a Build user (the automating user)
    • Install Hudkins Git and Gerrit plugins
    • Configure standard Hudkins build
    • Configure Hudkins Gerrit build (integrate the review within the build)
    Setting up the client (contributor - in that order)
    • Install EGit, Mylyn Builds (Hudson), and Mylyn Reviews (Gerrit)
    • Clone GIT repository (pull)
    • Configure Gerrit as remote master
    • There is no step 4! Done.
    Setting up the client (committer - in that order)
    • Configure a Mylyn builds Hudson repository
    • Configure a Mylyn review Gerrit repository
    • Create a task query for Gerrit
    • There is no step 4! Done.

    No comments:

    Post a Comment

    Note: Only a member of this blog may post a comment.