Gerrit Code Review Setup

There are three roles in the Gerrit Code Review system. 

Project Owner – Repository Owner

Change Owner – developers who can submit changes

Reviewers – who reviews changes

1. For Project Owner, he/she needs to configure the project access permission.

On the Gerrit Web Page, click 'Projects' -> 'Access' -> 'Edit' , then you can modify the project access permission. You can add reviewer and submitter.

And for project owner, he/she should setup .gitreview file for the repository

>git clone your_git_repository

>cd your_git_repository_folder

>vi .gitreview

add following contents:

[gerrit]
host=your_gerrit_server
port=your_gerrit_server_port
project=your_project
defaultbranch=master

>git add .gitreview 

>git commit

>git push origin master

2. For Change Owner, he/she can modify code, then commit , then start review

But before these operation, change owner need install git-review by apt system. And add gerrit as remote ref.

>sudo apt install git-review

>git clone your_git_repository

>git remote add gerrit your_git_repository

after you modify your file.

>git add your_modify_file

>git commit -m "your comments"

>git review

 Then on the Gerrit Web Page, change owner can find the change(commit) on 'My' -> 'Changes' -> 'Outgoing reviews'.

Click the change , then change owner can choose reviewers.

After choose reviewers, change owner just need wait for the 'submit' button show up. When will it show up? After at least one reviewer score +2 to this change.

After the 'submit' button show up, change owner can click it to finally push the change to GIT repository.

3. For reviewers, he/she will find the change on 'My' -> 'Changes' -> 'Incoming reviews'.

Click the change, then reviewer can review the diff of this change. After review, reviewer needs to click 'reply' to input comments and score the change.

After click 'Post' button, reviewer finishes his/her job. Remember, change needs at least one +2 score to show 'submit' button on change owner web page.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值