Repository配置

Review Board支持很多各种不同类型的源代码版本库,单个Review Board服务器可配置的版本库数量并没有限制,因此可以适用于大小不同的项目和公司。

版本库可以和主机服务连接,从而在不指定特定的路径的情况下就可以方便快速配置版本库。

添加版本库

在Database选项的Repository页,单击Add连接,可以打开新建版本库设置页,包括如下各设置栏:

  • General Information

  • Repository Hosting

  • Repository Information

  • Bug Tracker

  • Access Control

  • Advanced Settings

General Information

Name名称:版本库名称,在新建Review Request时需要必须选择,因此这个字段是必填的,可以是任何方便大家阅读理解的名称,如PS。

Show this repository:是否显示该版本库,如果不显示,则用户不会再Review Board或第三方应用程序中看到该版本库,一般用于不再使用的版本库。此字段信息可选。

Hosting service:版本库使用的源代码主机服务。Review Board提供一组支持的主机服务列表。

Account:主机服务使用的账号,选择指定新账号。

Account username:如果Account选择,此处填写新账号的用户名。

Account password:如果Account选择,此处填写新账号的密码。

Repository Information:版本库信息

版本库配置信息和主机服务选项有关,不同的选项需要填写的信息不同。

Repository type:版本库类型。

Repository Plan:The plan on the hosting service used for this repository, if needed. This may be used to specify a public vs. private repository, for example。这个只使用某些类型的主机服务。

Path:服务器上的版本库路径,Review Board服务器主机必须能访问该路径,路径和版本库类型有关。只有在hosting service中选择 (None - Custom Repository)时才会显示此选项设置。

Mirror Path :在查找过程中可用的可选版本库路径。通常用于版本库存在开发人员和匿名URL的情况。在查找文件时Review Board通常使用主路径。只有在hosting service中选择 (None - Custom Repository)时才会显示此选项设置。

Raw file URL mask (optional)

The raw file URL mask is a path to a raw file blob on a cgit or Gitweb server with special tags that will be substituted to build a real URL to a file in the repository. This field is needed when using Review Board with a remote Git repository.

For example:

Username和Password:有些版本库需要访问的用户名和密码,有些只需要用户名,而有些可以匿名访问。

例如,Subversion版本库,通常可以提供匿名访问,而CVS和Perforce通常需要用户名,但不需要密码。

版本库管理员需要知道什么是必须的,这和创建过程有关。

Bug Tracker

在大多数项目中,版本库一般都会和Bug跟踪系统集成,Review Request通常会和Bug有关。如果设置Bug Tracker,则Review Board会自动连接到Bug。

Use hosting service’s bug tracker (optional):如果选择,并且所选的hosting service有内建的Bug tracker,则版本库使用该Bug Tracker。如果没有选择,则Bug Tracker可以由下面方式指定。

Type (optional):指定的值必须是ticket的路径,除了%s代替ticket名。如:

如果版本库中的项目未使用Bug Tracker,此处可以空着不填。

Access Control

Repository访问可以限制为某些用户或者群组。

Publicly accessible

如果选择,则所有的用户都可以访问该版本库中的Review Request或文件,否则,这些版本库只能由给予访问权限的用户和群组所访问。默认情况此选项是选中的。

Users with access (optional)

如果版本库未公开访问,则只有此处列出的用户才有权限访问。

Review groups with access (optional)

如果版本库未公开访问,则只有此处列出的invite-only Review Group中的用户才能访问该版本库的Review Request。

Advanced Settings

Encoding (optional)

某些时候版本库中的文件可能会出现编码上的混乱,可以在此处设置正确的编码,如UTF-8。一般情况并不需要设置。

完成所有设置后,单击Save保存完成版本库的创建。

编辑和删除版本库

一旦版本库创建后,如果需要编辑,可打开该版本库设置页,更新各选项参数,单击页面的底部Delete可删除该版本库。

注意:删除版本库将删除该版本库相关的Review Request、reviews、diff和其他数据,因此一般是不应该删除版本库。

版本库信息

版本库的Path设置依赖于所配置的版本库类型。

ClearCase

Review Board在本地的动态视图中使用,通过利用版本扩展路径来访问特定的文件版本。

Path需要指向特定的VOB,必须是绝对路径,在Windows中以驱动盘开始,在Unix/Linux中以mount点开始。

Username和password必须为空。

注意:

当上传新的diff文件时,Review Board通过VOB的UUID进行比较,如果UUID不匹配,则post-review将使用VOB的名称作为版本库名称,因此,使用VOB的名称作为版本库的名称是不错的选择。

CVS

Review Board支持多种连接CVS服务器的类型,特别是下面这些连接类型:

  • :ext:
  • :fork:
  • :gserver:
  • :kgserver:
  • :local:
  • :pserver:
  • :server:

如果使用这些类型,并提供Path,那么就不需要填写Username和Password。

如果使用:pserver:,可以用格式hostname:port/path指定Path,然后在合适的字段中填写用户名和密码。其他有效的路径实例包括:

要查看已有checkout的路径,可以checkout在最顶层的目录中运行命令:

$ cat CVS/Root

应该使用此命令的输出作为版本库路径,根据实际情况调整用户名、密码和路径。

Git

In order to use Git with Review Board, you’ll need either a local clone on the server, or by using raw file URLs to a web front-end to Git (cgit, Gitweb, etc.) on the Git server. Git doesn’t have a way of fetching an individual file of a given revision from a remote server without having an entire clone, so it works differently from other repository types.

Local Clone

In order to work with Review Board, a local clone needs to be kept in sync regularly. It should either have direct access to a central Git server, or it needs to be updated on every commit to the central Git server.

The

Path field

should be the full path of the .git directory inside this checkout. For example: /var/git/projectname/.git

The

Mirror path field

should contain the repository URL. Find the URL you should use from within a git checkout by running the following:

$ git remote show origin

The value shown as URL: should be entered as the mirror path. For example: [email protected]:projectname.git

The

Username and Password fields

should be blank.

Raw File URLs

New in version 1.5.

Review Board can access a remote file by talking to a cgit or gitweb server. This is done by filling out the

Raw file URL mask

field to tell Review Board how to access a single file based on revision.

The URL can make use of the following tags, which will be replaced before attempting to fetch the file:

  • <revision>- The full SHA1 of the file blob.
  • <filename>- The unescaped path to the file.

cgit

For cgit, this path should be in the form of:

http://_servername_/browse/gtk+/plain/<filename>?id2=<revision&gt;

For example:

http://git.gnome.org/browse/gtk+/plain/<filename>?id2=<revision&gt;

Gitweb

For Gitweb:

http://_servername_/?p=_relative path to git repo_;a=blob_plain;f=<filename>;hb=<revision>

For example:

http://git.kernel.org/?p=bluetooth/bluez-gnome.git;a=blob_plain;f=<filename>;hb=<revision&gt;

Perforce

The Perforce path can be retrieved from an existing Perforce checkout by typing the following:

$ p4 info

Use the value from the Server address field.

In most setups, the

Username field

must be provided. This must be a user that has access to the whole repository. In some setups, this is a dedicated read-only user.

Note that Review Board will only ever use this user for read-only operations. It will never write to the repository.

Using Perforce with stunnel

New in version 1.6.

Perforce can be configured to operate with a secure stunnel setup. This is particularly important if the server running Review Board needs to talk to the Perforce server over the Internet or an otherwise easily accessible network.

To set up an stunnel connection on the Perforce server, see Perforce’s guide on Using Stunnel with Perforce.

Once the server is set up, ensure that stunnel version 3 (not 4) is installed on the server running Review Board and available in the web server’s PATH. You can then configure your repository settings so that Review Board can access the repository. To do this, just prefix your repository path with stunnel: and list the port that the stunnel server is running on. For example:

stunnel:perforce.example.com:2666

Review Board will automatically set up a local tunnel client as necessary. It will bind this to a port between 30000 and 60000 on localhost, and proxy all requests through it.

Subversion

Subversion路径可以从现有的SVN工作拷贝中获取,只需要输入命令:

Svn info

根据输出结果就可以获知该版本库的路径,也就是Repository Root的值。

在某些服务器创建时,SVN提供匿名访问,因此用户名和密码字段可以不需要填写。否则,就需要填写可以访问该版本库的用户名和密码。

在使用公共匿名URL和开发URL的SVN环境下(如使用https或svn+ssh),应该在Path字段填写公共URL,开发URL在Mirror path中填写。