DXM
DXM

Reputation: 4543

Integrating Gitlab with ReviewBoard - File Blob vs. Commit SHA1

I'm trying to integrate Gitlab server that our company has been using with a new ReviewBoard server. From everything I've read about ReviewBoard setup, the most straightforward way to integrate git-like repositories is to use "Raw file URL mask" field if the repository has a web front end.

Luckily, Gitlab, appears to support such a front end and even has a well documented public API: https:///api/v2/projects//repository/commits//blob?private_token=&filepath=

In ReviewBoard's repository setup, one can specify a custom URL that could be used to retrieve individual files from the git server. This URL has two placeholders:

Unfortunately, I have learned that Gitlab's API expects SHA1 of the commit, not of the individual file and ReviewBoard as far as I can tell only sends SHA1 of the individual file but not of the commit

  1. Has anyone successfully integrated Gitlab with ReviewBoard? If so, I'd be interested in hearing about it
  2. Is anyone aware of another, possibly undocumented, API call that Gitlab supports that would allow us to retrieve files based on SHA1 of the file blob?
  3. Is anyone aware of a setting in ReviewBoard to force it to pass in SHA1 of the commit instead of the file blob?

Upvotes: 9

Views: 5146

Answers (2)

Sytse Sijbrandij
Sytse Sijbrandij

Reputation: 1905

Reviewboard 1.7.21 includes support for GitLab http://www.reviewboard.org/news/2014/01/14/review-board-1-7-21-released/

Upvotes: 5

DXM
DXM

Reputation: 4543

I started a discussion on reviewboard google group about this. It appears that being able to retrieve a file by its own SHA1 is something that many Git web front-ends were missing before but now are adding in. Unfortunately, Gitlab is behind on this feature, so they simply don't have it (yet?) but others do.

The solution we found was to install Gitweb alongside Gitlab on the same host machine. Then we simply pointed Review Board to use Gitweb API while our developers continue to use Gitlab.

One important thing to note. Review Board documentation (at least for version 1.6) has a typo in the example Raw file URL mask value for gitweb. This is the correct URL format:

http://servername/?p=relative path to git repo;a=blob_plain;f=<filename>;h=<revision>

In their documentation, last parameter's name is hb but it should be h

Upvotes: 4

Related Questions