Giter Site home page Giter Site logo

klocwork-plugin's Introduction

Jenkins Klocwork Community Plugin

The Klocwork Community Plugin for Jenkins enables automated Klocwork analyses within Jenkins.

Supported features:

More information and up-to-date documentation can be found here: Jenkins Plugin Documentation, Klocwork's Documentation

Technical support

The plugin is maintained by Klocwork Team. For any questions visit Technical support

Latest features:

  • Issue citing for CI-Analysis jobs
  • New build step names. (Make sure to update your pipeline scripts to match the changes. Use Pipeline Snippet Generator to retrieve updated names)
  • Pipeline support
  • Job-DSL support
  • Klocwork Cross-Project Synchronisation
  • Incremental Diff Analysis & Quality Gateway

Changelog

Version 2023.3.1

  • Fixed localization strings

Version 2023.2

  • No changes

Version 2023.1

  • General Update: Added ability to choose RLM as a license service provider
  • Bug fix: fixed authentication problem when citing loaded defects through analysis results tool

Version 2022.4

  • No changes

Version 2022.3

  • No changes

Version 2022.2

  • General Update: added support for the License Provider option when using with latest Klocwork tools (2022.2 and up)

Version 2022.1

  • General Update: added optional 'Working Directory' text box in 'Klocwork Step 1 - Capture Build Information' step widget
  • Bug fix: corrected 'Load Analysis Results' step pipeline script generation to always include required values

Version 2021.3

  • General Update: added missing relevant buildspec creation tools to the plugin
  • General Update: changed report chart to use interpolation plot instead of discrete trend

Version 2020.3.1

  • General Update: fixed potential XXE vulnerability in XML-parser

Version 2020.3

  • Feature: Added user authorization for issue citing
  • Feature: Added ability to show only changed file in Post Analysis - Build Failure Condition Step
  • Bug fix: Fixed Japanese translation encodings for some of the text fields
  • Bug fix: Fixed the job failing when changed files list contains non-existent file. Error message is logged instead.

Version 2020.2

  • Feature: Added issue citing through CI-analysis report

  • General Update: New build step names:

    Klocwork - Step 1 (CI/Full) - Capture Build Information Klocwork - Step 2 (Full) - Run Analysis <-replaces Analysis Full Klocwork - Step 2 (CI) - Run Differentail Analysis <-replaces Incremental Diff Analysis Klocwork - Step 3 (Full) - Load Analysis Results <-replaces DB Load

    Klocwork - Post Analysis (Full) - Cross-Project Issue Sync (Optional)
    Klocwork - Post Analysis (Full/CI) - Build Failure Conditions (Optional) <-replaces Quality Gateway

  • General Update: Changed several class names to match standardized build step names

  • General Update: Added internationalization

  • General Update: Analysis support by 'kwcheck' removed. Analysis support only by 'kwciagent' added.

  • General Update: Removed deprecated features

  • Bug fix: Fixed problem with 'kwmaven' not working properly

  • Bug fix: Fix KW Dashboard not showing on job page for pipeline jobs

  • General Update: changed version enumeration format to match Klocwork release versions

Version 2.5.2

  • General Update: switched pom.xml to use jenkins https. This change does not impact existing configuration or behaviour.

Version 2.5.1

  • Bug Fix: Resolved issue where the diff analysis command line is too long. The diff file is now passed as an argument file, rather than each file on the command line. Also skipped the check internally between the diff file and the build specification as kwciagent does this itself and also provides output to skipped files. This change does not impact existing configuration or behaviour.

Version 2.5.0

  • Feature: Added option to the advanced section of the integration analysis step, that if the specified project does not exist it will be created or duplicated from another. This change does not impact existing configuration or behaviour (off by default), however to make use of the new feature extra pipeline configuration or GUI configuration is needed.

Version 2.4.9

  • Bug Fix: Update to resolve issue with the Klocwork server url links. Projects with special characters such as spaces or projects that had been renamed would generate invalid url links. No impact or change to configuration should be needed.

Version 2.4.8

  • Bug Fix: Update to resolve issue with severities in Japanese language. No impact or change to configuration should be needed.

