Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-15547

Maven 3 Checkstyle results not being counted in game

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: ci-game-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 1.475
      plugins:
      Maven 2 Project Plugin: 1.475
      Checkstyle: 3.29
      Static Code Analysis Plug-ins: 1.43
      The Continuous Integration Game plugin: 1.18
    • Similar Issues:

      Description

      Have turned on CI game in our project, and it is applying rules for standard checks (build fail, tests pass/fail), but never getting a score for checkstyle despite changes to warning count.

      E.g. output from build like this (even though fixed a checkstyle)
      [ci-game] evaluating rule: Build result
      [ci-game] scored: 1.0
      [ci-game] evaluating rule: Increased number of failed tests
      [ci-game] evaluating rule: Increased number of passed tests
      [ci-game] evaluating rule: Decreased number of failed tests
      [ci-game] evaluating rule: Decreased number of passed tests
      [ci-game] evaluating rule: New HIGH priority Findbugs warnings
      [ci-game] evaluating rule: New NORMAL priority Findbugs warnings
      [ci-game] evaluating rule: New LOW priority Findbugs warnings
      [ci-game] evaluating rule: Fixed HIGH priority Findbugs warnings
      [ci-game] evaluating rule: Fixed NORMAL priority Findbugs warnings
      [ci-game] evaluating rule: Fixed LOW priority Findbugs warnings
      [ci-game] evaluating rule: Changed number of checkstyle warnings
      No emails were triggered.
      Finished: SUCCESS

        Attachments

          Activity

          Hide
          nathanm Nathan McDonald added a comment -

          I downloaded the 1.19 source and tried debugging through it with my version of jenkins and plugins. I think I traced down the issue.

          The DefaultCheckstyleRule makes a call to:

          ActionRetriever.getResult(build, Result.UNSTABLE, CheckStyleResultAction.class);
          

          which is ALWAYS returning an empty list in my setup.

          It seems the build doesn't have any CheckStyleResultAction instance in it's actions, but it does have a CheckStyleMavenResultAction instance.

          Both of these classes are instance's of

          hudson.plugins.analysis.core.ResultAction<hudson.plugins.checkstyle.CheckStyleResult>
          

          So perhaps better code would be to instead of iterating over all actions and returning those of type CheckStyleResultAction, instead iterating over all actions, calling their getResult() method, and returning those results which are instances of CheckStyleResult.

          Show
          nathanm Nathan McDonald added a comment - I downloaded the 1.19 source and tried debugging through it with my version of jenkins and plugins. I think I traced down the issue. The DefaultCheckstyleRule makes a call to: ActionRetriever.getResult(build, Result.UNSTABLE, CheckStyleResultAction.class); which is ALWAYS returning an empty list in my setup. It seems the build doesn't have any CheckStyleResultAction instance in it's actions, but it does have a CheckStyleMavenResultAction instance. Both of these classes are instance's of hudson.plugins.analysis.core.ResultAction<hudson.plugins.checkstyle.CheckStyleResult> So perhaps better code would be to instead of iterating over all actions and returning those of type CheckStyleResultAction, instead iterating over all actions, calling their getResult() method, and returning those results which are instances of CheckStyleResult.

            People

            • Assignee:
              redsolo redsolo
              Reporter:
              nathanm Nathan McDonald
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: