5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JenkinsとGerritの連携で"Label:Verified"が 無くて困った話

Posted at

Gerrit 2.8.1のVerifiedラベルについてのお話です。

JenkinsのGerrit-Triggerプラグインで、Verifiedラベルのアクセス権設定が必要ですが、Gerrit 2.7以降をクリーンインストールするとVerifiedラベルが無い、ということで調査しました。

Verifiedラベルは、以下の操作で追加できます。
詳細はGerrit Code Review - Review Labelsというドキュメントに記載があります。

git clone $host:All-Project.git

cd All-Projects.git 
vi project.config 
git commit -a -m "Add verified label" 
git push origin HEAD:refs/meta/config 

上記のAll-Projects.git/project.configは以下のように追記。

--- a/project.config
+++ b/project.config
@@ -56,3 +54,8 @@
        value =  0 No score
        value = +1 Looks good to me, but someone else must approve
        value = +2 Looks good to me, approved
+[label "Verified"]
+       function = MaxWithBlock
+       value = -1 Fails
+       value =  0 No score
+       value = +1 Verified

ちなみに、Gerritの最新コードでは、こんなcommitが入っています。(ソースコード詳細は追っていませんが、初期化時にVerifiedラベルを追加するかどうか選択できそうですね。)

おしまい。

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?