简体   繁体   English

Gerrit to Sonar Plugin忽略了noIssuesScore

[英]Gerrit to Sonar Plugin ignores noIssuesScore

In our build (Jenkins Pipeline Script), the Sonar Gerrit Plugin should just add a review when there are issues. 在我们的构建(Jenkins Pipeline脚本)中, Sonar Gerrit插件应该只在出现问题时添加评论。 Otherwise it should just add the comment, but skip the score: 否则,它应该只添加评论,但跳过分数:

sonarToGerrit(
    sonarURL: env.'SONAR_HOST_URL',
    severity: 'INFO',
    postScore: true,
    category: 'Code-Review',
    issuesScore: '-1',
    noIssuesScore: '0'
)

But it seems the noIssuesScore is ignored. 但是似乎noIssuesScore被忽略了。 It always posts +1 when there are no violations. 没有违规时,它总是发布+1

We use the most recent release 2.1 with the latest Jenkins lts version 2.89.2 . 我们使用最新的2.1版本以及最新的Jenkins 2.89.2版本。

Thanks in advance for any help! 在此先感谢您的帮助!

PS: The Pipeline Syntax generator seems to be broken, too. PS: 管道语法生成器似乎也已损坏。 It always just prints step <object of type org.jenkinsci.plugins.sonargerrit.SonarToGerritPublisher> 它总是只打印step <object of type org.jenkinsci.plugins.sonargerrit.SonarToGerritPublisher>

please check out the new version 2.2, it contains fixes for the problems you've mentioned. 请查看新版本2.2,其中包含针对您提到的问题的修复程序。 The problem is related to API change in version 2.1 该问题与版本2.1中的API更改有关

If you unable to update the plugin at the moment, you can fix the problem by updating your code as follows: 如果目前无法更新插件,则可以通过如下更新代码来解决问题:

sonarToGerrit (
        sonarURL: env.'SONAR_HOST_URL',
        scoreConfig: [ 
            issueFilterConfig: [
                severity: 'INFO', 
                newIssuesOnly: false, 
                changedLinesOnly: false
                ], 
            category: 'Code-Review', 
            noIssuesScore: 0,
            issuesScore: -1
        ]
    )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM