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

Ensure that collector runs after individual analysis publishers

    XMLWordPrintable

Details

    Description

      Analysis collector build step should check that all selected analysis plugins are running before the collection step. If not a warning or error should be shown.

      Attachments

        Issue Links

          Activity

            moncreaff Greg Moncreaff created issue -

            May or may not be related (issue with not all results being rolled up has been around for a while, months even, quarters likely)

            Noticing this in the jenkins window

            SEVERE: Groovy dynamic warnings parser: exception during parsing:
            java.lang.NumberFormatException: For input string: ""
            at java.lang.NumberFormatException.forInputString(Unknown Source)
            at java.lang.Integer.parseInt(Unknown Source)
            at java.lang.Integer.parseInt(Unknown Source)
            at java_lang_Integer$parseInt$0.call(Unknown Source)
            at Script1.run(Script1.groovy:8)
            at hudson.plugins.warnings.parser.GroovyExpressionMatcher.run(GroovyExpressionMatcher.java:96)
            at hudson.plugins.warnings.parser.GroovyExpressionMatcher.createWarning(GroovyExpressionMatcher.java:68)
            at hudson.plugins.warnings.parser.DynamicParser.createWarning(DynamicParser.java:44)
            at hudson.plugins.warnings.parser.RegexpParser.findAnnotations(RegexpParser.java:87)
            at hudson.plugins.warnings.parser.RegexpLineParser.parse(RegexpLineParser.java:94)
            at hudson.plugins.warnings.parser.ParserRegistry.parse(ParserRegistry.java:318)
            at hudson.plugins.warnings.parser.ParserRegistry.parse(ParserRegistry.java:297)
            at hudson.plugins.warnings.WarningsPublisher.parseConsoleLog(WarningsPublisher.java:400)
            at hudson.plugins.warnings.WarningsPublisher.perform(WarningsPublisher.java:322)
            at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:333)
            at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
            at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
            at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
            at hudson.model.Build$BuildExecution.post2(Build.java:183)
            at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:725)
            at hudson.model.Run.execute(Run.java:1701)
            at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
            at hudson.model.ResourceController.execute(ResourceController.java:88)
            at hudson.model.Executor.run(Executor.java:231)

            It would be so much more helpful if the error said what the script was, and what the input (e.g. so I can paste into sample log message in configure system and see what I did wrong) was that crashed it, if at all possible?

            moncreaff Greg Moncreaff added a comment - May or may not be related (issue with not all results being rolled up has been around for a while, months even, quarters likely) Noticing this in the jenkins window SEVERE: Groovy dynamic warnings parser: exception during parsing: java.lang.NumberFormatException: For input string: "" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java_lang_Integer$parseInt$0.call(Unknown Source) at Script1.run(Script1.groovy:8) at hudson.plugins.warnings.parser.GroovyExpressionMatcher.run(GroovyExpressionMatcher.java:96) at hudson.plugins.warnings.parser.GroovyExpressionMatcher.createWarning(GroovyExpressionMatcher.java:68) at hudson.plugins.warnings.parser.DynamicParser.createWarning(DynamicParser.java:44) at hudson.plugins.warnings.parser.RegexpParser.findAnnotations(RegexpParser.java:87) at hudson.plugins.warnings.parser.RegexpLineParser.parse(RegexpLineParser.java:94) at hudson.plugins.warnings.parser.ParserRegistry.parse(ParserRegistry.java:318) at hudson.plugins.warnings.parser.ParserRegistry.parse(ParserRegistry.java:297) at hudson.plugins.warnings.WarningsPublisher.parseConsoleLog(WarningsPublisher.java:400) at hudson.plugins.warnings.WarningsPublisher.perform(WarningsPublisher.java:322) at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:333) at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:725) at hudson.model.Run.execute(Run.java:1701) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231) It would be so much more helpful if the error said what the script was, and what the input (e.g. so I can paste into sample log message in configure system and see what I did wrong) was that crashed it, if at all possible?
            drulli Ulli Hafner added a comment -

            You can select the warnings results that should be shown in the configuration of the portlet.

            drulli Ulli Hafner added a comment - You can select the warnings results that should be shown in the configuration of the portlet.
            drulli Ulli Hafner added a comment -

            The other error is unrelated. Seems that you try to convert an empty line number. This code needs to be wrapped in a try catch statement.

            drulli Ulli Hafner added a comment - The other error is unrelated. Seems that you try to convert an empty line number. This code needs to be wrapped in a try catch statement.
            drulli Ulli Hafner made changes -
            Field Original Value New Value
            Description When I started I had just one warnings parser script, and it was pulled into the combined results on the job splash page and dashboards.

            Since then I've added almost half a dozen other warnings parsers (manage jenkins . configure system . warnings) but none of the additional has ever been combined.
            The Job has 4 warnings parsers, 1 built in and 3 on the fly parsers
            The Job also looks for open tasks.

            There are graphs for only 3 or the 4 warnings on the job splash, but they are all present in the side bar links

            All the checkboxes (warnings, checkstyle, findbugs, pmd, tasks) are enabled on the SA combiner

            The SA combiner graph on the job splash has only one of the warnings (the oldest) and open tasks data in it.

            The SA combiner on the dashboard with this job (display by type) indicates only 2 types, compiler (warnings?), and open tasks. Where compiler looks like it also matches that oldest (on the fly) parser only.
            drulli Ulli Hafner added a comment -

            Up to now the combined graph only shows one curve for each plug-in, i.e. only the aggregated warnings results. Is this the problem?

            Or is the summation of the number of warnings for the 4 warning parsers wrong?

            drulli Ulli Hafner added a comment - Up to now the combined graph only shows one curve for each plug-in, i.e. only the aggregated warnings results. Is this the problem? Or is the summation of the number of warnings for the 4 warning parsers wrong?
            drulli Ulli Hafner added a comment -

            Can you please add more details? I'm still don't understand what exactly should be changed.

            drulli Ulli Hafner added a comment - Can you please add more details? I'm still don't understand what exactly should be changed.
            drulli Ulli Hafner made changes -
            Resolution Incomplete [ 4 ]
            Status Open [ 1 ] Resolved [ 5 ]
            moncreaff Greg Moncreaff added a comment - - edited

            I'm looking at a job splash page right now.
            SA = 0
            Dup code = 15
            Comp warn = 0
            Open Task = ~137

            SA was supposed to collect (warnings, duplicates, tasks) but it looks like (trend graph) its currently only collecting comp warnings (of which there are zero at present),
            when there were non-zero comp warnings, it looks like it collected the other two (duplicates, open tasks) but not compiler warnings

            e.g. builds 712-119 had
            dup code = 15 all builds
            open task = 137 all builds
            comp warnings = ~5 for all builds
            sa = ~155 all builds

            comp warnings were fixed in build 720 but the open tasks, duplicates remained stead state
            sa = 0 warnings
            dup = 15
            tasks = 140

            since the # of comp warnings was low (3-5) it may be including then correctly (when there are non-zero of them) its just hard to see (since there are 155 other counts) I changed the graph to 'distr by type' and it looks like comp warnings are on the x-axis

            moncreaff Greg Moncreaff added a comment - - edited I'm looking at a job splash page right now. SA = 0 Dup code = 15 Comp warn = 0 Open Task = ~137 SA was supposed to collect (warnings, duplicates, tasks) but it looks like (trend graph) its currently only collecting comp warnings (of which there are zero at present), when there were non-zero comp warnings, it looks like it collected the other two (duplicates, open tasks) but not compiler warnings e.g. builds 712-119 had dup code = 15 all builds open task = 137 all builds comp warnings = ~5 for all builds sa = ~155 all builds comp warnings were fixed in build 720 but the open tasks, duplicates remained stead state sa = 0 warnings dup = 15 tasks = 140 since the # of comp warnings was low (3-5) it may be including then correctly (when there are non-zero of them) its just hard to see (since there are 155 other counts) I changed the graph to 'distr by type' and it looks like comp warnings are on the x-axis
            drulli Ulli Hafner added a comment -

            I.e., only the job graph shows a wrong result, the SA result is correct in the build details view?

            drulli Ulli Hafner added a comment - I.e., only the job graph shows a wrong result, the SA result is correct in the build details view?
            moncreaff Greg Moncreaff added a comment - - edited

            I picture of what I said earlier.

            It's wrong in 'build details' also...

            Static Analysis Warnings: 0 warnings.

            No warnings since build 719.
            New zero warnings highscore: no warnings for 2 days!

            moncreaff Greg Moncreaff added a comment - - edited I picture of what I said earlier. It's wrong in 'build details' also... Static Analysis Warnings: 0 warnings. No warnings since build 719. New zero warnings highscore: no warnings for 2 days!
            moncreaff Greg Moncreaff made changes -
            Attachment JENKINS-22394.JPG [ 28010 ]
            drulli Ulli Hafner made changes -
            Resolution Incomplete [ 4 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            drulli Ulli Hafner added a comment -

            Can you please show the log messages of the analysis plugins from your console log of the latest build?
            There should be messages starting with [WARNINGS] [DRY], etc.

            drulli Ulli Hafner added a comment - Can you please show the log messages of the analysis plugins from your console log of the latest build? There should be messages starting with [WARNINGS] [DRY] , etc.
            drulli Ulli Hafner added a comment -

            And are you using the latest versions of the plugins/jenkins?

            drulli Ulli Hafner added a comment - And are you using the latest versions of the plugins/jenkins?

            console log messages (interesting that analysis collector is before DRY, etc. I had it 1st in list since I wanted its graph to be top of Job splash page.

            00:02:18.992 [ANALYSIS-COLLECTOR] Computing warning deltas based on reference build #737
            00:02:18.992 [DRY] Collecting duplicate code analysis files...
            00:02:18.995 [DRY] Finding all files that match the pattern bin/cpd.xml
            00:02:18.995 [DRY] Parsing 1 files in /var/lib/jenkins/workspace/zzz
            00:02:18.995 [DRY] Successfully parsed file /var/lib/jenkins/workspace/zzz/bin/cpd.xml of module with 15 warnings.
            00:02:19.005 [DRY] Computing warning deltas based on reference build #737
            00:02:19.007 [WARNINGS] Parsing warnings in console log with parser GNU C Compiler 4 (gcc)
            00:02:19.021 [WARNINGS] Computing warning deltas based on reference build #737
            00:02:19.021 [WARNINGS] Plug-in Result: Success - no threshold has been exceeded
            00:02:19.235 [TASKS] Scanning folder '/var/lib/jenkins/workspace/zzz' for files matching the pattern '*/.cpp, */.h' - excludes:
            00:02:19.235 [TASKS] Found 486 files to scan for tasks
            00:02:19.235 [TASKS] Found 138 open tasks.
            00:02:19.265 [TASKS] Computing warning deltas based on reference build #737

            not latest, our tool governance model typically imposes a one-two quarter lag, but reasonably current (this year anyway)

            Jenkins ver. 1.581
            Static Analysis Collector Plug-in 1.41

            I changed the publisher order to be
            1. DRY
            2. WARNINGS
            3. TASKS
            4. ANALYSIS-COLLECTOR

            and AH-HA! now I'm seeing something more reasonable in the graph.

            It looks like
            1. there is an (unobvious) dependency between the plugins, and
            2. order of graphs on the splash page can't be adjusted independently?

            As a minimum I'd recommend putting text on the base (not advanced) SA-Collector plugin configurator to say it needs to be below any of the plugins you want it to be summarizing. And the wiki should explain it more?....

            I don't know if core has any kind of dependency model for plugins to allow automatic reordering of execution? and allowing user to order the display (graphs) in some desired summary/details or priority high/low order in the job config, suspecting not?......

            moncreaff Greg Moncreaff added a comment - console log messages (interesting that analysis collector is before DRY, etc. I had it 1st in list since I wanted its graph to be top of Job splash page. 00:02:18.992 [ANALYSIS-COLLECTOR] Computing warning deltas based on reference build #737 00:02:18.992 [DRY] Collecting duplicate code analysis files... 00:02:18.995 [DRY] Finding all files that match the pattern bin/cpd.xml 00:02:18.995 [DRY] Parsing 1 files in /var/lib/jenkins/workspace/zzz 00:02:18.995 [DRY] Successfully parsed file /var/lib/jenkins/workspace/zzz/bin/cpd.xml of module with 15 warnings. 00:02:19.005 [DRY] Computing warning deltas based on reference build #737 00:02:19.007 [WARNINGS] Parsing warnings in console log with parser GNU C Compiler 4 (gcc) 00:02:19.021 [WARNINGS] Computing warning deltas based on reference build #737 00:02:19.021 [WARNINGS] Plug-in Result: Success - no threshold has been exceeded 00:02:19.235 [TASKS] Scanning folder '/var/lib/jenkins/workspace/zzz' for files matching the pattern '* / .cpp, * / .h' - excludes: 00:02:19.235 [TASKS] Found 486 files to scan for tasks 00:02:19.235 [TASKS] Found 138 open tasks. 00:02:19.265 [TASKS] Computing warning deltas based on reference build #737 not latest, our tool governance model typically imposes a one-two quarter lag, but reasonably current (this year anyway) Jenkins ver. 1.581 Static Analysis Collector Plug-in 1.41 I changed the publisher order to be 1. DRY 2. WARNINGS 3. TASKS 4. ANALYSIS-COLLECTOR and AH-HA! now I'm seeing something more reasonable in the graph. It looks like 1. there is an (unobvious) dependency between the plugins, and 2. order of graphs on the splash page can't be adjusted independently? As a minimum I'd recommend putting text on the base (not advanced) SA-Collector plugin configurator to say it needs to be below any of the plugins you want it to be summarizing. And the wiki should explain it more?.... I don't know if core has any kind of dependency model for plugins to allow automatic reordering of execution? and allowing user to order the display (graphs) in some desired summary/details or priority high/low order in the job config, suspecting not?......
            drulli Ulli Hafner added a comment -

            Interesting, since when is it possible to reorder post build steps? I defined the order of the actions in source code so that the collector plugin is always last. Seems that this could be changed now...

            The order of the graphs cannot be changed.

            drulli Ulli Hafner added a comment - Interesting, since when is it possible to reorder post build steps? I defined the order of the actions in source code so that the collector plugin is always last. Seems that this could be changed now... The order of the graphs cannot be changed.
            danielbeck Daniel Beck added a comment -

            It appears this has been introduced with the addition of the dropdown, i.e. 1.463, May 2012. See https://groups.google.com/forum/?fromgroups#!topic/jenkinsci-dev/UQLvxQclyb4

            (I think the UI ignores behavior from Recorder/Notifier/needsToRunAfterFinalized though, so it's actually a bit confusing.)

            danielbeck Daniel Beck added a comment - It appears this has been introduced with the addition of the dropdown, i.e. 1.463, May 2012. See https://groups.google.com/forum/?fromgroups#!topic/jenkinsci-dev/UQLvxQclyb4 (I think the UI ignores behavior from Recorder/Notifier/needsToRunAfterFinalized though, so it's actually a bit confusing.)
            drulli Ulli Hafner added a comment -

            Wow, that feature is quite old I never actually realized that...

            @Greg: I'll add a warning if the collector is not last.

            drulli Ulli Hafner added a comment - Wow, that feature is quite old I never actually realized that... @Greg: I'll add a warning if the collector is not last.
            drulli Ulli Hafner made changes -
            Component/s analysis-core-plugin [ 15709 ]
            Component/s warnings-plugin [ 15513 ]
            Description The Job has 4 warnings parsers, 1 built in and 3 on the fly parsers
            The Job also looks for open tasks.

            There are graphs for only 3 or the 4 warnings on the job splash, but they are all present in the side bar links

            All the checkboxes (warnings, checkstyle, findbugs, pmd, tasks) are enabled on the SA combiner

            The SA combiner graph on the job splash has only one of the warnings (the oldest) and open tasks data in it.

            The SA combiner on the dashboard with this job (display by type) indicates only 2 types, compiler (warnings?), and open tasks. Where compiler looks like it also matches that oldest (on the fly) parser only.
            Analysis collector build step should check that all selected analysis plugins are running *before* the collection step. If not a warning or error should be shown.
            Priority Major [ 3 ] Minor [ 4 ]
            Summary Only one of multiple warnings parser is reported in Combined Analysis results Ensure that collector runs after analysis publishers
            drulli Ulli Hafner made changes -
            Summary Ensure that collector runs after analysis publishers Ensure that collector runs after individual analysis publishers
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 154495 ] JNJira + In-Review [ 186190 ]
            drulli Ulli Hafner made changes -
            Labels analysis-core-2.0
            greybird Arnaud TAMAILLON made changes -
            Link This issue is related to JENKINS-37299 [ JENKINS-37299 ]
            drulli Ulli Hafner made changes -
            Labels analysis-core-2.0
            drulli Ulli Hafner added a comment - - edited

            Analysis collector will not be supported anymore. It will be integrated into the warnings plugin. See JENKINS-17168

            drulli Ulli Hafner added a comment - - edited Analysis collector will not be supported anymore. It will be integrated into the warnings plugin. See JENKINS-17168
            drulli Ulli Hafner made changes -
            Resolution Won't Fix [ 2 ]
            Status Reopened [ 4 ] Resolved [ 5 ]

            People

              drulli Ulli Hafner
              moncreaff Greg Moncreaff
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: