Child pages
  • The Continuous Integration Game plugin
Skip to end of metadata
Go to start of metadata

Plugin Information

View Continuous Integration game on the plugin site for more information.

This plugin introduces a game where users gets point on improving the builds.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, click "Add post-build action" and select "Continuous integration game" from the list of available post-build actions.

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

Version 1.26 (2016-10-21)compatibility with DSLs (pull-19)

Version 1.26 (2016-10-21)

  • compatibility with DSLs (pull-19)

Version 1.25 (2016-06-30)

  • Support for jacoco coverage (pull-16)

Version 1.24 (2016-03-12)

  • Support for maven findbugs scores (pull-18)

Version 1.23 (2015-11-08)

  • Prevent user to edit score value (pull-17)

Version 1.22 (2015-08-21)

  • Expose leaderboard via API (pull-9)

Version 1.21 (2015-02-17)

  • Adapt to API changes introduced in Jenkins core, bump version dependencies (issue #24478)

Version 1.20 (2014-07-19)

  • Remember history per user where most recent awarded points are coming from (pull-7)
  • Correct help link for case insensitive setting (issue #20125)
  • Configurable points to be awarded for matching rules (issue #6446
  • leaderboard shows a sortable position number (pull-12)

Version 1.19 (2012-09-17)

  • Prevent XSS in user name (JENKINS-14309)
  • authenticated users can modify their own scores (JENKINS-3575)
  • CI game fails with NPE (JENKINS-11041)
  • Added support for Markup Formatter in the LeaderBoard for displaying the user's description (pull-2)

Version 1.18 (2011-02-18)

  • added support for incremental Maven builds (not yet implemented for the PMD and the Violations rule)

Version 1.17

  • Added stylecop warnings for the violations plugin JENKINS-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. (JENKINS-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. (JENKINS-4391)
  • Hopefully fixed the NPE in the Violations plugin. (JENKINS-3726)
  • Added feature to handle user names case insensitive. (JENKINS-3990)
  • Fixed 404 when clicking on Leaderboard in any view but the main view (JENKINS-3604)
  • Added localisation support. So if you want help out, please check the Internationalization page. (JENKINS-3484)

Version 1.12

  • Added a description column in the leader board (JENKINS-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. (JENKINS-2592)

Version 1.11

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

Version 1.7

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

Version 1.6

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

Version 1.5

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

Version 1.4

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

Version 1.3

  • Using Violations plugin 0.6.0 no longer throws an exception (JENKINS-1755)

Version 1.2 Requires Hudson 1.211 or later

  • Fixed that points are given for each added/failed unit test (JENKINS-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 (JENKINS-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

31 Comments

  1. Unknown User (ckutz)

    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. Unknown User (giszmo)

      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. 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. 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. That seems odd, i will have to look into it. Could you open an issue about it?

      1. Done. Issue 4471 - Odd behavior calculating points

  4. Unknown User (inakiabt)

    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. 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. 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. Unknown User (taoma09@gmail.com)

    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. 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. 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. 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. 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. 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. 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.jenkins-ci.org/browse/JENKINS-5819

  10. 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.

    1. There is a scorebox but you cannot change the score, double check

  11. Unknown User (keller_jens@gmx.de)

    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. Is there any way to control what rules are being applied?  we'd like to implement this game, but we want to ignore the checkstyle rules for right now.

  13. How exact are the plugin version requirements?  I just installed Jenkins 1.466 and ci-game 1.18.  All the other plugins I installed are more recent than what's listed in the requirements, but every build says it's worth 0 points and that there were no players.  I configured my job to run all the plugins and publish all the results.  I include ci-game as a post-build action.  The job is currently setup to poll our git repo and it only builds when it notices changes.  Jenkins publishes the changes and shows who committed them, so it seems like ci-game should have that info as well.  

    I'm assuming user error on my part - any suggestions?

    Also, "analysis-core 1.0" is "static analysis utilities", right? 

  14. any chance on getting the Lint plugin to be included in the CI game?

  15. Hello... was wondering, where the user scores are actually stored in Jenkins. Can anyone help me out please... :)

  16. Hello... was wondering, where the user scores are actually stored in Jenkins. Can anyone help me out please... :)

    1. Hi Sumit,

      Each score is stored in individual user's config file located at:

      $JENKINS_HOME/users/<username>/config.xml

  17. I am trying to implement the ci-game in our Hudson to capture who is breaking the build most of the time. It is explained that this plugin adds scores to comitters for successful build and deduct scores when the build is broken. My problem is that, in an environment where there are multiple comitters, how does the game deduct the scores from the comitter who broke the build when there are others who have also committed but did not break the build? Or does it just simply deducts points from all committers who committed since the last successful build?

    1. Hi Amy,

      Currently the plugin does not support giving different scores for individual authors of a single build (same score is applied to all).

      One option for you to use: let Jenkins execute each commit individually. This will eventually help you to decide the build breaker correctly.

  18. Hi All,

    I am planning to implement this gaming plugin in my build environment. Scoring calculations etc will need customizations but overall it does seem to fit our current needs. Would really appreciate your feedback before going down too deep on this path.

    Thanks

    Vijai

    1. i am using 1.625.3 version of jenkins

  19. Hi all,

    I like the ci-game and I would like to run it in a Pipeline.

    Is it possible to Trigger it within a groovy script or as a SimpleBuildStep?

    Enjoy your Weekend.

Write a comment…