使用Phabricator做CodeReview的介绍

上传人:woxinch****an2018 文档编号:42918662 上传时间:2018-06-04 格式:DOCX 页数:10 大小:31.67KB
返回 下载 相关 举报
使用Phabricator做CodeReview的介绍_第1页
第1页 / 共10页
使用Phabricator做CodeReview的介绍_第2页
第2页 / 共10页
使用Phabricator做CodeReview的介绍_第3页
第3页 / 共10页
使用Phabricator做CodeReview的介绍_第4页
第4页 / 共10页
使用Phabricator做CodeReview的介绍_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《使用Phabricator做CodeReview的介绍》由会员分享,可在线阅读,更多相关《使用Phabricator做CodeReview的介绍(10页珍藏版)》请在金锄头文库上搜索。

1、使用 Phabricator 做 Code Review 的介绍Haiyong Lei1Phabricator 的安装 1.1下载 Phabricator在安装目录/opt/codereview 下运行:git clone https:/ clone https:/ clone https:/ ./phabricator/scripts/install/install_ubuntu.sh1.2配置 storage在安装目录/opt/codereview/phabricator 下运行sudo ./bin/config set mysql.host localhost/ mysql 主机地址su

2、do ./bin/config set mysql.user root/ mysql 用户名sudo ./bin/config set mysql.pass 123456/ mysql 用户密码sudo ./bin/storage upgrade若从本机登入 MySQL 遇到 Access denied for user rootlocalhost问题,运行:mysql -u root -p -h 127.0.0.1进入 MySQL shell 后,输入:GRANT ALL PRIVILEGES ON *.* TO root% WITH GRANT OPTION;1.3配置 Apache2 1

3、.3.1site 配置文件:新建/etc/apache2/sites-available/phabircator 文件:# Change this to the domain which points to your host.ServerName localhost# Change this to the path where you put phabricator when you checked it# out from GitHub when following the Installation Guide.# Make sure you include “/webroot“ at t

4、he end!DocumentRoot /opt/codereview/phabricator/webrootRewriteEngine onRewriteRule /rsrc/(.*) - L,QSARewriteRule /favicon.ico - L,QSARewriteRule (.*)$ /index.php?_path_=$1 B,L,QSA#Require all granted /手册里有这一行,删除1.3.2可选,修改/etc/apache2/http.conf:添加一行:ServerName localhost1.3.3运行 apache2:sudo a2dissite

5、defaultsudo a2ensite phabricatorsudo /etc/init.d/apache2 restart1.4用浏览器测试用浏览器打开 http:/192.168.xxx.xxx/测试,可以看到 admin 用户注册界面,注册一个 admin用户用以完成后续设置。注意不要在浏览器地址栏输入 localhost 测试,Phabricator 不支持后一地址。1.5Post-install 设置a)Set Base Uri:sudo ./bin/config set phabricator.base-uri http:/192.168.xxx.xxx/b)Set Repo

6、Dir:sudo mkdir -p /var/reposudo chmod a+w /var/repoc)Start Phd Daemon:sudo ./bin/phd start注:每次修改 Phabricator 配置,都会要求重启 Phd。sudo ./bin/phd restartStop Phd:sudo ./bin/phd stopd)Pygmentize:sudo apt-get install python-pygmentse)登入 Phabricator:登入 admin 用户后,根据 Phabricator 给出的提示,fix 其余 setup issues。f)Add A

7、uth Provider:登入 admin 用户后,在 Auth Auth Provides 菜单下,点击 Add Provider 按钮, 启用“Username/Password“模块,否则外部无法访问 Phabricator。2配置 Diffusion 模块在 Config Applications Configuration 菜单下,修改 Diffusion 选项:(暂无修改)3配置 Differential 模块在 Config Applications Configuration 菜单下,修改 Differential 选项:require-test-plan-field/ 是否检

