本文介绍了手动Gerrit审核cmd并未更新“已验证"邮件,标签值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试为CI框架设置jenkins和gerrit,gerrit可以触发Jenkins构建,但是在构建成功后无法更新gerrit的验证标签,因此我尝试使用手动命令,仍然无法通过以下ssh更新gerrit验证的标签字段jenkins服务器上的命令,但可以更新代码审查标签.

we are trying to setup jenkins and gerrit for CI framework, gerrit can trigger Jenkins build, but can not update gerrit's verified label after build success, so i tried with manual command, still failed to update gerrit verified label field via following ssh command on jenkins server, but can update code-review label.

    ssh -p 29418 [email protected] gerrit review -p HiCloud/myProject --label Verified=1 --code-review +1 27263,1

1.设置:

格里特:2.8.1詹金斯:2.60格里特触发器:2.27

gerrit:2.8.1 Jenkins: 2.60 gerrit trigger:2.27

  1. 更改语言:

2.1更新myProject的project.config以启用经过验证的标签.

2.1 update myProject's project.config to enable verified label.

    [label "Verified"]
    function = MaxWithBlock
    value = -1 Fails
    value =  0 No score
    value = +1 Verified

2.2将gfkfcmo添加为Jenkins非交互用户,在myProject访问中添加权限: 参考:refs/* 阅读:允许非交互用户使用

2.2 adding gfkfcmo as Jenkins non-interactive user, add permission in myProject access: Reference: refs/* Read: ALLOW for Non-Interactive Users

    Reference: refs/heads/*
    Label Code-Review: -1, +1 for Non-Interactive Users
    Label Verified: -1, +1 for Non-Interactive Users
  1. 詹金斯的改变.
    3.1添加gerrit服务器信息,因此jenkins上的手动触发Gerrit事件"效果很好.
    3.2 Gerrit的注释添加还可以触发Jenkins的工作机会,因此conn可以很好地工作.

  1. Jenkins change.
    3.1 add gerrit server info, so "Trigger a Gerrit event manually" on jenkins works well.
    3.2 Gerrit's comment add can also trigger Jenkins job build, so the conn works well.

但是构建结果未发布回gerrit,因此在jenkins服务器上使用上述SSH命令,我可以使用用户gfkfcmo更新代码审查",但对已验证"标签无效,请参见图片在下面.

But build result was not posted back to gerrit, so using above SSH command on jenkins server, I can update "code-review" with user gfkfcmo, but did not take effect on "verified" label, see picture below.

我搜索了这个主题,但没有得到任何提示或答案.任何提示将不胜感激.

I searched on this topic but did not get any hint or answers. Any hint will be highly appreciated.

更新了屏幕

使用已测试"标签更新屏幕

推荐答案

我认为,只有在所有项目"根项目中定义了已验证"标签时,-verified +1"选项才可用.在您的情况下,您需要使用"--label Label-Name = N"选项:

I think the "--verified +1" option is only available if the "Verified" label is defined in the "All-Projects" root project. In your case you need to use the "--label Label-Name=N" option:

ssh -p 29418 [email protected] gerrit review -p HiCloud/myProject --label Verified=+1 --code-review +1 27263,1

这篇关于手动Gerrit审核cmd并未更新“已验证"邮件,标签值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 19:18