Version 2.4.7

  • Bug Fix: Resolved issue introduced in 2.4.6 where global server/install settings were not being saved. No impact or change to configuration should be needed.
  • Bug Fix: Resolved issue where the trend graph and Klocwork link introduced in 2.4.3 were not showing in pipeline jobs. No impact or change to configuration should be needed.
  • Bug Fix: Resolved issue when generating a pipeline snippet on step 'klocworkIntegrationStep2'. No impact or change to configuration should be needed.

Version 2.4.6

  • Feature: Added the ability to use with jcasc plugin. No impact or change to configuration should be needed.

Version 2.4.5

  • Bug Fix: Resolved issue in which when reading the ltoken file the resource was not closed. No impact or change to configuration should be needed.

Version 2.4.4

  • Bug Fix: Post-build step "Klocwork Gateway". The query string sent to the server was being incorrectly formatted due to errors in the code. No impact or change to configuration should be needed.

Version 2.4.3

  • New feature: Added trend graph and link to Klocwork review to the main product page. Configuration can be found in the integration step for loading. This does impact pipeline configuration
  • Important note: This version requires an update to the pipeline scripts running integration builds to continue to run. Please find examples below:

Pipeline before 2.4.3:

klocworkIntegrationStep2 ( [ tablesDir: "${KLOCWORK_TABLES}", buildName: "", additionalOpts: "" ])

Pipeline 2.4.3 without trend chart:

klocworkIntegrationStep2 (
            serverConfig:[
                tablesDir: "${KLOCWORK_TABLES}",
                buildName: "",
                additionalOpts: ""
            ]
)

Pipeline 2.4.3 with trend chart:

klocworkIntegrationStep2 (
            serverConfig:[
                tablesDir: "${KLOCWORK_TABLES}", 
                buildName: "", 
                additionalOpts: "" 
            ],
            reportConfig:[
               displayChart: true,
               chartHeight: "",
               chartWidth: "",
               query: "status:Analyze"
           ]
 )

Version 2.4.2

  • Bug fix: Dashboard feature caused a could "not serialize" bug in some environments. Implemented Serializable for KlocworkIssue. No impact to existing configuration expected.

Version 2.4.1

  • Bug fix: Dashboard feature caused a could "not serialize" bug in some environments. Implemented Serializable for KlocworkSeverities and KlocworkStatuses. No impact to existing configuration expected.

Version 2.4.0

  • Bug fix: Dashboard feature caused a could "not serialize" bug in some environments. Implemented Serializable for KlocworkXMLReportParser and KlocworkXMLReportParserIssueList. No impact to existing configuration expected.
  • Bug fix Fixed pipeline snippet editor not showing the correct snippet for quality gate. No impact to existing configuration expected.

Version 2.3.9

  • New feature: Added parameter to Klocwork CI gateway to "report results". This creates a link on the build/project page to "Klocwork Dashboard" which allows issues to be seen. No impact to existing configuration expected.
  • New feature: Changed step Klocwork CI gateway to allow multiple quality gates similar to the integration build. No impact to existing configuration expected.
  • New feature: Changed step Klocwork CI gateway to include filtering on severities and statuses. No impact to existing configuration expected.

Version 2.3.8

  • New feature: Added parameter to Klocwork CI gateway to allow the build to fail as unstable rather than failure. No impact to existing configuration expected.

Version 2.3.7

  • Minor bug fix: Updated file handling to use UTF-8 to support use in Japan

Version 2.3.6

  • New feature: added an option to the quality gate to stop the build from continuing if the gate failed a condition
  • Major bug fix: fixed backwards compatibility issue with quality gate in pipelines when referring to old config using old terms, when using old config this cause the quality gate to be skipped.

Version 2.3.5

  • Minor bug fix: resolved issue where the quality gate config wouldn't show in job configuration page.

Version 2.3.4

  • New feature: Added in support to use kwciagent as the diff analysis tool
  • Re-factored plug-in to refer to Ci in the diff analysis
  • Minor bug fix: fixed issue were build command got encapsulated in quotes
  • Added a config file for the pipeline step for the build specification generation step, this enables the step to appear in the syntax generator.

Version 2.3.3

  • Minor bug fix: resolved issue in diff analysis where files/paths were in a different case on windows between the build specification and file system were being ignored.
  • Minor bug fix: resolved issue on windows were the git change list command was incorrectly encapsulating the command with double quotes.

Version 2.3.2

  • Added the Klocwork tools kwgradlew and kwgradle to the drop down selection for the build specification step

Version 2.3.1

  • Minor bug fix: resolved conflict with other plug-ins using older versions of org.joda.time

Version 2.3

  • New feature: added a new step for generating a build specification file to be run before the analysis steps

Version 2.2.3

  • New feature: added an option to the integration build step to disable the running of kwdeploy.

Version 2.2.2

  • Changed how the output from kwciagent was generated to reduce console noise and generate a consistent xml
  • Minor bug fix: Fixed an issue with windows agents were env vars were not injected correctly

Version 2.2.1

  • Minor bug fix: updated deprecated build step to make use build name setting

Version 2.2

  • New feature: support for Java diff analysis
  • Major bug fix: resolved issue were global license server settings were passed to integration analysis step even if blank
  • Major bug fix: updated the integration quality gate query to allow users to specify grouping:on if they wish

Version 2.1

  • Minor bug fix: resolved potential NPD when checking threshold values
  • Minor bug fix: updated the wiki link in the plugin pom.xml
  • Major bug fix: updated Klocwork api library to make use of Jenkins environment variables

Version 2.0

  • Simplified creation of Klocwork static analysis jobs or tasks
  • Supports Klocwork full, incremental and incremental diff analysis
  • Allows job success criteria to be connected to static analysis results via a Quality Gateway
  • Provides per-checkin CI analysis of just the changed files for minimum analysis times
  • Support for Jenkins Pipelines
  • Support for Job-DSL

Version 1.24.6

  • Merged various changes and bug fixes from Emenda
  • Added support for use of variables in configuration
  • Updated the version of kwjlib for Klocwork API usage
  • Updated the global settings so that it uses the Klocwork tool in the path

Version 1.18

  • Fix reoponed JENKINS-29673 - Klocwork plugin does not work in a master/slave configuration

Version 1.17

  • Fix JENKINS-29673 - Klocwork plugin does not work in a master/slave configuration

Version 1.16.3

  • Avoid errors when building on slaves
  • Avoid error 500 when restarting jenkins
  • Avoid NPE from old version of config.xml which doesn't contain the tag

Version 1.16.2

  • Clean code by applying IDEA format and by removing unused code
  • Use SCM features for changelog

Version 1.16.1

  • Changing Jenkins version to be Java 7 compliant

Version 1.16

  • Enabled multiple build specification files
  • Removed Dashboard portlet component to also remove dependency on dashboard view plugin
  • Added SSL support
  • Build graph previously incorrectly removed, now re-instated
  • Fixed Multiconfiguration project bug in Publisher

Version 1.15

  • Enabled embedded Klocwork results in Klocwork v9.6 and later.
  • Achieved using kwjlib to retrieve issues from Klocwork Web API, which are put into an XML file by KloXMLGenerator and then parsed as before

Version 1.14.1

  • Allowing Klocwork publisher to appear in maven job

Version 1.14

  • Fixed NullPointerException and added compiler options

Version 1.13

  • Fix reopened JENKINS-12861 - klocwork - update to recognize 9.5.x xml schema

Version 1.12

  • Fix JENKINS-12861 - klocwork - update to recognize 9.5.x xml schema

Version 1.11

  • Merge pull request - Add compatibility with Klocwork v9.6

Version 1.10

  • Fix JENKINS-13668 - Klocwork Plugin Fails if no KW Issues

Version 1.9

  • Fix JENKINS-14005 - Major issue when Klocwork reporting is enabled

Version 1.8.1

  • Allow publisher part to appear in maven jobs.

Version 1.8

  • Fixed JENKINS-13743 - Jenkins 1.463 + Klocwork plugin - crashes when saving configuration

Version 1.7

  • Fixed JENKINS-12535 - Link to the line which contains the klocwork error instead of just linking to the file.

Version 1.6

  • Update to latest DTkit versions

Version 1.5

  • Updated version number. Provided variable ${BUILD_ID} when specifying Klocwork tables directory such that a unique directory can be used for each build.
  • Added functionality to specify options for kwbuildproject. Useful for changing location of tables directory, adding compiler options, etc.

