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)

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.

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.

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.

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.

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.

Unknown User (inakiabt)

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?

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.

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)

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?

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.

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.

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?

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?

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 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?

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.