You can control all Gerrit Code Review features directly from TeamForge by specifying a code review policy as part of the TeamForge Git repository's description field.

For more information on Gerrit Code Review, see the Gerrit documentation.

By default, the following code review policy options are provided:

  • Default (no code review): All Gerrit review features are turned off and read/write access is enforced.
  • Mandatory review: All code changes must be reviewed and read/write access is enforced.
  • Optional review: The review feature is turned on but can be bypassed if necessary; read/write access is enforced.
  • Custom: Access rights must be set manually in the Gerrit web interface; they will not be overridden by TeamForge. This specification is intended for advanced users who are familiar with Gerrit access rights and want to turn off “auto pilot”.

If you have access to the TeamForgeGerritMappings.xml file, you can add your own categories.

The following animation illustrates the detailed mapping between SCM permissions, repository policies, and Gerrit access rights.

Mapping between SCM permissions, repository policies, and Gerrit access rights

Mandatory Code Reviews for Git Repositories

When a mandatory review is specified, every change pushed to the repository must pass through a review process before it can get committed (merged) to the repository.

Here’s a list of permissions and what users with these permissions can do:

  • No access: Users with no permissions cannot do anything.
  • View only: Users with read permissions can read branches and push for reviews, and have -1 and +1 for reviews.
  • Commit/View: Users with commit permissions can do everything read permissions would grant and in addition have -2, +2 for reviews. They can verify and submit permissions but have no right to bypass reviews.
  • Delete/View: Users with delete permissions can do everything commit permissions would grant.
  • Source Code Admin: Users with admin permissions can do everything delete permissions would grant and in addition push to and create any branch (bypassing review). They can rewrite history, forge the identity of the Gerrit server, and have the right to push tags, the right to upload merges, and the right to fine tune access rights in Gerrit for the Gerrit project involved.

Optional Code Review for Git Repositories

When an optional review is specified, every change submitted to the repository can be pushed for code review or directly pushed to the repository bypassing review. This depends on the TeamForge user having the appropriate permissions — source code Delete/View or Commit/View permission for the former, or Source Code Admin permission for the latter.

Here’s a list of permissions and what users with these permissions can do:

  • No access: Users with no permissions cannot do anything.
  • View only: Users with read permissions can read branches and push for reviews, and have -1 and +1 for reviews.
  • Commit/View: Users with commit permissions can do everything read permissions would grant and in addition have -2, +2 for reviews. They can verify and submit permissions, push to/create any branch (bypassing review) and push tags.
  • Delete/View: Users with delete permissions can do everything commit permissions would grant and in addition, have the right to rewrite history, upload merges and forge identity.
  • Source Code Admin: Users with admin permissions can do everything delete permissions would grant and in addition push to/create any branch (bypassing review). They can rewrite history, forge the identity of the Git server, and have the right to push tags, the right to upload merges, and the right to fine tune access rights in Git for the Git project involved.

Default Code Review for Git Repositories

In TeamForge 8.0 and later, the Default - no review policy-—no code review required–is selected unless you choose some other policy.

Here’s a list of permissions and what users with these permissions can do:

  • No access: Users with no permissions cannot do anything.
  • View only: Users with read permissions can only read branches.
  • Commit/View: Users with commit permissions can do everything read permissions would grant and in addition, push to/create any branch and push tags.
  • Delete/View: Users with delete permissions can do everything commit permissions would grant and in addition, have the right to rewrite history, upload merges and forge identity.
  • Source Code Admin: Users with admin permissions can do everything delete permissions would grant. In addition, they can forge the identity of the Gerrit server, and have the right to fine tune access rights in Git for the Git project involved.

Custom Code Review for Git Repositories

When a custom code review is specified, users with the TeamForge Source Code Admin permission can directly fine tune permissions (access rights) in gerrit’s web interface. Those changes will not be overridden by TeamForge.

For information on manually defining access rights in the Gerrit web interface, see Update Git repository access permissions in Gerrit.

Here’s a list of permissions and what users with these permissions can do:

  • No access: Users with no permissions cannot do anything.
  • View only: Users with read permissions cannot do anything unless added in Gerrit.
  • Commit/View: Users with commit permissions cannot do anything unless added in Gerrit.
  • Delete/View: Users with delete permissions cannot do anything unless added in Gerrit.
  • Source Code Admin: Users with admin permissions have the right to fine tune access rights in Gerrit for the Gerrit project involved.

Pull Request Reviews for Git Repositories

Pull requests allow developers to collaborate with each other on a code change before merging it into another branch on a Git repository. Using a pull request, you notify others about a feature or fix change that needs attention.

For more information about pull requests, see Pull Request.

User Defined Reviews for Git Repositories

Users can define their own code review policy.