Version 1.4

  • Updated xml parser to work with reports generated by Klocwork v9.5. New features: per-build pie chart showing number of issues and their state, a link to view the build.log, link to view the parse_errors.log and a link to access Klocwork Review within Jenkins. Now to test on Windows.

Version 1.3

  • Fixed JENKINS-10773
  • Fixed JENKINS-10775
  • Fixed JENKINS-10776

Version 1.2

  • Fixed JENKINS-10455

Version 1.1

  • Fixed JENKINS-10379 - Allowed statuses for Klocwork report are incorrect
  • Fixed args parsing

Version 1.0

  • Initial version

klocwork-plugin's People

Contributors

andreaslarfors avatar ayakhlef avatar benemenda avatar cdo82 avatar daniel-beck-bot avatar emenda-support avatar ewelinawilkosz avatar gboissinot avatar jlarfors avatar jvroutak avatar mhalder avatar msysji avatar nicolas-eveillard avatar sbutylinp4 avatar steven-aerts avatar yoomega13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

klocwork-plugin's Issues

Support for kwxsync

https://developer.klocwork.com/documentation/en/insight/10-1/kwxsync

The kwxsync command synchronizes issue status updates and comments, along with the ID of the user who made the changes, among projects that you specify. All of the updates are merged, so that identical issues in multiple projects have an identical history.

This is useful when projects share source code, as in the case of branches. Developers need to cite detected issues only once for each source file; kwxsync can then apply their changes to other projects containing the same source file. Since kwxsync can run incrementally to update only the most recent status updates and comments, you can run the tool continuously, to ensure that each developer sees an up-to-date list of issues.

The projects can be in different projects_root directories, as well as on different hosts.

When the same issue, across multiple projects, have different statuses - KW reports the status as 'Multiple', causing the KW plugin to crash.

4392fea provides a fix for this issue.

Running klocwork scan on docker agent

Jenkins and plugins versions report

Environment
Result
Jenkins: 2.303.1
OS: Linux - 5.15.0-43-generic
---
Parameterized-Remote-Trigger:3.1.5.1
PrioritySorter:4.0.0
ace-editor:1.1
allure-jenkins-plugin:2.29.0
ant:1.11
antisamy-markup-formatter:2.1
apache-httpcomponents-client-4-api:4.5.13-1.0
authentication-tokens:1.4
badge:1.8
blueocean:1.25.0
blueocean-autofavorite:1.2.4
blueocean-bitbucket-pipeline:1.25.0
blueocean-commons:1.25.0
blueocean-config:1.25.0
blueocean-core-js:1.25.0
blueocean-dashboard:1.25.0
blueocean-display-url:2.4.1
blueocean-events:1.25.0
blueocean-git-pipeline:1.25.0
blueocean-github-pipeline:1.25.0
blueocean-i18n:1.25.0
blueocean-jira:1.25.0
blueocean-jwt:1.25.0
blueocean-personalization:1.25.0
blueocean-pipeline-api-impl:1.25.0
blueocean-pipeline-editor:1.25.0
blueocean-pipeline-scm-api:1.25.0
blueocean-rest:1.25.0
blueocean-rest-impl:1.25.0
blueocean-web:1.25.0
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.1-1
bouncycastle-api:2.25
branch-api:2.7.0
build-pipeline-plugin:1.5.8
build-timeout:1.20
built-on-column:1.1
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloudbees-bitbucket-branch-source:2.9.11
cloudbees-folder:6.16
command-launcher:1.6
conditional-buildstep:1.4.1
config-autorefresh-plugin:1.0
copyartifact:1.46.2
credentials:2.6.1
credentials-binding:1.27
cvs:2.19
display-url-api:2.3.5
docker-build-publish:1.3.3
docker-commons:1.17
docker-java-api:3.1.5.2
docker-plugin:1.2.3
docker-workflow:1.26
durable-task:1.39
echarts-api:5.1.2-11
email-ext:2.83
emailext-template:1.2
envinject:2.4.0
envinject-api:1.8
external-monitor-job:1.7
favorite:2.3.3
font-awesome-api:5.15.4-1
generic-webhook-trigger:1.77
gerrit-code-review:0.4.7
gerrit-trigger:2.35.2
gerrit-verify-status-reporter:0.0.3
ghprb:1.42.2
git:4.8.2
git-client:3.10.0
git-server:1.10
github:1.34.1
github-api:1.133
github-branch-source:2.11.3
github-pullrequest:0.3.0
gradle:1.37.1
groovy-postbuild:2.5
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
htmlpublisher:1.25
jackson2-api:2.12.4
javadoc:1.6
jaxb:2.3.0.1
jdk-tool:1.5
jenkins-design-language:1.25.0
jenkins-multijob-plugin:1.36
jira:3.6
jjwt-api:0.11.2-9.c8b45b8bb173
job-dsl:1.78.1
job-import-plugin:3.4
jobConfigHistory:2.28.1
jquery:1.12.4-1
jquery-detached:1.2.1
jquery-ui:1.0.2
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.53
klocwork:2022.2
ldap:2.7
lockable-resources:2.11
mailer:1.34
mapdb-api:1.0.9.0
matrix-auth:2.6.8
matrix-project:1.19
maven-plugin:3.13
mercurial:2.15
momentjs:1.1.1
okhttp-api:3.14.9
pam-auth:1.6
parameterized-trigger:2.41
pipeline-build-step:2.15
pipeline-github-lib:1.0
pipeline-githubnotify-step:1.0.5
pipeline-graph-analysis:1.11
pipeline-input-step:2.12
pipeline-milestone-step:1.3.2
pipeline-model-api:1.9.3
pipeline-model-declarative-agent:1.1.1
pipeline-model-definition:1.9.3
pipeline-model-extensions:1.9.3
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.9.3
pipeline-stage-view:2.19
pipeline-utility-steps:2.10.0
plain-credentials:1.7
plugin-util-api:2.5.0
popper-api:1.16.1-2
popper2-api:2.10.1-1
powershell:1.6
protecode-sc:0.18.2
pubsub-light:1.16
python:1.3
resource-disposer:0.16
role-strategy:3.2.0
run-condition:1.5
scm-api:2.6.5
script-security:1.78
snakeyaml-api:1.29.1
sse-gateway:1.24
ssh-credentials:1.19
ssh-slaves:1.33.0
sshd:3.1.0
structs:1.23
subversion:2.14.5
throttle-concurrents:2.5
timestamper:1.13
token-macro:266.v44a80cf277fd
trilead-api:1.0.13
variant:1.4
windows-slaves:1.8
workflow-aggregator:2.6
workflow-api:2.46
workflow-basic-steps:2.24
workflow-cps:2633.v6baeedc13805
workflow-cps-global-lib:2.21
workflow-cps-global-lib-http:1.13.0
workflow-durable-task-step:2.40
workflow-job:2.42
workflow-multibranch:2.26
workflow-scm-step:2.13
workflow-step-api:2.24
workflow-support:3.8
ws-cleanup:0.39

What Operating System are you using (both controller, and any agents involved in the problem)?

Ubuntu-based containers.

