Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Phabricator Introduce

January 20, 2016

Phabricator Introduce


January 20, 2016

More Decks by halfrost

Other Decks in Programming


  1. Code review - Phabricator introduce YuDeZhi 2016.01.20

  2. Agenda Phabricator Summary pre-push code review tool —— Differential code

    repository browse tool — Diffusion post-push code review tool —— Audit Other Feature Summary Final
  3. Phabricator Summary 今天我要向⼤家推荐⼀款⾮常棒的代码检视⼯具Phabricator。 Phabricator是Facebook保驾护航的11⼤IT技术之⼀。在 Phabricator的⽹站中,开发者给出了这样的描述:“Facebook的 ⼯程师们毫不掩饰⾃⼰对于Phabricator的喜爱之情,他们甚⾄将它 视为’顺利’与’严谨’的代名词”。下⾯我就将演示使⽤Phabricator进 ⾏代码检视的流程以及它的亮点 https:/ /secure.phabricator.com/book/phabricator/

    article/introduction/ 1
  4. Phabricator

  5. Differential Differential是Phabricator核⼼功能之⼀,他是开 发者相互检视代码,互相讨论代码的主要平台。 ⾸先我先假设系统中除了系统管理员账户之外,还有其 他4个普通⽤户,他们分别是qj447,huangwei, eric.shao,autumnyuhe。他们都参与到⼀个 ios_union_cashier的项⽬中。 2

  6. Arcanist Tool 此处⽣成diff需要⽤到Phabricator命令⾏⼯具 Arcanist,该⼯具是FB开发的,暂时还没有图形化 的⼯具 推荐⼀个很好的学习教程http:/ /sezina.github.io/blog/ 2013/07/16/phabricatorming-ling-xing-gong-ju- arcanistde-ji-ben-yong-fa/

  7. Let’s do it git commit - (arc diff - accept)-

    pull - (arc diff - accept) -push
  8. DownLoad Tool

  9. Edit Path

  10. install certificate

  11. install certificate

  12. creat diff

  13. edit diff info

  14. generate diff

  15. pre-push code review

  16. pre-push code review

  17. pre-push code review

  18. pre-push code review

  19. pre-push code review

  20. complete code review

  21. Diffusion Phabricator提供⼀个类似于gitlab之类的 远程仓库浏览⼯具diffusion,开发⼈员可 以快速查看以下信息 3

  22. VCS Repertory information

  23. VCS commit history

  24. Repertory directory structure

  25. directory structure & commit information

  26. Branches information

  27. Audit 我们有了Differential,那么现在为何还需 要⼀个Audit ? 4

  28. Review vs Audit Phabricator supports two similar but separate code

    review workflows: Differential is used for pre-push code review, called "reviews" elsewhere in the documentation. You can learn more in Differential User Guide. Audit is used for post-push code reviews, called "audits" elsewhere in the documentation. You can learn more in Audit User Guide. (By "pre-push", this document means review which blocks deployment of changes, while "post-push" means review which happens after changes are deployed or en route to deployment.) Both are lightweight, asynchronous web-based workflows where reviewers/ auditors inspect code independently, from their own machines -- not synchronous review sessions where authors and reviewers meet in person to discuss changes.
  29. Briefly Differential是代码提交VCS仓库前的代码 检视⼯具,但是有些情况下我们的代码由于 某些情况来不及做⾮常细致的pre- commit review,需要提前部署。那么有 什么办法在在代码提交VCS之后来进⾏代码 检视,保证我们的代码质量呢?答案是 Audit。这就是Audit的职责。

  30. How Audit work ? audit request trigger Audit tool primarily

    keeps track of two things: Commits and their audit state (like "Not Audited", "Approved", or "Concern Raised"). Audit Requests which ask a user (or some other entity) to audit a commit. These can be triggered in a number of ways (see below).
  31. audit homepage

  32. audit & commit Required Audits are open audit requests that

    require you, a project you are a member of, or a package you own to audit a commit. An audit request is closed when you approve the associated commit. Problem Commits are commits you authored which someone has raised a concern about in audit. Problem commits go away when you satisfy all the auditors and get them to "Approve" the commit.
  33. Audit Triggers Audit requests can be triggered in a number

    of ways: If you put Auditors: username1, username2 in your commit message, it will trigger an audit request to those users when you push it to a tracked branch. You can create rules in Herald that trigger audits based on properties of the commit -- like the files it touches, the text of the change, the author, etc. You can create an audit request for yourself by commenting on any commit. You can create an Owners package and select "Enable Auditing" (this is an advanced feature which is only likely to be useful for very large teams).
  34. Audit Tips When viewing a commit, audit requests you are

    responsible for are highlighted. You are responsible for a request if it's a user request and you're that user, or if it's a project request and you're a member of the project, or if it's a package request and you're a package owner. Any action you take will update the state of all the requests you're responsible for. You can leave inline comments by clicking the line numbers in the diff. You can leave a comment across multiple lines by dragging across the line numbers. Inline comments are initially saved as drafts. They are not submitted until you submit a comment at the bottom of the page. Press "?" to view keyboard shortcuts.
  35. Raise Concern

  36. add comment

  37. Other Feature Summary Maniphest:任务管理和缺陷追踪(霸道?) CountDown:定时提醒⼯具 Repository:远程VCS仓库管理 Herald Rule:创建⾃定义规则,当某些事 件触发了规则时提醒我们(IFTTT?) 5

  38. Advantage of Phabricator phabricator 中也是通过提交request来展示diff做reivew.但是他的diff 不是⽂件的全部内容,只是diff的部分,所以不需要事先在⼯具⾥添加库,可 以直接提交diff,也可以粘贴diff的内容来提交。 不光只有代码review⼯具,还有bug跟踪,wiki等功能。可以直接做单元测 试,bug与代码review的关联。 按request状态分类清晰,搜索功能好⽤。

    ⽀持svn 和 git。 所有检视⼯作只需要⼀个浏览器,不需要安装额外的插/软件。 操作界⾯和易⽤性⾮常棒。可⾃定义界⾯布局和主题,更加时尚和有活⼒
  39. Q & A

  40. –Grady Booch,One of the UML founders “The function of good

    software is to make the complex appear to be simple”
  41. Thank you !