3429: rbt post does not work with CVS when commiting from remote server (locally it works)

determ******@gmai***** (Google Code) (Is this you? Claim this profile.)
What version are you running?
Review Board 2.0.2
RBTools 0.6

What's the URL of the page containing the problem?
n/a

What steps will reproduce the problem?
1. Install Review Board 2.0.2 on dedicated server A
2. Install CVS 1.12.13 on dedicated server B
3. Install RBTools 0.6 on server B
4. Add CVS hook on post commit (in script loginfo on server B)
5. Checkout a project on server B, make a change in a file, commit it --> rbt post works as expected and request is created
6. Checkout a project on remote server C, make a change in a file, commit it --> file is commited but rbt post reports an error and no review request is created

What is the expected output? What do you see instead?
the error displayed is:
-----------------
>>> RBTools 0.6
>>> Python 2.7.6 (default, Mar 22 2014, 22:59:38) 
[GCC 4.8.2]
>>> Running on Linux-3.13.0-24-generic-i686-with-Ubuntu-14.04-trusty
>>> Home = /root
>>> Current directory = /var/tmp/cvs-serv9906
>>> Checking for a CVS repository...
ERROR: The provided repository type was not detected in the current directory.
-----------------

What operating system are you using? What browser?
CVS server and RBtools are on Ubuntu 14.04 LTS (GNU/Linux 3.13.0-24-generic i686) (server A above)
ReviewBoard server is on Ubuntu 12.04.4 LTS (GNU/Linux 3.11.0-15-generic x86_64) (server B above)
Remote CVS is on AIX Version 7.1 (server C above) and CVS version on C is 1.11.23

Please provide any additional information below.

I've noticed the following function cannot return info and is the root of the problem:
-----------------
    def get_repository_info(self):
        if not check_install(['cvs']):
            logging.debug('Unable to execute "cvs": skipping CVS')
            return None

        cvsroot_path = os.path.join("CVS", "Root")

        if not os.path.exists(cvsroot_path):
            return None

        fp = open(cvsroot_path, "r")
        repository_path = fp.read().strip()
        fp.close()

        i = repository_path.find("@")
        if i != -1:
            repository_path = repository_path[i + 1:]

        i = repository_path.rfind(":")
        if i != -1:
            host = repository_path[:i]
            try:
                canon = socket.getfqdn(host)
                repository_path = repository_path.replace('%s:' % host,
                                                          '%s:' % canon)
            except socket.error, msg:
                logging.error("failed to get fqdn for %s, msg=%s"
                              % (host, msg))

        return RepositoryInfo(path=repository_path)
-----------------
because when a remote commit is done from server C, the CVS on server B (where RBtools are installed) uses a temporary directory (something like '/var/tmp/cvs-serv9906') instead of a normal directory with checked-out project like in step 5.

In the CVS hook I have the following call (some variables are precalculated as $USER but they are not relevant here):

rbt post --debug --submit-as $USER --target-groups Reviewers_G1 --disable-proxy --server $REVIEWBOARD_URL --re
pository $REPOSITORY --username service_user --password some_password --markdown --summary "$SUMMARY" --description "$DESC
" $FILE_VER
#1 determ******@gmai***** (Google Code) (Is this you? Claim this profile.)
More info:
the function tries to read CVS/Root and it's de facto the value of $CVSROOT stored there:
/my_cvs/cvs/repo/
Is there any way to specify to rbt post this path in the hook and not to count it will detects it itself as it seems in the temp directory '/var/tmp/cvs-serv9906' there is nothing like CVS/Root (but as it's temp I cannot check it) ?
david
#2 david
  • -reviewboard
    +rbtools