Reproduction steps

  1. Unpack klocwork installation to /tmp/klocwork/latest

  2. Add klocwork installation named latest with path /tmp/klocwork/latest

  3. Create pipeline with docker agent, e.g.:

    agent {
        docker {
            image '<MY_IMAGE>'
            reuseNode true
            label 'some_label'
        }
    }
    stage('Klocwork') {
        environment {
             KW_LTOKEN = '/tmp/ltoken'
             KW_PROJECT='<PROJECT_NAME>'
         }
         stages {
             // call kwauth & kwdeploy here
             stage('Initialize') {
                  steps {
                      klocworkWrapper(installConfig: 'latest', ltoken: "${KW_LTOKEN }", serverConfig: '<SERVER_CONFIG>', serverProject: "${KW_PROJECT}") {
                      klocworkBuildSpecGeneration([
                          additionalOpts: '',
                          buildCommand: './build.sh', // NOTE: put proper build command/script here
                          ignoreErrors: false,
                          output: 'kwinject.out',
                          tool: "kwinject"])
                      klocworkIntegrationStep1([
                          buildSpec: 'kwinject.out',
                          disableKwdeploy: false,
                          duplicateFrom: '',
                          ignoreCompileErrors: true,
                          importConfig: '',
                          incrementalAnalysis: false,
                          tablesDir: 'kwtables'])
         // rest of pipeline
    
  4. Run the pipeline

Expected Results

kwinject working properly.

Actual Results

[Pipeline] {
[Pipeline] klocworkBuildSpecGeneration
[Klocwork BuildSpecBuilder] - Starting Klocwork Build Specification Generation Step
[my-pipeline] $ docker exec --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** cf5ba0f7bed568a7702aa710ea139cfcedae9b61234a425eef93848bd0e14505 /bin/sh -c "kwinject --version"
/bin/sh: 1: kwinject: not found
Return code: 127

Anything else?

It looks like kwinject cannot be found.

If I put full path to the kwinject using tool argument to klocworkBuildSpecGeneration then it can be found, but the next step - executing kwbuildproject fails, and it is not possible to provide full path to kwbuildproject.

For me it is strange the command is being run with docker command - because the pipeline is running in docker container already - see beginning of the build log:

[Pipeline] Start of Pipeline
[Pipeline] getContext
[Pipeline] node
Running on my-node in /home/jenkins/workspace/my-pipeline
[Pipeline] {
[Pipeline] isUnix
[Pipeline] sh
+ docker inspect -f . <MY_IMAGE>
.
[Pipeline] withDockerContainer
my-node does not seem to be running inside a container
$ docker run -t -d -u 1002:120 -v /home/jenkins/.ssh:/home/jenkins/.ssh -w /home/jenkins/workspace/my-pipeline -v /home/jenkins/workspace/`my-pipeline:/home/jenkins/workspace/my-pipeline:rw,z -v /home/jenkins/workspace/my-pipeline_tmp:/home/jenkins/workspace/my-pipeline_tmp:rw,z -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** <MY_IMAGE> cat
$ docker top cf5ba0f7bed568a7702aa710ea139cfcedae9b61234a425eef93848bd0e14505 -eo pid,comm
[Pipeline] { // rest of build log

Perhaps this is the problem (?)

ERROR: Content is not allowed in prolog

Hi!
I'm using Klocwork plugin in Jenkins pipelines with success, but it's failing for a specific branch build.
This is the Klocwork step which is called when I get the error:

klocworkQualityGateway ([
    enableCiGateway: true,
    gatewayCiConfigs: [[
        enableHTMLReporting: true,
        enabledStatuses: [
            analyze: true,
            defer: true,
            filter: true,
            fix: true,
            fixInLaterRelease: true,
            fixInNextRelease: true,
            ignore: true,
            notAProblem: true
        ],
        failUnstable: true,
        name: 'No New Issues (Any Status)',
        reportFile: "kwreport.xml",
        threshold: '1'
    ]]
])

The same snippet is used in the same pipeline, and it's working as is expected in other branches.

Here is error, It's extracted from a Jenkins logger under package scope com.emenda.* and ALL level:

Feb 17, 2020 4:19:51 PM FINE com.emenda.klocwork.KlocworkGatewayPublisher perform
[com.emenda.klocwork.KlocworkGatewayPublisher] - Performing Quality Gate
Feb 17, 2020 4:19:51 PM FINE com.emenda.klocwork.KlocworkGatewayPublisher perform
[com.emenda.klocwork.KlocworkGatewayPublisher] - Entered ci gateway
Feb 17, 2020 4:19:51 PM FINE com.emenda.klocwork.KlocworkGatewayPublisher perform
[com.emenda.klocwork.KlocworkGatewayPublisher] - [ name:No New Issues (Any Status), threshold:1, reportFile:kwreport.xml, stopBuild:false, enabledSeverities:com.emenda.klocwork.definitions.KlocworkSeverities@70526d38, enabledStatuses:com.emenda.klocwork.definitions.KlocworkStatuses@75869686, enableHTMLReporting:true ]
Feb 17, 2020 4:19:51 PM FINE com.emenda.klocwork.KlocworkGatewayPublisher perform
[com.emenda.klocwork.KlocworkGatewayPublisher] - exception thrown: Content is not allowed in prolog.

We are unable to reproduce it in other branches, anyone could give us some hint?

Major issue when Klocwork reporting is enabled, using Jenkins

Hi,

sorry if i do anything wrong, this is the first time i post an issue on github.

I'm using Klocwork Plugin v1.8.1 with Jenkins v1.476.
I can create a job with Klocwork reporting enabled, then run it. But if i restart Jenkins, the following error occurs.


This is a copy of the Jenkins issue https://issues.jenkins-ci.org/browse/JENKINS-14005


Any project with Klockwork reporting enabled can not be loaded after a restart of Jenkins ...

SEVERE: Failed Loading job libtemplate
java.lang.NullPointerException
at com.thalesgroup.hudson.plugins.klocwork.util.KloProjectReviewLink.setKloHostPort(KloProjectReviewLink.java:50)
at com.thalesgroup.hudson.plugins.klocwork.util.KloProjectReviewLink.(KloProjectReviewLink.java:46)
at com.thalesgroup.hudson.plugins.klocwork.KloPublisher.getProjectActions(KloPublisher.java:74)
at hudson.matrix.MatrixProject.createTransientActions(MatrixProject.java:365)
at hudson.model.AbstractProject.updateTransientActions(AbstractProject.java:624)
at hudson.model.AbstractProject.onLoad(AbstractProject.java:279)
at hudson.matrix.MatrixProject.onLoad(MatrixProject.java:404)
at hudson.model.Items.load(Items.java:115)
at jenkins.model.Jenkins$15.run(Jenkins.java:2447)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:146)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
at jenkins.model.Jenkins$6.runTask(Jenkins.java:840)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

klocworkQualityGateway pipeline step doesn't mark stage & step as unstable

Hi, I'm using klocworkQualityGateway pipeline step to mark the builds as unstable if a new issue is detected durin incremental analysis.

klocworkQualityGateway ([
    enableCiGateway: true,
    gatewayCiConfigs: [[
        enableHTMLReporting: true,
        enabledStatuses: [
            analyze: true,
            defer: true,
            filter: true,
            fix: true,
            fixInLaterRelease: true,
            fixInNextRelease: true,
            ignore: true,
            notAProblem: true
        ],
        failUnstable: true,
        name: 'No New Issues (Any Status)',
        reportFile: "kwreport.xml",
        threshold: '1'
    ]]
])

This is working as expected, quite well. But looks like it hasn't implement a new pipeline improvement about unstable status. The build is marked as unstable, but pipeline stage and step aren't marked as unstable as well.

https://jenkins.io/blog/2019/07/05/jenkins-pipeline-stage-result-visualization-improvements/

Would be really nice if the plugin can support new generation unstable flag.

Quality Gateway should fail step in pipeline?

Hi,
I'm using this plugin, version 2.3.5, with multi-branch pipelines on Jenkins.

I'm trying to collect the results and fail the build, but the plugin doesn't report failure on Quality Gateway step.
Actually, it is failing the build after the whole pipeline, but doesn't fail the step thus doesn't let the developer know which step failed.
My usage is based on the example documentation; should fail on at least 1 critical MISRA C rule:

`klocworkWrapper(installConfig: '-- none --', ltoken: '', serverConfig: 'server', serverProject: 'my_project') {
                klocworkIntegrationStep1([additionalOpts: '', buildSpec: 'kwinject.out', disableKwdeploy: true, ignoreCompileErrors: true, importConfig: '', incrementalAnalysis: true, tablesDir: 'kwtables'])
                klocworkIntegrationStep2([additionalOpts: '', buildName: '${GIT_COMMIT}-BUILD-${BUILD_ID}', tablesDir: 'kwtables'])
                klocworkQualityGateway([enableCiGateway: false, enableServerGateway: true, 
                    gatewayCiConfig: [reportFile: '', threshold: '1'], 
                    gatewayServerConfigs: [[conditionName: 'MISRA-C:2012 Compliance', jobResult: 'failure', query: 'severity:Critical,error taxonomy:"MISRA C 2012 with Amendment 1 (C99)"', threshold: '1']]
                    ])
            }

`

Is this the expected behavior? If so, can this be added as a feature request?

I'll appreciate the help,
Gregory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.