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

Analysis of Checkstyle Warnings per User

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Checkstyle warnings generally arise because a developer is running an auto format that is not in sync with a project's standard, or they are choosing not to format.

      The current checkstyle analysis tend to display where warnings are, but not where they come from. What I would like is to see is a 'Warnings By User' analysis (user is the commit user).

      Then you can easily see who's IDE is out of whack, or who's being slack - even if that's happens to be me

      Example:

      Warnings by User

      • mjackson: 23 warnings
      • jsmith: 1,634 warnings
      • jdoe: 432 warning

        New Warnings by User (build #30)

      • jsmith: 84 warnings
      • jdoe: 4 warnings

      Cheers for listening.

        Attachments

          Issue Links

            Activity

            Hide
            mwebber Matthew Webber added a comment - - edited

            Unfortunately this change makes some assumptions about the environment that are not always true. Our Jenkins jobs are now abending with this:

            Recording test results
            [Boolean condition] checking [true] against [^(1|y|yes|t|true|on|run)$] (origin token:  ${ENV,var="postbuild_scan_for_compiler_warnings"} )
            Run condition [Boolean condition] enabling perform for step [[Scan for compiler warnings]]
            [WARNINGS] Parsing warnings in console log with parser Buckminster
            <Git Blamer> Using GitBlamer to create author and commit information for all warnings.
            <Git Blamer> Getting blame results for all files in /scratch/jenkins_slave/workspace/GDA.master-junit.tests.
             > git rev-parse 5977ce7cd6b4f4be8bba6c5226655c12e50340ca^{commit} # timeout=10
            ERROR: [flexible-publish] Scan for compiler warnings (hudson.plugins.warnings.WarningsPublisher@616e8ea4) aborted due to exception
            hudson.plugins.git.GitException: Command "git rev-parse 5977ce7cd6b4f4be8bba6c5226655c12e50340ca^{commit}" returned status code 128:
            stdout: 
            stderr: fatal: Not a git repository (or any parent up to mount point /scratch)
            Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
            
            	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1903)
            	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1871)
            	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1867)
            	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1512)
            	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1524)
            	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:718)
            	at hudson.plugins.git.GitAPI.revParse(GitAPI.java:316)
            	at hudson.plugins.analysis.util.GitBlamer.getHead(GitBlamer.java:70)
            	at hudson.plugins.analysis.util.GitBlamer.loadBlameResultsForFiles(GitBlamer.java:58)
            	at hudson.plugins.analysis.util.GitBlamer.blame(GitBlamer.java:52)
            	at hudson.plugins.analysis.util.AbstractBlamer$1.invoke(AbstractBlamer.java:66)
            	at hudson.plugins.analysis.util.AbstractBlamer$1.invoke(AbstractBlamer.java:63)
            	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2750)
            	at hudson.remoting.UserRequest.perform(UserRequest.java:181)
            	at hudson.remoting.UserRequest.perform(UserRequest.java:52)
            	at hudson.remoting.Request$2.run(Request.java:336)
            	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
            	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            	at java.lang.Thread.run(Thread.java:745)
            	at ......remote call to DLS-RHEL6w-1(Native Method)
            	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1554)
            	at hudson.remoting.UserResponse.retrieve(UserRequest.java:281)
            	at hudson.remoting.Channel.call(Channel.java:839)
            	at hudson.FilePath.act(FilePath.java:987)
            	at hudson.FilePath.act(FilePath.java:976)
            	at hudson.plugins.analysis.util.AbstractBlamer.invokeBlamer(AbstractBlamer.java:63)
            	at hudson.plugins.analysis.util.AbstractBlamer.blame(AbstractBlamer.java:49)
            	at hudson.plugins.analysis.core.HealthAwarePublisher.blame(HealthAwarePublisher.java:109)
            	at hudson.plugins.warnings.WarningsPublisher.annotate(WarningsPublisher.java:432)
            	at hudson.plugins.warnings.WarningsPublisher.parseConsoleLog(WarningsPublisher.java:378)
            	at hudson.plugins.warnings.WarningsPublisher.perform(WarningsPublisher.java:312)
            	at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:69)
            	at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:298)
            	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
            	at org.jenkins_ci.plugins.flexible_publish.builder.FailAtEndBuilder.perform(FailAtEndBuilder.java:104)
            	at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110)
            	at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154)
            	at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105)
            	at org.jenkins_ci.plugins.flexible_publish.strategy.FailAtEndExecutionStrategy.perform(FailAtEndExecutionStrategy.java:85)
            	at org.jenkins_ci.plugins.flexible_publish.ConditionalPublisher.perform(ConditionalPublisher.java:206)
            	at org.jenkins_ci.plugins.flexible_publish.FlexiblePublisher.perform(FlexiblePublisher.java:124)
            	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:730)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:676)
            	at hudson.model.Build$BuildExecution.post2(Build.java:186)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:621)
            	at hudson.model.Run.execute(Run.java:1760)
            	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
            	at hudson.model.ResourceController.execute(ResourceController.java:97)
            	at hudson.model.Executor.run(Executor.java:415)
            [Boolean condition] checking [true] against [^(1|y|yes|t|true|on|run)$] (origin token:  ${ENV,var="postbuild_scan_for_open_tasks"} )
            Run condition [Boolean condition] enabling perform for step [[Scan workspace for open tasks]]
            [TASKS] Skipping publisher since build result is FAILURE
            Build step 'Flexible publish' changed build result to FAILURE
            Build step 'Flexible publish' marked build as failure
            Finished: FAILURE
            

            The problem, I suspect, is that some of the code under test comes frmo a Git repository, but is checked out by a bash script, and not using the Jenkins SCM plugin.

            Show
            mwebber Matthew Webber added a comment - - edited Unfortunately this change makes some assumptions about the environment that are not always true. Our Jenkins jobs are now abending with this: Recording test results [Boolean condition] checking [true] against [^(1|y|yes|t|true|on|run)$] (origin token: ${ENV,var="postbuild_scan_for_compiler_warnings"} ) Run condition [Boolean condition] enabling perform for step [[Scan for compiler warnings]] [WARNINGS] Parsing warnings in console log with parser Buckminster <Git Blamer> Using GitBlamer to create author and commit information for all warnings. <Git Blamer> Getting blame results for all files in /scratch/jenkins_slave/workspace/GDA.master-junit.tests. > git rev-parse 5977ce7cd6b4f4be8bba6c5226655c12e50340ca^{commit} # timeout=10 ERROR: [flexible-publish] Scan for compiler warnings (hudson.plugins.warnings.WarningsPublisher@616e8ea4) aborted due to exception hudson.plugins.git.GitException: Command "git rev-parse 5977ce7cd6b4f4be8bba6c5226655c12e50340ca^{commit}" returned status code 128: stdout: stderr: fatal: Not a git repository (or any parent up to mount point /scratch) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1903) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1871) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1867) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1512) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1524) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:718) at hudson.plugins.git.GitAPI.revParse(GitAPI.java:316) at hudson.plugins.analysis.util.GitBlamer.getHead(GitBlamer.java:70) at hudson.plugins.analysis.util.GitBlamer.loadBlameResultsForFiles(GitBlamer.java:58) at hudson.plugins.analysis.util.GitBlamer.blame(GitBlamer.java:52) at hudson.plugins.analysis.util.AbstractBlamer$1.invoke(AbstractBlamer.java:66) at hudson.plugins.analysis.util.AbstractBlamer$1.invoke(AbstractBlamer.java:63) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2750) at hudson.remoting.UserRequest.perform(UserRequest.java:181) at hudson.remoting.UserRequest.perform(UserRequest.java:52) at hudson.remoting.Request$2.run(Request.java:336) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) at ......remote call to DLS-RHEL6w-1(Native Method) at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1554) at hudson.remoting.UserResponse.retrieve(UserRequest.java:281) at hudson.remoting.Channel.call(Channel.java:839) at hudson.FilePath.act(FilePath.java:987) at hudson.FilePath.act(FilePath.java:976) at hudson.plugins.analysis.util.AbstractBlamer.invokeBlamer(AbstractBlamer.java:63) at hudson.plugins.analysis.util.AbstractBlamer.blame(AbstractBlamer.java:49) at hudson.plugins.analysis.core.HealthAwarePublisher.blame(HealthAwarePublisher.java:109) at hudson.plugins.warnings.WarningsPublisher.annotate(WarningsPublisher.java:432) at hudson.plugins.warnings.WarningsPublisher.parseConsoleLog(WarningsPublisher.java:378) at hudson.plugins.warnings.WarningsPublisher.perform(WarningsPublisher.java:312) at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:69) at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:298) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81) at org.jenkins_ci.plugins.flexible_publish.builder.FailAtEndBuilder.perform(FailAtEndBuilder.java:104) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154) at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105) at org.jenkins_ci.plugins.flexible_publish.strategy.FailAtEndExecutionStrategy.perform(FailAtEndExecutionStrategy.java:85) at org.jenkins_ci.plugins.flexible_publish.ConditionalPublisher.perform(ConditionalPublisher.java:206) at org.jenkins_ci.plugins.flexible_publish.FlexiblePublisher.perform(FlexiblePublisher.java:124) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:730) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:676) at hudson.model.Build$BuildExecution.post2(Build.java:186) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:621) at hudson.model.Run.execute(Run.java:1760) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:415) [Boolean condition] checking [true] against [^(1|y|yes|t|true|on|run)$] (origin token: ${ENV,var="postbuild_scan_for_open_tasks"} ) Run condition [Boolean condition] enabling perform for step [[Scan workspace for open tasks]] [TASKS] Skipping publisher since build result is FAILURE Build step 'Flexible publish' changed build result to FAILURE Build step 'Flexible publish' marked build as failure Finished: FAILURE The problem, I suspect, is that some of the code under test comes frmo a Git repository, but is checked out by a bash script, and not using the Jenkins SCM plugin.
            Hide
            drulli Ulli Hafner added a comment - - edited

            Please create a new bug issue after a feature issue has been resolved. Otherwise it is hard to follow the actual problems.

            PS: This exception has been fixed in 1.89 of analysis-core see JENKINS-45572

            Show
            drulli Ulli Hafner added a comment - - edited Please create a new bug issue after a feature issue has been resolved. Otherwise it is hard to follow the actual problems. PS: This exception has been fixed in 1.89 of analysis-core see JENKINS-45572
            Hide
            mwebber Matthew Webber added a comment -

            Apologies, I agree it should be a new bug.

            I can report that 1.89 of analysis-core does indeed fix the problem.

            Show
            mwebber Matthew Webber added a comment - Apologies, I agree it should be a new bug. I can report that 1.89 of analysis-core does indeed fix the problem.
            Hide
            dcsobral Daniel Sobral added a comment -

            "Skipping warnings blame since pipelines do not have an SCM link." – does that mean this feature isn't supported at all from a Jenkins Pipeline? I don't understand the issue – I do have a checked out git repository.

            Show
            dcsobral Daniel Sobral added a comment - "Skipping warnings blame since pipelines do not have an SCM link." – does that mean this feature isn't supported at all from a Jenkins Pipeline? I don't understand the issue – I do have a checked out git repository.
            Hide
            drulli Ulli Hafner added a comment -

            It is not supported since pipelines may use several SCMs. The API does not return an SCM instance right now, so this implementation will be more complex. (It is feasible, just not as simple as in freestyle builds).

            Show
            drulli Ulli Hafner added a comment - It is not supported since pipelines may use several SCMs. The API does not return an SCM instance right now, so this implementation will be more complex. (It is feasible, just not as simple as in freestyle builds).

              People

              • Assignee:
                drulli Ulli Hafner
                Reporter:
                ahhughes ahhughes
              • Votes:
                4 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: