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

codesonar-plugin - projectName.conf is overwritten with a template

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • codesonar-plugin
    • None

      Using the https://github.com/jenkinsci/codesonar-plugin#setting-up-the-plugin

      When running the job, we first get the following error, which is standard in our environment as we have multiple projects using multiple compilers.
      codesonar: I did not notice any compiler executions, or I did not find any files to analyze.

      Possible Cause 1: The compiler did not execute. This often happens because your build system detects the project is already built. Perform a clean/full rebuild and ensure that your build system executes a compiler.

      Possible Cause 2: codesonar does not know that your compiler executable is a compiler, and ignores it. For example, perhaps your compiler is called 'mycc'. You can inform codesonar that mycc is a compiler by adding a line such as 'COMPILER_MODELS += mycc -> gcc' to /home/user/workspace/Plugin-Test-ML2-AGCX/Plugin-Test-ML2-AGCX.conf. This says that mycc should be treated as if it is gcc (there are other choices besides gcc).

      Possible Cause 3: codesonar does not understand the flags being passed to your compiler on the command line, is not interpreting the commands as a compilation commands, and may be failing as a result. Check the parse log on the hub to see if any compiler invocations were noticed. If any were detected, then the compiler model may need to be switched or adjusted.

      Possible Cause 4: The compiler is executing outside the process tree rooted at this codesonar process (or on another machine).

      Possible Cause 5: You are using cs-java-scan, cs-dotnet-scan, cs-metascan, or another such scanner, but it was unable to identify any source files to analyze. Check that the target of the scan is correct, and the parse log on the hub for further details.
       

      After inserting the compiler into the Plugin-Test-ML2-AGCX.conf file and trying to run again we get the same exact error again. After inspecting the Plugin-Test-ML2-AGCX.conf we can see that it has replaced the file. When we investigated further we found that when CodeSonar is starting the "monitoring" of files and how the compiler is compiling the source code the following line stood out to us.
      codesonar: Authenticating with https://codesonar.deif.com:7340 (anonymous)...ok
      Created /home/user/workspace/Plugin-Test-ML2-AGCX/Plugin-Test-ML2-AGCX.conf from /opt/codesonar/codesonar/template.conf
      codesonar: Creating new analysis on hub...
      Is there a way to disable this creation of a new projectName.conf from a template if there is already one present, and can we  overwrite the compiler model in our pipeline script

      {{}}

      {{ env.CSONAR_CMD_ARGS = "$CSONAR_HUB_ADDRESS \
      $CSONAR_WORKDIR/$CSONAR_PROJECT_NAME \
      -project $CSONAR_PROJECT_NAME \
      -auth certificate -hubcert $CSONAR_USER_CERT -hubkey $CSONAR_USER_PRIVKEY \
      -foreground"}}

       

            gt_dbechtold gt_dbechtold
            mps Manuel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: