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

Warnings not showed in file when case insensitive path is provided

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • warnings-ng-plugin
    • None

      Disclaimer: I have already posted this issue as a question on Stackoverflow, but unfortunately got no feedback there.

      Unfortunately, although the warnings are collected and displayed, I cannot trace them back to the source code. The overview shows the correct file path and the file still exists in the file system after the build.

      When I click on the file to investigate the individual issues, the filename and line are displayed, but I can't click on it to look at the location in the code.

       

      According to the plugin's documentation, warnings should actually also be displayed in the code if they affect a specific line, for example.

      I'm using the iar and the iarCstat plugin like this:

       

      success {
              dir("${BUILD_DIR}") {
                  recordIssues(
                      tools: [
                          iar(),
                          iarCstat(pattern: "${BUILD_DIR}\\cstat\\cstat_log.txt")
                      ]
                  )
              }
          }
      

      Can anyone tell me if I am using the plugin incorrectly or if this problem is known? I could not find anything about it...

          [JENKINS-66687] Warnings not showed in file when case insensitive path is provided

          Jan-Frederik Schmidt created issue -

          Ulli Hafner added a comment -

          Files are only shown if they could be found. Most compilers report warnings with absolute paths but some do not. What does the Jenkins console log of your build report? There should be some warnings about files that could not be found. In the build overview there is also an exclamation mark icon right after the warnings summary that navigates to the log messages.

          Ulli Hafner added a comment - Files are only shown if they could be found. Most compilers report warnings with absolute paths but some do not. What does the Jenkins console log of your build report? There should be some warnings about files that could not be found. In the build overview there is also an exclamation mark icon right after the warnings summary that navigates to the log messages.

          The only thing I can find is

          [IAR Compiler (C/C++)] -> resolved paths in source directory (2 found, 0 not found)

          The interesting thing is that (as seen in the pictures) in the overview the correct file path is displayed and it exists, but then in the detail view this information seems to be lost.

          Jan-Frederik Schmidt added a comment - The only thing I can find is [IAR Compiler (C/C++)] -> resolved paths in source directory (2 found, 0 not found) The interesting thing is that (as seen in the pictures) in the overview the correct file path is displayed and it exists, but then in the detail view this information seems to be lost.

          Ulli Hafner added a comment - - edited

          The log messages when copying the files should follow a few lines later. Here an example:

          14:16:29  [SpotBugs] Searching for all files in '/home/jenkins/workspace/lugins_warnings-ng-plugin_master' that match the pattern '**/target/spotbugsXml.xml,**/target/findbugsXml.xml'
          14:16:29  [SpotBugs] -> found 2 files
          14:16:29  [SpotBugs] Successfully parsed file /home/jenkins/workspace/lugins_warnings-ng-plugin_master/plugin/target/spotbugsXml.xml
          14:16:29  [SpotBugs] -> found 0 issues (skipped 0 duplicates)
          14:16:29  [SpotBugs] Successfully parsed file /home/jenkins/workspace/lugins_warnings-ng-plugin_master/ui-tests/target/spotbugsXml.xml
          14:16:29  [SpotBugs] -> found 5 issues (skipped 0 duplicates)
          14:17:01  [SpotBugs] Post processing issues on 'EC2 (aws) - High memory ubuntu 20.04 (i-0a3922746f5f01de0)' with source code encoding 'UTF-8'
          14:17:01  [SpotBugs] Skipping SCM blames as requested
          14:17:01  [SpotBugs] Resolving file names for all issues in source directory '/home/jenkins/workspace/lugins_warnings-ng-plugin_master'
          14:17:01  [SpotBugs] -> resolved paths in source directory (4 found, 0 not found)
          14:17:01  [SpotBugs] Resolving module names from module definitions (build.xml, pom.xml, or Manifest.mf files)
          14:17:01  [SpotBugs] -> all issues already have a valid module name
          14:17:01  [SpotBugs] Resolving package names (or namespaces) by parsing the affected files
          14:17:01  [SpotBugs] -> all affected files already have a valid package name
          14:17:01  [SpotBugs] No filter has been set, publishing all 5 issues
          14:17:01  [SpotBugs] Creating fingerprints for all affected code blocks to track issues over different builds
          14:17:01  [SpotBugs] -> created fingerprints for 0 issues (skipped 5 issues)
          14:17:01  [SpotBugs] Copying affected files to Jenkins' build folder '/var/jenkins_home/jobs/Plugins/jobs/warnings-ng-plugin/branches/master/builds/1414/files-with-issues'
          14:17:01  [SpotBugs] -> 4 copied, 0 not in workspace, 0 not-found, 0 with I/O error
          14:17:01  [SpotBugs] Repository miner is not configured, skipping repository mining
          14:17:01  [SpotBugs] Obtaining reference build from reference recorder
          14:17:01  [SpotBugs] -> No reference build recorded
          14:17:01  [SpotBugs] Obtaining reference build from same job (master)
          14:17:01  [SpotBugs] Using reference build 'Plugins/warnings-ng-plugin/master #1413' to compute new, fixed, and outstanding issues
          14:17:01  [SpotBugs] Issues delta (vs. reference build): outstanding: 5, new: 0, fixed: 0
          14:17:01  [SpotBugs] Evaluating quality gates
          14:17:01  [SpotBugs] -> PASSED - New (any severity): 0 - Quality QualityGate: 1
          14:17:01  [SpotBugs] -> All quality gates have been passed
          14:17:01  [SpotBugs] Health report is disabled - skipping
          14:17:01  [SpotBugs] Created analysis result for 5 issues (found 0 new issues, fixed 0 issues)
          14:17:01  [SpotBugs] Attaching ResultAction with ID 'spotbugs' to build 'Plugins/warnings-ng-plugin/master #1414'.
          14:17:02  [GitHub Checks] GitHub check (name: SpotBugs, status: COMPLETED) has been published.
          

          Seems that the path could be resolved, but the file cannot be copied. Did you set the correct encoding? Can you add those details (see next lines) from your build as well?

          14:17:01  [SpotBugs] Copying affected files to Jenkins' build folder '/var/jenkins_home/jobs/Plugins/jobs/warnings-ng-plugin/branches/master/builds/1414/files-with-issues'
          14:17:01  [SpotBugs] -> 4 copied, 0 not in workspace, 0 not-found, 0 with I/O error
          

          Ulli Hafner added a comment - - edited The log messages when copying the files should follow a few lines later. Here an example: 14:16:29 [SpotBugs] Searching for all files in '/home/jenkins/workspace/lugins_warnings-ng-plugin_master' that match the pattern '**/target/spotbugsXml.xml,**/target/findbugsXml.xml' 14:16:29 [SpotBugs] -> found 2 files 14:16:29 [SpotBugs] Successfully parsed file /home/jenkins/workspace/lugins_warnings-ng-plugin_master/plugin/target/spotbugsXml.xml 14:16:29 [SpotBugs] -> found 0 issues (skipped 0 duplicates) 14:16:29 [SpotBugs] Successfully parsed file /home/jenkins/workspace/lugins_warnings-ng-plugin_master/ui-tests/target/spotbugsXml.xml 14:16:29 [SpotBugs] -> found 5 issues (skipped 0 duplicates) 14:17:01 [SpotBugs] Post processing issues on 'EC2 (aws) - High memory ubuntu 20.04 (i-0a3922746f5f01de0)' with source code encoding 'UTF-8' 14:17:01 [SpotBugs] Skipping SCM blames as requested 14:17:01 [SpotBugs] Resolving file names for all issues in source directory '/home/jenkins/workspace/lugins_warnings-ng-plugin_master' 14:17:01 [SpotBugs] -> resolved paths in source directory (4 found, 0 not found) 14:17:01 [SpotBugs] Resolving module names from module definitions (build.xml, pom.xml, or Manifest.mf files) 14:17:01 [SpotBugs] -> all issues already have a valid module name 14:17:01 [SpotBugs] Resolving package names (or namespaces) by parsing the affected files 14:17:01 [SpotBugs] -> all affected files already have a valid package name 14:17:01 [SpotBugs] No filter has been set, publishing all 5 issues 14:17:01 [SpotBugs] Creating fingerprints for all affected code blocks to track issues over different builds 14:17:01 [SpotBugs] -> created fingerprints for 0 issues (skipped 5 issues) 14:17:01 [SpotBugs] Copying affected files to Jenkins' build folder '/var/jenkins_home/jobs/Plugins/jobs/warnings-ng-plugin/branches/master/builds/1414/files-with-issues' 14:17:01 [SpotBugs] -> 4 copied, 0 not in workspace, 0 not-found, 0 with I/O error 14:17:01 [SpotBugs] Repository miner is not configured, skipping repository mining 14:17:01 [SpotBugs] Obtaining reference build from reference recorder 14:17:01 [SpotBugs] -> No reference build recorded 14:17:01 [SpotBugs] Obtaining reference build from same job (master) 14:17:01 [SpotBugs] Using reference build 'Plugins/warnings-ng-plugin/master #1413' to compute new, fixed, and outstanding issues 14:17:01 [SpotBugs] Issues delta (vs. reference build): outstanding: 5, new: 0, fixed: 0 14:17:01 [SpotBugs] Evaluating quality gates 14:17:01 [SpotBugs] -> PASSED - New (any severity): 0 - Quality QualityGate: 1 14:17:01 [SpotBugs] -> All quality gates have been passed 14:17:01 [SpotBugs] Health report is disabled - skipping 14:17:01 [SpotBugs] Created analysis result for 5 issues (found 0 new issues, fixed 0 issues) 14:17:01 [SpotBugs] Attaching ResultAction with ID 'spotbugs' to build 'Plugins/warnings-ng-plugin/master #1414'. 14:17:02 [GitHub Checks] GitHub check (name: SpotBugs, status: COMPLETED) has been published. Seems that the path could be resolved, but the file cannot be copied. Did you set the correct encoding? Can you add those details (see next lines) from your build as well? 14:17:01 [SpotBugs] Copying affected files to Jenkins' build folder '/var/jenkins_home/jobs/Plugins/jobs/warnings-ng-plugin/branches/master/builds/1414/files-with-issues' 14:17:01 [SpotBugs] -> 4 copied, 0 not in workspace, 0 not-found, 0 with I/O error

          Unbelievable, how did I miss that

          [IAR Compiler (C/C++)] Parsing console log (workspace: 'HIDDEN_BUILD_PATH')
          [IAR Compiler (C/C++)] -> found 15 issues (skipped 14 duplicates)
          [IAR Compiler (C/C++)] Parsing console log (workspace: 'HIDDEN_BUILD_PATH')
          [IAR Compiler (C/C++)] -> found 15 issues (skipped 14 duplicates)
          [IAR Compiler (C/C++)] Successfully parsed console log
          [IAR Compiler (C/C++)] -> found 15 issues (skipped 14 duplicates)
          [IAR Compiler (C/C++)] Parsing console log (workspace: 'HIDDEN_BUILD_PATH')
          [IAR Compiler (C/C++)] Post processing issues on 'HIDDEN_NODE' with source code encoding 'UTF-8'
          [IAR Compiler (C/C++)] Creating SCM blamer to obtain author and commit information for affected files
          [IAR Compiler (C/C++)] -> No blamer installed yet. You need to install the 'git-forensics' plugin to enable blaming for Git.
          [IAR Compiler (C/C++)] Resolving file names for all issues in source directory 'HIDDEN_BUILD_PATH'
          [IAR Compiler (C/C++)] -> resolved paths in source directory (2 found, 0 not found)
          [IAR Compiler (C/C++)] Resolving module names from module definitions (build.xml, pom.xml, or Manifest.mf files)
          [IAR Compiler (C/C++)] -> resolved module names for 15 issues
          [IAR Compiler (C/C++)] Resolving package names (or namespaces) by parsing the affected files
          [IAR Compiler (C/C++)] -> resolved package names of 2 affected files
          [IAR Compiler (C/C++)] No filter has been set, publishing all 15 issues
          [IAR Compiler (C/C++)] Creating fingerprints for all affected code blocks to track issues over different builds
          [IAR Compiler (C/C++)] -> created fingerprints for 15 issues (skipped 0 issues)
          [IAR Compiler (C/C++)] Copying affected files to Jenkins' build folder 'HIDDEN_BUILD_FOLDER'
          [IAR Compiler (C/C++)] -> 0 copied, 15 not in workspace, 0 not-found, 0 with I/O error
          [IAR Compiler (C/C++)] Repository miner is not configured, skipping repository mining
          [IAR Compiler (C/C++)] Reference build recorder is not configured
          [IAR Compiler (C/C++)] Obtaining reference build from same job (bugfix/CStat)
          [IAR Compiler (C/C++)] Using reference build 'HIDDEN_PROJECT_NAME #14' to compute new, fixed, and outstanding issues
          [IAR Compiler (C/C++)] Issues delta (vs. reference build): outstanding: 15, new: 0, fixed: 0
          [IAR Compiler (C/C++)] No quality gates have been set - skipping
          [IAR Compiler (C/C++)] Health report is disabled - skipping
          [IAR Compiler (C/C++)] Created analysis result for 15 issues (found 0 new issues, fixed 0 issues)
          [IAR Compiler (C/C++)] Attaching ResultAction with ID 'iar' to build 'HIDDEN_PROJECT_NAME #15'.

          Apparently "15 not in workspace" is the problem. But how do I fix this?
           

          Jan-Frederik Schmidt added a comment - Unbelievable, how did I miss that [IAR Compiler (C/C++)] Parsing console log (workspace: 'HIDDEN_BUILD_PATH' ) [IAR Compiler (C/C++)] -> found 15 issues (skipped 14 duplicates) [IAR Compiler (C/C++)] Parsing console log (workspace: 'HIDDEN_BUILD_PATH' ) [IAR Compiler (C/C++)] -> found 15 issues (skipped 14 duplicates) [IAR Compiler (C/C++)] Successfully parsed console log [IAR Compiler (C/C++)] -> found 15 issues (skipped 14 duplicates) [IAR Compiler (C/C++)] Parsing console log (workspace: 'HIDDEN_BUILD_PATH' ) [IAR Compiler (C/C++)] Post processing issues on 'HIDDEN_NODE' with source code encoding 'UTF-8' [IAR Compiler (C/C++)] Creating SCM blamer to obtain author and commit information for affected files [IAR Compiler (C/C++)] -> No blamer installed yet. You need to install the 'git-forensics' plugin to enable blaming for Git. [IAR Compiler (C/C++)] Resolving file names for all issues in source directory 'HIDDEN_BUILD_PATH' [IAR Compiler (C/C++)] -> resolved paths in source directory (2 found, 0 not found) [IAR Compiler (C/C++)] Resolving module names from module definitions (build.xml, pom.xml, or Manifest.mf files) [IAR Compiler (C/C++)] -> resolved module names for 15 issues [IAR Compiler (C/C++)] Resolving package names (or namespaces) by parsing the affected files [IAR Compiler (C/C++)] -> resolved package names of 2 affected files [IAR Compiler (C/C++)] No filter has been set, publishing all 15 issues [IAR Compiler (C/C++)] Creating fingerprints for all affected code blocks to track issues over different builds [IAR Compiler (C/C++)] -> created fingerprints for 15 issues (skipped 0 issues) [IAR Compiler (C/C++)] Copying affected files to Jenkins ' build folder ' HIDDEN_BUILD_FOLDER' [IAR Compiler (C/C++)] -> 0 copied, 15 not in workspace, 0 not-found, 0 with I/O error [IAR Compiler (C/C++)] Repository miner is not configured, skipping repository mining [IAR Compiler (C/C++)] Reference build recorder is not configured [IAR Compiler (C/C++)] Obtaining reference build from same job (bugfix/CStat) [IAR Compiler (C/C++)] Using reference build 'HIDDEN_PROJECT_NAME #14' to compute new , fixed, and outstanding issues [IAR Compiler (C/C++)] Issues delta (vs. reference build): outstanding: 15, new : 0, fixed: 0 [IAR Compiler (C/C++)] No quality gates have been set - skipping [IAR Compiler (C/C++)] Health report is disabled - skipping [IAR Compiler (C/C++)] Created analysis result for 15 issues (found 0 new issues, fixed 0 issues) [IAR Compiler (C/C++)] Attaching ResultAction with ID 'iar' to build 'HIDDEN_PROJECT_NAME #15' . Apparently "15 not in workspace" is the problem. But how do I fix this?  

          Ulli Hafner added a comment -

          Due to security reasons, those files need to be in the Jenkins workspace. Is it correct, that your sources are not below the workspace root HIDDEN_BUILD_PATH?

          You can add an additional folder using the sourceDirectory parameter. You need to register that path in the global Jenkins settings though.

          Ulli Hafner added a comment - Due to security reasons, those files need to be in the Jenkins workspace. Is it correct, that your sources are not below the workspace root HIDDEN_BUILD_PATH ? You can add an additional folder using the sourceDirectory parameter. You need to register that path in the global Jenkins settings though.

          Unfortunately, HIDDEN_BUILD_PATH is inside the workspace

          Jan-Frederik Schmidt added a comment - Unfortunately, HIDDEN_BUILD_PATH is inside the workspace

          Ulli Hafner added a comment -

          From your comment above it looks like you are running the build on a Windows agent. Can you please check if the absolute file path for a warning contains the exact prefix of the folder that has been printed as workspace (check the capitalization as well for things like c: vs. C:). The file path is visible in your compiler log or in the build output file of my warnings plugin: $JENKINS_HOME/jobs/[job-name]/builds/[build-number]/*issues.xml.

          Ulli Hafner added a comment - From your comment above it looks like you are running the build on a Windows agent. Can you please check if the absolute file path for a warning contains the exact prefix of the folder that has been printed as workspace (check the capitalization as well for things like c: vs. C: ). The file path is visible in your compiler log or in the build output file of my warnings plugin: $JENKINS_HOME/jobs/ [job-name] /builds/ [build-number] /*issues.xml .
          Jan-Frederik Schmidt made changes -
          Attachment New: Selection_20210923_01.png [ 56334 ]
          Jan-Frederik Schmidt made changes -
          Attachment Original: Selection_20210923_01.png [ 56334 ]

            drulli Ulli Hafner
            g3n35i5 Jan-Frederik Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: