The Continuous Integration Game plugin

This plugin introduces a game where users gets point on improving the builds.

No longer maintained in the Hudson community

This plugin has moved it's development to the Jenkins infrastructure, which can be found at the new Jenkins Wiki page. Please report issues and find the latest versions in the Jenkins community.

The plugin is a simple proof of concept of the Build game that was created by Clint Shank. The idea behind the game is to decrease the number of times a build becomes broken. To win the game the developers have to commit code that is compiling and keep adding unit tests.

Usage

Configuration

Version requirements

Note that the plugin version 1.13+ requires Hudson 1.320 to work and the following plugin versions:

  • Checkstyle 3.1
  • Findbugs 4.0
  • PMD 3.1
  • Tasks 4.0
  • Warnings 3.0
  • Violations 0.5.4
  • analysis-core 1.0

The plugin is not activated for all jobs at start, each separate job has to activate the game. The game can also be de-activated in one job if some large merge activity is going to take place. To activate the game for a job, go to the job configuration page and check the Continuous integration game box.

Build score card

For each build the game calculates, according to the rules, the number of points that it is worth. Each user that is responsible for the build (ie comitters) receives the points.

Clicking on the link shows what rules that were involved in the point calculation.

Leader board

To see who is winning the build game, there is a leader board that is shown on the front page.

Rules

The rules of the game are:

  • -10 points for breaking a build
  • 0 points for breaking a build that already was broken
  • +1 points for doing a build with no failures (unstable builds gives no points)
  • -1 points for each new test failures
  • +1 points for each new test that passes

Rules that depend on other plugins:

  • PMD Plugin. Adding/removing a HIGH priority warning = -5/+5. Adding/removing a MEDIUM priority warning = -3/+3. Adding/removing a LOW priority warning = -1/+1.
  • Task Scanner Plugin. Adding/removing a HIGH priority task = -5/+5. Adding/removing a MEDIUM priority task = -3/+3. Adding/removing a LOW priority task = -1/+1
  • Violations Plugin. Adding/removing a violation = -1/+1. Adding/removing a duplication violation = -5/+5.
  • FindBugs Plugin. Adding/removing a HIGH priority findbugs warning = -5/+5. Adding/removing a MEDIUM priority findbugs warning = -3/+3. Adding/removing a LOW priority findbugs warning = -1/+1
  • Warnings Plugin. Adding/removing a compiler warning = -1/+1.
  • Checkstyle Plugin. Adding/removing a checkstyle warning = -1/+1.

Adding rules to the game

Currently there are three ways to add rules to the game.

Patch

Send me a patch for the rule implementation, and I can include it in the main game plugin.

Including rules in another plugin

You are a maintainer of a plugin and would like to add rules to the game with data from your plugin. To do this you should declare the game plugin as an optional dependency to your plugin. To create rules implement the interface Rule, and group them together in a RuleSet. To add a RuleSet to the game, add it to the game's RuleBook.

hudson.plugins.cigame.PluginImpl.GAME_PUBLISHER_DESCRIPTOR.getRuleBook().addRuleSet(pluginruleset);

If there are already rules for your plugin in the game plugin, let me know so they can be removed from the plugin.

Include rules in a third plugin

You would like to add rules to the game that are only valid for your organization and do not want to share them. To do this you should declare the game plugin as a mandatory dependency to your plugin. Then implement the Rule and add them to the RuleBook as in above point.

Changelog

Upcoming version

Version 1.17

  • Added stylecop warnings for the violations plugin HUDSON-4847

Version 1.16

Version 1.15

  • Fixed a bug where a player that exists in several SCM log entries would receive points for each entry. (issue #4470)

Version 1.14

Version 1.13 Requires Hudson 1.320 or later

  • Fixed so no points are awarded for a build if previous build reports has an error. (issue #4391)
  • Hopefully fixed the NPE in the Violations plugin. (issue #3726)
  • Added feature to handle user names case insensitive. (issue #3990)
  • Fixed 404 when clicking on Leaderboard in any view but the main view (issue #3604)
  • Added localisation support. So if you want help out, please check the Internationalization page. (issue #3484)

Version 1.12

  • Added a description column in the leader board (issue #4141)
  • Fixed most rules so the person who fixes a broken build doesnt get any penalties or rewards for it. The person will still get the points for fixing the build. (issue #2592)

Version 1.11

  • Fixed so points are added or subtracted for test cases when run in a maven job (issue #2542)

Version 1.7

  • Fixed NoSuchMethod exception when using newer versions of Warnings and Checkstyle plugins (issue #2169, issue #2218)

Version 1.6

  • Points are no longer awarded for violations and checkstyle 'fixes' when the is build is broken (issue #1884)

Version 1.5

  • Warnings, FindBugs, PMD, Open tasks, Checkstyle rules no longer throws exception when it is used for the first time (issue #1810)
  • Anonymous users no longer see the "Reset scores" link next to the leader board (issue #1837)

Version 1.4

  • Added option to exclude users from the game (issue #1608)
  • Added option for Administrators to change the score of each user (issue #1608)
  • Now it is possible for Administrators (or everyone if no there is no security) to reset all scores (issue #1754)

Version 1.3

  • Using Violations plugin 0.6.0 no longer throws an exception (issue #1755)

Version 1.2 Requires Hudson 1.211 or later

  • Fixed that points are given for each added/failed unit test (issue #1721)
  • Added rules for the PMD Plugin. Adding/removing a HIGH priority warning = -5/+5. Adding/removing a MEDIUM priority warning = -3/+3. Adding/removing a LOW priority warning = -1/+1.
  • Added rules for the Task Scanner Plugin. Adding/removing a HIGH priority task = -5/+5. Adding/removing a MEDIUM priority task = -3/+3. Adding/removing a LOW priority task = -1/+1
  • Added rules for the Violations Plugin. Adding/removing a violation = -1/+1. Adding/removing a duplication violation = +5/-5.
  • Added rules for the FindBugs Plugin. Adding/removing a HIGH priority findbugs warning = -5/+5. Adding/removing a MEDIUM priority findbugs warning = -3/+3. Adding/removing a LOW priority findbugs warning = -1/+1 (issue #1743)
  • Warnings Plugin. Adding/removing a compiler warning = -1/+1.
  • Checkstyle Plugin. Adding/removing a checkstyle warning = -1/+1.

Version 1.1

  • Fixed that no points are given out when a build goes from failed to unstable

Version 1.0

  • Initial version with hard coded rules

Labels:

plugin-misc plugin-misc Delete
plugin-maven plugin-maven Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Aug 23, 2009

    Christoph Kutzinski says:

    In my opinion, it can be potentially dangerous to give negative points for addin...

    In my opinion, it can be potentially dangerous to give negative points for adding tasks. If one really wants to win the game, he just wouldn't add any ToDo tags even if they would be approriate.

    1. Mar 25, 2010

      Leo Wandersleb says:

      I came here to find out about how to switch off this punishment for documenting ...

      I came here to find out about how to switch off this punishment for documenting flaws in the code.

      As granting +x for removing tasks and -0 for adding them would invite "players" to first commit skeletons with tasks and then remove them afterwards, switching off this task-scanner-score would be a good option.

  2. Aug 28, 2009

    Trond Andersen says:

    Is it possible to add rules with regards to reduced code coverage from the Clove...

    Is it possible to add rules with regards to reduced code coverage from the Clover Plugin and/or the NCover Plugin? For instance 1% less coverage results in one minus point, 1% better coverage results in 1 or 2 plus points.

  3. Sep 08, 2009

    Fernando Rubbo says:

    first of all, I think this plugin is a great idea, but it is not clear, at least...

    first of all, I think this plugin is a great idea, but it is not clear, at least for me, how this plugin calculates the points. For example:

    In the score card I have this

    3 checkstyle warnings were fixed 3.0
    1 new NORMAL priority findbugs warnings were found -3.0
    2 new NORMAL priority PMD warnings were found -6.0

    and the participants (some of then are repeating 3 or 4 times, others only once)

    However, the Leader board result in the following table

    fernando
    0.0
    marcelo
    -6.0
    isaias
    -6.0
    gelson
    -18.0
    ale
    -36.0
    andrade
    -42.0

     My question is. How the above points are divided into these developers? Why one have -42 and other -6 from only one build where the amount of points is -3?

    It seems that each file a developer has committed is multiplied by an given number of points. But if he/she has only 1 new warning and he/she has committed 10 files, he will get -10 points. what is not fair.

    1. Sep 15, 2009

      Erik Ramfelt says:

      That seems odd, i will have to look into it. Could you open an issue about it?

      That seems odd, i will have to look into it. Could you open an issue about it?

      1. Sep 15, 2009

        Fernando Rubbo says:

        Done. Issue 4471 - Odd behavior calculating points

        Done. Issue 4471 - Odd behavior calculating points

  4. Sep 16, 2009

    Iñaki Abete says:

    I've installed Continuous Integration Game and FindBugs plugins. FindBugs found...

    I've installed Continuous Integration Game and FindBugs plugins. FindBugs found a lot of bugs but the game doesn't assign points.
    How can I relate these plugins?

  5. Oct 29, 2009

    Matt Baker says:

    For some reason it never associates a build with an individual.  Every time...

    For some reason it never associates a build with an individual.  Every time a build goes off it says how many points it was worth but then the list of players involved in that build is always empty.  Does it matter that Hudson doesn't actually store my users?  All authentication is done through LDAP.  I'm not sure which version I'm using, but does this sound familiar?

  6. Nov 06, 2009

    Francois Cottet says:

    In ViolationsRuleSet we are missing the stylecop rules. We might have something ...

    In ViolationsRuleSet we are missing the stylecop rules. We might have something like:

            add(new DefaultViolationRule("stylecop", Messages.ViolationRuleSet_StylecopRule_Name(), -1, 1)); //$NON-NLS-1$ //$NON-NLS-2$
    

    Another concern is the violation RuleSet overlapping the individual rules such as checkstyle, findbugs and pmd. So we the developer add/fix an issue, he will earn twice the points. In the end it's not such an issue but the number of points for checkstyle or pmd become a bit "overweighted" compare to test or build points.

    Rule Points
    5 Checkstyle violation were fixed 5.0
    5 checkstyle warnings were fixed 5.0
    5 NORMAL priority PMD warnings were fixed 15.0
    5 PMD violation were fixed 5.0
    The build was successful 1.0
  7. Dec 02, 2009

    saab says:

    After updating hudson to ver. 1.336 I met an exception thrown by this component....

    After updating hudson to ver. 1.336 I met an exception thrown by this component. The exception is shown as below.
    SEVERE: Executor throw an exception unexpectedly
    java.lang.NoClassDefFoundError: hudson/plugins/tasks/util/model/Priority
    at hudson.plugins.cigame.rules.plugins.opentasks.OpenTasksRuleSet.loadRules(OpenTasksRuleSet.java:14)
    at hudson.plugins.cigame.rules.plugins.PluginRuleSet.getRules(PluginRuleSet.java:48)
    at hudson.plugins.cigame.model.ScoreCard.record(ScoreCard.java:33)
    at hudson.plugins.cigame.model.ScoreCard.record(ScoreCard.java:54)
    at hudson.plugins.cigame.GamePublisher.perform(GamePublisher.java:56)
    at hudson.plugins.cigame.GamePublisher.perform(GamePublisher.java:42)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:577)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:563)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:551)
    at hudson.model.Build$RunnerImpl.cleanUp(Build.java:158)
    at hudson.model.Run.run(Run.java:1218)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:123)

    Could you give a workaround?

    1. Dec 09, 2009

      Richard Fuller says:

      I saw this error too when I updated to 1.336. This appears to be a plugin probl...

      I saw this error too when I updated to 1.336. This appears to be a plugin problem with this plugin and FindBugs 4.0. I went back to FindBugs 3.13 and it now works.

  8. Feb 05, 2010

    Patrick Renaud says:

    Our Hudson server is hosting several un-related projects and teams. It sems that...

    Our Hudson server is hosting several un-related projects and teams. It sems that the CI Game information is global to the entire Hudson instance, making the Leader Board somewhat irrelevant as it lists users from different projects, with different project rythms and facing different challenges.

    However, the individual team members are getting quite excited when looking at the points they earn or lose as a result of their work, which is a good thing! :-). Now, would it possible to add a feature where the CI Games would capture data differently so that the Leader Board would show users on a per-project basis instead, or something along those lines?

    1. Feb 17, 2010

      Erik Ramfelt says:

      There is a feature request for adding teams for players, whereas a player can pa...

      There is a feature request for adding teams for players, whereas a player can participate in one (or several) teams. Should the leader board contain only points from one project or should it contain points for a player from all projects? If so, then the game needs to store points per player and project. As of now it only stores points per player.

      Please add this idea to the issue tracker as a RFC.

  9. May 28, 2010

    Stuart Grimshaw says:

    I've got a few of the other plugins installed (PMD, Checkstyle & Findbugs) b...

    I've got a few of the other plugins installed (PMD, Checkstyle & Findbugs) but none of the points mentioned are being added to the scorecard when people fix them, but they do still get a point when the build works or they add unit tests etc.

    1. May 28, 2010

      Erik Ramfelt says:

      It could be various reasons, please open up an issue in the issue tracker detail...

      It could be various reasons, please open up an issue in the issue tracker detailing what versions you are running of Hudson and plugins.

      1. Jun 07, 2010

        Stuart Grimshaw says:

        Thank's Erik, I've been on holiday for a week, and I'm going to try this solutio...

        Thank's Erik, I've been on holiday for a week, and I'm going to try this solution first before I raise a new one:

        http://issues.hudson-ci.org/browse/HUDSON-5819

  10. Aug 09, 2010

    Robert Redd says:

    How do I prevent users from just changing their score in their people configurat...

    How do I prevent users from just changing their score in their people configuration screen?  There is the checkbox to decide to participate or not and also the score box where you can enter a score.  Is there a way to prevent people from either changing their score or at least preventing them from updating their profile information at all?

    We're tied into LDAP.

  11. Sep 22, 2010

    Jens Keller says:

    I have the job sequence build->deploy->test in a web application scenario....

    I have the job sequence build->deploy->test in a web application scenario.

    The build is triggered by a code change, but if the code change leads to a better test result, then the committer doesn't get the points although there is a common fingerprint artifact available for all jobs in the sequence.

    He only gets the points for the successful build, but for the successor jobs it displays only "No players participated in this build".

    Is it possible that the "player" information gets collected from the upstreams?

    Best regards,

    Jens

  12. May 18, 2011

    niko says:

    How do I prevent users from just changing their score in their people configura...

    How do I prevent users from just changing their score in their people configuration screen?  There is the checkbox to decide to participate or not and also the score box where you can enter a score.  Is there a way to prevent people from either changing their score or at least preventing them from updating their profile information at all?