8、查有无 Test Plan,设为 false。allow-reopen/ 允许重开allow-self-accept/ 允许 patch owner 自我批准4添加代码库在 Diffusion 里可添加外部 git/svn/hg 代码库。代码库同步功能需要 Phd 服务运行:sudo ./bin/phd start注:code review 是 Differential 的功能,不依赖与 Diffusion 的代码库。代码库添加成功后,Phabricator 需要几分钟时间同步,完成后可以直接浏览代码库内容。代码库host 在 Phabricator 里,暂未研究。5arc 安装和使用 5.1

9、ubuntu 下安装:安装 PHP5:sudo apt-get install php5安装 svn 或 git:sudo apt-get install subversionsudo apt-get install git下载 arc 到本地:git clone https:/ clone https:/ arc 的 path:PATH=$PATH:/opt/codereview/arcanist/binexport PATH5.2windows 下安装:安装 TortoiseSVN 或 GitForWindows:http:/ TortoiseSVN要装command line tools

10、选装项。安装 PHP5 for Windows:http:/ arc 到本地:git clone https:/ clone https:/ PATH 环境变量使得 php5、arc 和 svn 能从命令行访问;设置 EDITOR 环境变量指向偏爱的编辑器,比如 notepad.exe。5.3验证安装:运行 arc help 确认无误。5.4arc 基本命令:arc install-certificate/ 配置 tokenarc diff/ 提交 patch 到 Phabricatior,得到 Revision IDarc diff -update Dnnn/ 提交修改后的 patch, D

11、nnn 是 Revision IDarc commit/ 合入 patch 到 SVN 并关闭 Phabricatior 上的arc close-revision Dnnn/ 关闭 Phabricatior 上这个 patch 对应的 Revision IDarc list/ 列出本地 working Revision ID6Review 流程、本流程参考自 FreeBSD.org 的 Code Review 流程。6.1Setup a)创建帐号浏览器中打开 Phabricator,按提示创建一个普通用户帐号,等 admin 审批通过后即可使用。b)安装 token:arc install-c

12、ertificate 输入后,arc 将会提示:C:UsersHaiyongarc install-certificate http:/192.168.68.135Trying to connect to server.LOGIN TO PHABRICATOROpen this page in your browser and login to Phabricator if necessary:http:/192.168.68.135/conduit/login/Then paste the API Token on that page below.Paste API Token from t

13、hat page: cli-hv44cg7bi7jthlbfsazemfi7xqenWriting /.arcrc.SUCCESS! API Token installed.用创建的账号登入 Phabricator, 打开提示中给出 http:/conduit/login/页面,拷贝其中 token 到命令行即可。c)设置默认服务器地址arc set-config default 6.2Review 流程本流程参考自 FreeBSD.org 的 Code Review 流程。图:Review 流程第一步,提交你的第一步,提交你的 patch:完成本地修改之后,提交你的 patch 到 Phab

14、ricator,命令如下:arc diff注:提交到Phabricator而非svn代码库,此时svn代码库不受任何影响。类似 svn commit 命令,arc diff 会打开指定编辑器,要求你输入 comment:RejectAccept修改提交arc diff -createarc diff -update通知准备本地代码Review合入svn commit关闭arc close-revision close-revisionSummary:Test Plan:Reviewers:Subscribers:# NEW DIFFERENTIAL REVISION# Describe the

15、 changes in this new revision.忽略#开头的行:开头开头: 本次修改的详细描述,必填,可以换行(从第一行到 Summary 行) 。Summary: 本次修改的简短描述,必填。Test Plan: 留空,不填。Reviewers: Reviewer 的账号,可填多个。可以不填,之后打开 Phabricator 补上。Subscribers: 订阅者的账号,可选。如果成功,arc 会给出本次提交的 Revision ID 用于后续引用。Revision ID 以 D+数字的形似表示,如:D1234。Created a new Differential revision:Revision URI: http:/192.168

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 学术论文 > 其它学术论文

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号