Adding gerrit label, but not able to see it properly in review page

吃可爱长大的小学妹 提交于 2019-12-10 12:14:15

问题


Using gerrit 2.9. I am new to gerrit configuration and am trying to add a Verified label to the All-projects project so that the verified label is shown in the reviews for all projects. The relevant part of the project.config looks like this:

[label "Code-Review"]
    function = MaxWithBlock
    copyMinScore = true
    value = -2 This shall not be merged
    value = -1 I would prefer this is not merged as is
    value =  0 No score
    value = +1 Looks good to me, but someone else must approve
    value = +2 Looks good to me, approved
[label "Verified"]
    value = -1 Fails
    value =  0 No score
    value = +1 Verified

I run the following commands:

$ git commit -am "Add verified label"
$ git push -f origin meta/config:meta/config

Now, when I go and try to review a change-set, I see the needs verified line, but I don't see anywhere that I can place it. The screen looks like this:

There is no way for me to set verified on the review.

I had help from this question: Can't find 'Label Verified' permission in gerrit 2.7 but this did not solve the problem.


回答1:


The problem is that you don't have sufficient permissions to set the Verified label. In Gerrit, all change scoring must be explicitly allowed. If you don't have permissions to set a label, it won't even appear in the Publish view.

To grant users permission to set the Verified label, locate the project you want to affect (or, perhaps more likely, the special All Projects project to have it apply everywhere). On the Access tab, choose Edit. Under refs/heads/*, add a "Label Verified" permission and assign a suitable group. If there's no refs/heads/* reference in the list, add it.



来源:https://stackoverflow.com/questions/25478344/adding-gerrit-label-but-not-able-to-see-it-properly-in-review-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!