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

Silently ignore empty files when parsing for warnings

      If I have no warnings/infos/errors in my doxygen log the analysis result in an error. This should not happen as this is the target state.

      Here the console log ouput of the plugin

      19:16:48 [Doxygen] [-ERROR-] Skipping file 'Dokumente\doxy.log' because it's empty
      19:16:48 [Doxygen] Searching for all files in 'D:\JenkinsWorkspace\DEV_JOB' that match the pattern 'Dokumente/doxy.log'
      19:16:48 [Doxygen] -> found 1 file
      19:16:48 [Doxygen] Skipping post processing
      19:16:48 [Doxygen] No filter has been set, publishing all 0 issues
      19:16:48 [Doxygen] Repository miner is not configured, skipping repository mining
      19:16:48 [Doxygen] Reference build recorder is not configured
      19:16:48 [Doxygen] Obtaining reference build from same job (DEV_Job)
      19:16:48 [Doxygen] No valid reference build found that meets the criteria (NO_JOB_FAILURE - SUCCESSFUL_QUALITY_GATE)
      19:16:48 [Doxygen] All reported issues will be considered outstanding
      19:16:48 [Doxygen] Evaluating quality gates
      19:16:48 [Doxygen] -> PASSED - Total (severity low only): 0 - Quality QualityGate: 1
      19:16:48 [Doxygen] -> PASSED - Total (severity normal only): 0 - Quality QualityGate: 1
      19:16:48 [Doxygen] -> PASSED - Total (severity high only): 0 - Quality QualityGate: 1
      19:16:48 [Doxygen] -> PASSED - Total (errors only): 0 - Quality QualityGate: 1
      19:16:48 [Doxygen] -> All quality gates have been passed
      19:16:48 [Doxygen] Health report is disabled - skipping
      19:16:48 [Doxygen] Created analysis result for 0 issues (found 0 new issues, fixed 0 issues)
      19:16:48 [Doxygen] Failing build because analysis result contains errors
      19:16:48 [Doxygen] Attaching ResultAction with ID 'doxygen' to build 'DEV_JOB #8'.
      19:16:48 [Checks API] No suitable checks publisher found.
      19:16:48 Build step 'Record compiler warnings and static analysis results' changed build result to FAILURE
      

      The doxy.log file is empty an there fore a size of 0 bytes.

          [JENKINS-65547] Silently ignore empty files when parsing for warnings

          Tim Schlüter added a comment -

          But doxygen does not plot any unintersting files.

          Tim Schlüter added a comment - But doxygen does not plot any unintersting files.

          Ulli Hafner added a comment -

          How do you call Doxygen in your Pipeline?

          Ulli Hafner added a comment - How do you call Doxygen in your Pipeline?

          Tim Schlüter added a comment - - edited

          At the moment I use a bash script

            ( cat "${DOXYFILE}"; echo WARN_FORMAT='$file:$line: $text'; echo HTML_OUTPUT='doxygen' ) | doxygen - |& cat > "${DOXY_LOG}"
          

          Tim Schlüter added a comment - - edited At the moment I use a bash script ( cat "${DOXYFILE}" ; echo WARN_FORMAT= '$file:$line: $text' ; echo HTML_OUTPUT= 'doxygen' ) | doxygen - |& cat > "${DOXY_LOG}"

          Ulli Hafner added a comment -

          Ah ok, and Doxygen does not produce any output if everything is ok.

          Ulli Hafner added a comment - Ah ok, and Doxygen does not produce any output if everything is ok.

          Ulli Hafner added a comment -

          I'm not sure if it makes sense to remove the check at all or if we need a customization. For some tools it definitely is an error if they are called with an empty file.

          Ulli Hafner added a comment - I'm not sure if it makes sense to remove the check at all or if we need a customization. For some tools it definitely is an error if they are called with an empty file.

          Tim Schlüter added a comment -

          If it depends on the tools it should be automatically considered when I choose doxygen a tool or at least a tool dependend selectable option. For now I push the doxygen version into my log file to ensure that it will never be empty.

          Tim Schlüter added a comment - If it depends on the tools it should be automatically considered when I choose doxygen a tool or at least a tool dependend selectable option. For now I push the doxygen version into my log file to ensure that it will never be empty.

          Ulli Hafner added a comment -

          Well, most users extract doxygen warnings from the console log. Having here an empty input would clearly indicate an error. But it makes sense to have a overridable default.

          Ulli Hafner added a comment - Well, most users extract doxygen warnings from the console log. Having here an empty input would clearly indicate an error. But it makes sense to have a overridable default.

          Tim Schlüter added a comment -

          In my jobs I use not just doxygen an therefor the log is full of stuff. This rise the risk of misinterpreting 'warnings' from other tools.

          Tim Schlüter added a comment - In my jobs I use not just doxygen an therefor the log is full of stuff. This rise the risk of misinterpreting 'warnings' from other tools.

          Ulli Hafner added a comment -

          Yes, using a file is always better. If you are interested, it might be helpful for others if you can provide a small PR for https://github.com/jenkinsci/analysis-model/blob/master/src/main/java/edu/hm/hafner/analysis/registry/DoxygenDescriptor.java that describes shortly how you did invoke Doxygen. Example: https://github.com/jenkinsci/analysis-model/blob/master/src/main/java/edu/hm/hafner/analysis/registry/CargoDescriptor.java#L26

          Ulli Hafner added a comment - Yes, using a file is always better. If you are interested, it might be helpful for others if you can provide a small PR for https://github.com/jenkinsci/analysis-model/blob/master/src/main/java/edu/hm/hafner/analysis/registry/DoxygenDescriptor.java that describes shortly how you did invoke Doxygen. Example: https://github.com/jenkinsci/analysis-model/blob/master/src/main/java/edu/hm/hafner/analysis/registry/CargoDescriptor.java#L26

          Ulli Hafner added a comment -

          This has been fixed in the meanwhile.

          Ulli Hafner added a comment - This has been fixed in the meanwhile.

            Unassigned Unassigned
            timsch Tim Schlüter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: