简体   繁体   English

未在“代码审查” gerrit类别中评分

[英]Scoring in Code-Review gerrit category is not happening

I have configured Sonar gerrit jenkins plugin which is initiated by gerrit trigger plugin through gerrit rest APIs. 我已经配置了Sonar gerrit jenkins插件,该插件由gerrit触发器插件通过gerrit rest API启动。 https://wiki.jenkins-ci.org/display/JENKINS/Sonar+Gerrit https://wiki.jenkins-ci.org/display/JENKINS/Sonar+Gerrit

I followed all the instructions mentioned and it working fine. 我按照提到的所有说明进行了工作。

There is only one glitch ie the scoring for category "Code review" for my non interactive use is not happening. 只有一个小故障,即我非交互使用的“代码审查”类别的评分没有发生。 ie the history of patch sets is saying that the user has scored for code review but under the code review category at the top right corner there is not entry for code review category. 也就是说,补丁集的历史表明用户已经对代码审查类别进行评分,但是在右上角的代码审查类别下没有代码审查类别的条目。

May be not specific to sonar gerrit but a gerrit expert can help me here. 也许不是特定于声纳Gerrit,但Gerrit专家可以在这里为我提供帮助。

I hope i was able to explain the problem. 我希望我能解释这个问题。

cheers, 干杯,

Saurav Saurav

I have solved this problem by adding a category in the project.config of gerrit project. 我已经通过在gerrit项目的project.config中添加类别来解决了这个问题。 Please check below. 请在下面检查。 The values you can change according to your need. 您可以根据需要更改值。

label "Sonar-Verified"]
    branch = refs/heads/*
    function = MaxWithBlock
    value = -2 Fails
    value = -1
    value =  0 No score
    value = +1 Verified
    defaultValue = 0

Regards, 问候,

Saurav Saurav

Code-Review category is used by Sonar-Gerrit plugin by default, so it can override/be overridden by score given by other users or Gerrit Trigger. 默认情况下,Sonar-Gerrit插件使用Code-Review类别,因此它可以被其他用户或Gerrit Trigger给出的分数覆盖/覆盖。 It is strongly recommended to configure a separate label in Gerrit. 强烈建议在Gerrit中配置一个单独的标签。

[label "Sonar-Verified"]
    function = MaxWithBlock
    value = -1 Issues found
    value =  0 No score
    value = +1 Verified
    defaultValue = 0

Don't forget to set up access rights: 不要忘记设置访问权限:

[access "refs/heads/*"]
    label-Sonar-Verified = -1..+1 group Non-Interactive Users

When the specific for the plugin label is configured, it is possible to use it in Sonar-Gerrit plugin settings. 配置插件标签的专用标签后,可以在Sonar-Gerrit插件设置中使用它。

See Plugin Wiki Gerrit Settings section for more details. 有关更多详细信息,请参见插件Wiki Gerrit设置部分。

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

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