Coverity1.9.0Minimum Jenkins requirement: 1.651.3ID: coverity
Compatibility with Coverity Connect
The Coverity plugin for Jenkins performs four functions:
- It can transparently invoke the Coverity Static Analysis tools during your build (optional)
- It can transparently invoke the Coverity Test Advisor tools during your build (optional)
- It can fail the build if defects are found matching certain criteria
- It reports found defects after the build
- Install the plugin using the Plugin Manager, and restart Jenkins.
- Go to the global configuration page (Manage Jenkins > Configure System).
- If the Coverity Static Analysis tools are not on the PATH, configure the location (for the master) here.
- Add connection details for any number of Coverity Connect instances you want to use. Click Check configuration to validate your settings.
- For any node where Coverity Static Analysis is not on the PATH (and is at a different location than on the master), configure the location on the node configuration page.
- Create the job, by creating it from scratch or copying from an existing job.
- Under Build, select Add build step and select Invoke Coverity Capture Build, if needed.
- Under Post-build Actions, select Add post-build action and select Coverity.
- Select the Coverity Connect instance, project and stream relevant for this job.
- If you want the plugin to invoke cov-build/cov-analyze/cov-commit-defects for you, check Perform Coverity build, analysis and commit. You can add additional arguments for each of these tools, and configure the intermediate directory used (all optional).
- If your build already invokes Coverity, leave the checkbox unchecked.
- If you want to fail the build when defects are found, check the corresponding checkbox. By default all defects are considered, but you can specify filters. Every filter should match for a defect to be included.
- If you want the plugin to invoke test and Test Advisor functions for you, check Perform Coverity Test Advisor and Commit. You can add additional arguments and functionality to the build by entering your source control configurations (optional).
Start your build. After the build has completed, a link to Coverity Defects will be available on the build page. On the project page, a graph with historical defect counts will be visible (as soon as more than one build has been performed).
To access the Coverity Plugin Configuration dialog, first choose a project in your Jenkins server, and select Configure.
Coverity-specific settings are available under the Build and Post-build Actions sections.
Click Add build step and select Invoke Coverity Capture Build. You can use the Coverity Capture Build step to specify which build steps are wrapped with cov-build. If the Coverity Capture Build step is not added, then all build steps are wrapped.
The Coverity post-build action has the following options:
The Coverity plugin now provides an optional Coverity parser for interpreting commands that are executed on a Jenkins instance. If Use advanced parsing mechanism is selected, the Coverity parser is used instead of the default Jenkins parser. Either parser interprets environmental variables entered on the command line with a Jenkins command. The following rules describe how the Coverity parser interprets environmental variables.
The value of an environmental variable is passed into an array as follows. For example, if the variable VAR has the value “Some value”:
- If the variable is listed in the form $VAR, then it is interpreted as [Some, value].
- Double quotes: If listed as “$VAR”, then it is interpreted as [some value].
- String literals: If listed as ‘$VAR’, using single quotes, then it is interpreted as [$VAR].
- As with the bash shell, single quotes escape double quotes and conversely double quotes escape single quotes. For example:
- Concatenated environment variables are also supported. For example:
- Environment variables can be concatenated to a string. For example:
The Coverity parser works in two stages, interpolation and tokenization. In the interpolation stage, the values of the command line arguments (variables) are resolved. For example, if you have the following environmental variables:
Then the variables VAR5 and VAR6 are resolved as follows:
In the tokenization stage, the plugin splits up the resolved values (strings) and places them into an array.
Following the example above:
Note that the “Hello World” string, surrounded by unescaped quotes, is placed into the array as a single value, and the quotes are removed. The unquoted Hello World string is split into two array elements.
When you encounter problems while using the plugin, please provide the following information:
- What you were doing when the problem occurred.
- The error message
- The Jenkins server log file (the location is dependent on the container you use)
- The content of ‘Manage Jenkins > System Information’ (Jenkins root/systemInfo)
- The configuration file for the job (Jenkins root/jobs/job name/config.xml)
- The global configuration file for Jenkins (Jenkins root/config.xml)
- In case of problems while saving the job configuration, a screenshot before submitting, and the browser you are using.
To enable the Jenkins Coverity plugin to operate with a Coverity Connect instance that is configured to use SSL, do the following:
- Set the environmental variable CATALINA_OPTS to this value: " -Djavax.net.ssl.trustStore=$keystore -Djavax.net.ssl.trustStorePassword=changeit";
- Make sure that the environmental variable $keystore points to the Java keystore used by Coverity Connect.
- Restart the Tomcat server.
- Flexible Publisher Plugin (Coverity Post-Build Actions fail to run)
- When upgrading, make sure that all jobs using the Coverity plugin are finished and not running during upgrade. For best results, restart your Jenkins after upgrade.
- Changed Required Core Jenkins version from 1.534 to 1.651.3. (BZ 101526)
- Fixed the error "command line parsing fails" when using the MSbuild, Gradle, or NAnt plugins to build with Coverity on Windows. (BZ 101359, 101799)
- The ability to filter on Checkers is deprecated, and this functionality will be removed in an upcoming release. (BZ 101225)
- Resolved an issue where links to view Coverity defects were broken if any of the instance, project, or streams names had spaces. Updated the graph key display name to "Coverity Defects (stream name)" and the defects page URL to "coverity_defects". (BZ 100794)
- The Coverity Jenkins plugin now provides a new "Invoke Coverity Capture Build" as part of build step for users to specify which build step they wish to capture build from. Other build steps will be performed normally without wrapping around with the Coverity cov-build. (BZ 52497, 88273, 93992, 98963, 100175, 100514)
- The Coverity plugin correctly sets up the intermediate directory when capturing builds of source files that only include scripting languages. (BZ 100126)
- The ability to specify multiple commit streams in a single Jenkins job was removed. Existing configurations with more than one commit stream will continue to use the first commit stream specified. Links to defects for additional streams on old build jobs will now only show the main stream defects. (BZ 99084)
- The custom intermediate directory (or default intermediate directory) is deleted whether the build was successful or a failure, unless the option to preserve the intermediate directory is checked. (BZ 99064)
- Removed support for v6 web services (Coverity Connect version 7.6.x and earlier) and older Coverity Analysis Tools (version 7.6.x and earlier). (BZ 98702)
- The Coverity Defects page displays CID/Checker/Function/File Location of defects. (BZ 97772)
- The Jenkins Coverity plugin does not work properly when it is configured inside the Flexible Publish plugin. This is not a supported way of using the Jenkins Coverity plugin. (BZ 97184)
- Resolved an issue with the Unstable status being incorrectly set. (BZ 82665, 88020, 92293, 96455)
- Resolved an issue with the Dismissed defects status being implicitly filtered (regardless of classification filters). (BZ 82665, 88020, 92293, 96455)
Note: This may cause an increase in defects which were previously filtered automatically to be unfiltered (to match filtering de-select classifications "False Positive", "Intentional" "No Test Needed", "Tested Elsewhere"). (BZ 82665, 88020, 92293, 96455)
- Updated the default classification filters selected to match Coverity Connect Outstanding view filters. (BZ 82665, 88020, 92293, 96455)
- Removed "Microsoft Code Analysis results files" option (use "Search for Microsoft Code Analysis results" option instead). (BZ 94805)
- The Coverity plugin no longer provides a drop-down to select the "Language" in the configuration. (BZ 92811)
- Resolved an issue where Coverity publisher could not be configured by the Job DSL plugin. (BZ 91929)
- The configuration checking logic was improved. (BZ 84848)
- The "Check Configuration" button on the configuration page will validate the "Test Advisor" and "SCM" configurations as well as project and stream. (BZ 82064)
- Removed the 3000 defect limit when downloading defects from the Coverity Connect stream. (BZ 73634)
- Modified filtering to use built-in web service capabilities. This should reduce the total number of defects and amount of data retrieved from Coverity Connect. (BZ 73634)
- Updated the "Coverity Defects" page (BuildAction) so it includes all defect information. This will greatly improve the response time when viewing the Coverity Defects page. (BZ 73634)
- By clicking the "Check" button on the global configuration, the Coverity plugin will not only check the connection to the Coverity Connect instance, but will check the user's permission as well. The user is required to have "Commit to Stream", "Access web service", and "View Issues" in order to use the Coverity Jenkins plugin. (BZ 71109)
- The Coverity plugin will not fail the build when there is no snapshot in the stream, before running cov-manage-history and continuing its post-build actions. (BZ 67320)
- Users can now configure multiple strip paths for their Test Advisor configurations. (BZ 65793)
- Show a "loading projects" message when the Coverity Connect instance changes in the job configuration. (BZ 60138)
- The Coverity plugin will display the invalid project and error message to indicate that the select project cannot be found in Coverity Connect. (BZ 55377)
- Resolved a NullPointerException on the CoverityTempDir (idir) (BZ 101589)
- Support for Coverity Connect v6 web services is deprecated, and in a future release support for Coverity Analysis and Coverity Connect versions 7.6.x and earlier will be removed. (BZ 98801)
- Resolved an issue where the Coverity plugin could cause the build job results page to take a long time to load. (BZ 95459)
- Resolved an issue with environment variables that caused the plugin to fail on Windows (This issue was introduced in 1.8.0). (BZ 94839)
- Added support for 'Additional SCM arguments' on Coverity version 7.0.x. (BZ 94678)
- Added new Coverity parser for interpreting environmental variables. (BZ 94604)
- Resolved issue with a master/slave setup, where the intermediate directory was preserved when it should have been deleted. (BZ 94550)
- Resolved an issue with a plugin crash occurring when setting 'cov-build blacklist' and 'display chart' to true. (BZ 94413)
- Added support for --filename-regex option in Coverity 7.0.x. (BZ 94036)
- Resolved an issue with parsing environmental variables by using the Coverity parser." (BZ 94034)
- Resolved an issue with incorrectly wrapping argument to --misra-config. (BZ 94031)
- Added messages for when attempting to build with an incorrect or partially configured Coverity Connect information. (BZ 93458)
- Resolved issues with environmental variables not being resolved correctly. (BZ 93390)
- Resolved issues with parsing environmental variables. (BZ 93380)
- Displays error message when stream or language settings are left blank. (BZ 93288)
- Fixed an issue with incorrect parsing of environment variable values containing spaces. (BZ 93136)
- Resolved an issue where the -ssl option was used with incompatible Coverity versions. (BZ 92290)
- If a change in source code doesn't result in a new build, cov-analyze fails. Workaround is to add a dummy file which always gets built. (BZ 89440)
- Resolved an issue so that an error message is displayed when Stream is left blank in configuration. (BZ 89238)
- Resolved an issue with running cov-commit-defects command with --on-new-cert trust set. (BZ 88959)
- Resolved an issue that caused builds to fail when a WAR file is specified. (BZ 88086)
- Resolved an issue where path names containing spaces were split. (BZ 87862)
- Provided support for using scripting languages only, compiled languages only, or both scripting and compiled language sources. (BZ 87531)
- Resolved an issue where arguments were not properly wrapped in quotes. (BZ 87051)
- Resolved an issue where defects were not fetched from Coverity Connect and displayed on a graph in Jenkins after upgrading the plugin. (BZ 86997)
- Resolved an issue with the --misra-config option. (BZ 86622)
- Resolved an issue that caused plugin to fail when stream name contains spaces. (BZ 85945)
- Resolved issue that prevented MISRA checkers being enabled. (BZ 85858)
- Added environmental variables to enable running cov-import with a script after cov-build and cov-analyze commands. (BZ 84077)
- Resolved an issue with using environmental variables in the intermediate directory setting. (BZ 82984)
- Resolved a problem to support having spaces in the Coverity Static Analysis Location. (BZ 81464)
- Resolved an issue with cov-analyze failing when the options list included two or more embedded spaces. (BZ 75510)
- Resolved issue with a null pointer exception occurring when clicking Defect Filters. (BZ 71782)
- Resolved an issue with null pointer exception when filtering by impact. (BZ 71499)
- Resolved an issue to warn the user of a delay when changing a project in Coverity Connect. (BZ 69229)
- Added a method to allow users to execute commands after cov-build and cov-analyze commands. (BZ 66147)
- Resolved an issue so that the job configuration page loads normally even if the Coverity Connect configuration is invalid. (BZ 59241)
- Resolved issue where removing a user's web access permission caused a crash. Now reports a message concerning insufficient user permissions. (BZ 46833)
- Resolves a problem by issuing an error message when a stream is deleted from a job configuration. (BZ 35447)
- Resolved issue that prevented analysis of multiple .WAR files. (BZ 66004)
- Skipped due to logistics issue.
- Resolved issue that caused the plugin to fail to analyze after cov-build executes. This issue only occurred when using Coverity Analysis 8.0.0 (BZ 85629)
- Resolved issue of defects not being counted when local was set to Japanese. (BZ 79147)
- The deprecated cov-analyze[-java] has changed to cov-analyze. (BZ 83277)
- The option --misra-only will not be used on Jasper and later releases. (BZ 83372)
- Resolved issue of chart not drawing job numbers correctly. Adding the "Display defects on chat option in order to address this issue. (BZ 85014)
- Resolved issue of finding analysis home directory on slave machines. (BZ 81254)
- Resolved incompatibility between --misra-only and Test Advisor. (BZ 78807)
- Added the capability for adding many war files. (BZ 66004)
- Resolved issues when using an intermediate directory. (BZ 79060)
- Added a field for --filename-regex option. Also, added a field for additional commands for the scm option. (BZ 79395)
- Added a check button for the analysis installation directory. When the user clicks on it the plugin verifies that the given directory exists. In case the user doesn't verify this, additional checking mechanisms were added during the build to prevent misleading exception messages. (BZ 79525)
- Added MISRA support. In order to perform analysis and commit when using MISRA, there is a new option for called "Use MISRA for analysis and commit" that once selected will display a text box where a configuration file should be specified.
- Fix issue with "--include-java" option being added by default.
- Fix error message when checking configurations.
- Removed "Advanced Options" from the Configure System page.
- When using 7.7.0.
- Drop-down menu for languages only allows “ALL”.
- Under “Defect filters” for each job configuration, the “show checkers” option displays all checkers for the Coverity Connect instance associated with that job.
- Added support for Coverity Web Services v9.
- User input in configuration now resolves environment variables
- Added new checkers to the defect list for each language. List has been updated to all checkers present to 7.6.0
New C/C++ CheckersASSIGN_NOT_RETURNING_STAR_THIS
New Java CheckersATOMICITY
New C# CheckersALLOC_FREE_MISMATCH
- Fixed SSL issue with cov-manage-history
- Fixed issue where cov-build was run when "Perform Coverity build, analysis and commit" was not selected
- Fixed graphs breaking when a build has more than one CIM instances.
- Added Impact into defect filters. Checkers can now be filtered by impact** (Note) After upgrade, the build configuration might need to be reconfigured so that impact filtering can be added. Initial build after upgrade might return zero defects.
- Builds can now be marked as 'Unstable' if defects are found
- Fixed issue where defect totals was being printed as total defects instead of matched defects
- Fixed issues with receiving ERROR text within Defect Filters
- Fixed issue where checking configuration in Views gave back an ERROR text
- Commit to SSL now works properly
- Plugin now connects correctly with Coverity Connect 6.5.0
- Added Coverity Test Advisor tools to be ran during build
- Added cov-history command and source control functionality to Coverity Test Advisor tools.
- Changed method for determining Static Analysis version (BZ 61464)
- Allowed Coverity Plugin to accept similar version of Coverity Connect and Analysis , but different patches (BZ 62013)
- Increased maximum number of defects shown in job page to 3000 (BZ 60322)
- Allowed older versions of Static Analysis work with new versions of Coverity Connect (BZ 62196)
- Improve documentation
- Increase maximum number of defects shown in job page to 1000 (BZ 55368)
- Add support for 'Mixed Domain' (any language) streams (BZ 57461)
- Add support for Coverity Analysis 7.0.0 (BZ 55618)
- Don't fail the build if analysis and defect checking are both disabled (BZ 49096)
- Improve compatibility with older versions of Connect/CIM. (BZ 54854)
- Allow overrides for analysis/commit settings for an individual job (BZ 47499, BZ 45728)
- Add support for cov-emit-java --webapp-archive
- Add support for FxCop/MSVSCA results (BZ 50247)
- Add automatic searching for C# assemblies
- Fix a bug where builds would hang when JDKs were automatically installed (BZ 50669)
- Fix a bug that caused linux/solaris executables to called as if they were on windows (BZ 55117)
- Improve error message when a configured stream is absent in CIM/Connect (BZ 54068, BZ 51304)
- Upgrade Coverity web services code to v5. (BZ 51322)
- Redo the previous fix from 1.2.3, as it broke some workflows. (BZ 52107)
- Fix a NullPointerException that occurred when the build/analyze/commit checkbox was unchecked. (BZ 52034)
- Add an option for specifying the commit port of a CIM instance manually, as a workaround for an issue with committing defects. (BZ 51458)
- Fix a NullPointerException during C# builds. (BZ 50321)
- Allow configuration of multiple streams and languages for each job. The appropriate analysis and commit steps will be run for each. (BZ 47499)
- Fix a bug where normally hidden streams would be available for selection in configuration (BZ 49226)
- Add a field for blacklisting executables from being wrapped by cov-build (BZ 38025, BZ 47534, BZ 48921, JIRA JENKINS-14834)
- Add an option to hide the defects chart (BZ 47524)
- Update checkers list to match 6.5.0 checker documentation (BZ 48917)
- Add an option to not fetch defects after commit (BZ 47226)
- Allow static analysis binaries to be specified on a per-job basis (BZ 47224)