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

Jenkins variables are not expanded in Coverity plugin

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • coverity-plugin

      In the additional arguments fields for cov-build, cov-analyze, cov-commit, etc., Jenkins build variables are not able to be used. I tried to add the following to additional cov-commit-defects arguments:

      --strip-path "${WORKSPACE}" --target x86 --description "from Jenkins"

      and the variable is not replaced with the workspace, it actually tried to strip the path of '${WORKSPACE}' which is obviously not what you want to do.

          [JENKINS-14833] Jenkins variables are not expanded in Coverity plugin

          Chris Wozny added a comment -

          Can we get an update as to whether this has been brought in yet? Also, I wonder if it would be possible to maintain a backported 1.2.4 branch for the folks who aren't using CIM v6 or greater...

          Chris Wozny added a comment - Can we get an update as to whether this has been brought in yet? Also, I wonder if it would be possible to maintain a backported 1.2.4 branch for the folks who aren't using CIM v6 or greater...

          Our Java build slaves are running on multiple platforms. We would like to reuse the intermediate directories to speed up the Java incremental builds (between ALL platforms).

          The intermediate directories are shared over a network filesystem (CIFS and NFS).
          The nodes have an environment variable "coverityimdirs" set to the directory of the shared mount point (mapped CIFS shareon windows and mounted NFS share on linux).

          If I could use the node environment variables here all would be fine.

          I have already tried "$coverityimdirs", "${coverityimdirs}" and "${ENV.coverityimdirs}".
          In any case the coverity plugin does not replace the variable with the value I have set on the node environment.

          Daniel Fischer added a comment - Our Java build slaves are running on multiple platforms. We would like to reuse the intermediate directories to speed up the Java incremental builds (between ALL platforms). The intermediate directories are shared over a network filesystem (CIFS and NFS). The nodes have an environment variable "coverityimdirs" set to the directory of the shared mount point (mapped CIFS shareon windows and mounted NFS share on linux). If I could use the node environment variables here all would be fine. I have already tried "$coverityimdirs", "${coverityimdirs}" and "${ENV.coverityimdirs}". In any case the coverity plugin does not replace the variable with the value I have set on the node environment.

          Roger Layani added a comment -

          Is there any plan to implement this capability?
          It is very important for the plugin usage.

          Roger Layani added a comment - Is there any plan to implement this capability? It is very important for the plugin usage.

          Joel Briggs added a comment -

          I believe this was resolved in more recent releases of the coverity plugin using the "advanced parsing mechanism". Part of my assumption is that there has been no activity on this issue for quite some time (and quite a few releases since last updated).

          Please reopen if there's still an issue (or contact Synopsys (Coverity) support)

          Joel Briggs added a comment - I believe this was resolved in more recent releases of the coverity plugin using the "advanced parsing mechanism". Part of my assumption is that there has been no activity on this issue for quite some time (and quite a few releases since last updated). Please reopen if there's still an issue (or contact Synopsys (Coverity) support)

          I am still not getting variables expanded properly when using the Synopsys Coverity Plugin v3.0.1 with Jenkins 2.332.3

          At least, the fields for "Coverity project" and "Coverity stream" and not working. I'm trying to use this to create a generic downstream project to run Coverity tests after our CI builds have been run, as well as dynamically assign a stream name based on the git branch being built.

          Tyler Gustafson added a comment - I am still not getting variables expanded properly when using the Synopsys Coverity Plugin v3.0.1 with Jenkins 2.332.3 At least, the fields for "Coverity project" and "Coverity stream" and not working. I'm trying to use this to create a generic downstream project to run Coverity tests after our CI builds have been run, as well as dynamically assign a stream name based on the git branch being built.

          Shivangie added a comment -

          Agree to tyler_gustafson, we have been facing a similar issue with Jenkins 2.361.1 and Synopsys Coverity pluginVersion3.0.1
          The fields "Coverity Project" and "Coverity Stream" are forced to be hardcoded rather than accepting dynamic values for reutilization of the same pipeline for various projects.

          Shivangie added a comment - Agree to tyler_gustafson , we have been facing a similar issue with Jenkins 2.361.1 and Synopsys Coverity pluginVersion3.0.1 The fields "Coverity Project" and "Coverity Stream" are forced to be hardcoded rather than accepting dynamic values for reutilization of the same pipeline for various projects.

          Chuck Aude added a comment -

          tyler_gustafson and shivangie_singh I assume you both are using the Synopsys Coverity plugin in a Jenkins Freestyle project? If so, I suggest opening a support ticket if you have not already.

          Just a FYI... the plugin will properly expand variables when used in a Jenkins Pipeline (inline script or Jenkinsfile). For example:
          https://github.com/chuckaude/hello-java/blob/main/jenkins/Jenkinsfile.coverity-plugin#L24

          Chuck Aude added a comment - tyler_gustafson and shivangie_singh I assume you both are using the Synopsys Coverity plugin in a Jenkins Freestyle project? If so, I suggest opening a support ticket if you have not already. Just a FYI... the plugin will properly expand variables when used in a Jenkins Pipeline (inline script or Jenkinsfile). For example: https://github.com/chuckaude/hello-java/blob/main/jenkins/Jenkinsfile.coverity-plugin#L24

          chuckaude shivangie_singh Thanks for the replies. I've opened a case with Synopsys and they have confirmed this is a bug. They are currently deciding when to fix it and have been for a few weeks.

          If you can search their bug tracking system, the case number is #ICJ-239 and the title is: Jenkins Variables are not Expanded in Synopsys Coverity Plugin

           

          I wouldn't be surprised if pipeline works as Chuck mentioned. For the time being I'm going to be duplicating projects with hardcoded values rather than rewriting our current ecosystem.

          Tyler Gustafson added a comment - chuckaude shivangie_singh Thanks for the replies. I've opened a case with Synopsys and they have confirmed this is a bug. They are currently deciding when to fix it and have been for a few weeks. If you can search their bug tracking system, the case number is #ICJ-239 and the title is: Jenkins Variables are not Expanded in Synopsys Coverity Plugin   I wouldn't be surprised if pipeline works as Chuck mentioned. For the time being I'm going to be duplicating projects with hardcoded values rather than rewriting our current ecosystem.

          Shivangie added a comment -

          chuckaude Yes, as a workaround we have been using variables in the declarative pipeline script and it works perfectly fine, but we had to send considerate amount of time to figure out that the same is not working for freestyle job. Thanks for sharing the reference!

          tyler_gustafson Thanks for raising the support ticket and sharing the details here.

          Shivangie added a comment - chuckaude Yes, as a workaround we have been using variables in the declarative pipeline script and it works perfectly fine, but we had to send considerate amount of time to figure out that the same is not working for freestyle job. Thanks for sharing the reference! tyler_gustafson Thanks for raising the support ticket and sharing the details here.

          Mark Waite added a comment -

          The coverity plugin has been deprecated for many years. It is replaced with the Synopsys Coverity plugin. This issue will not be fixed in the Coverity plugin.

          Mark Waite added a comment - The coverity plugin has been deprecated for many years. It is replaced with the Synopsys Coverity plugin. This issue will not be fixed in the Coverity plugin.

            joshvinson Josh Vinson
            koconnor Kyle O'Connor
            Votes:
            9 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved: