Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • {filename} - file path
  • {revision} - sha1 of the file blob

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?
like image 809
DXM Avatar asked Nov 20 '12 21:11

DXM


2 Answers

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

like image 98
Sytse Sijbrandij Avatar answered Nov 19 '22 12:11

Sytse Sijbrandij


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

like image 38
DXM Avatar answered Nov 19 '22 10:11

DXM