677: CVSClient in post-review is particularly fragile with respect to qualified domains

skip.mo*******@gmai***** (Google Code) (Is this you? Claim this profile.)
Oct. 7, 2008
What's the URL of the page containing the problem?

(internal to our corporate intranet)

What steps will reproduce the problem?
1. Run post-review
2.
3.

What is the expected output? What do you see instead?

I sort of expected post-review to 

What operating system are you using? What browser?


Please provide any additional information below.
#1 skip.mo*******@gmai***** (Google Code) (Is this you? Claim this profile.)
Damn...  slip of the pinky...  I hit the return key instead of the '
key while typing the summary so of course Firefox (un)helpfully
submitted the form for me.

At any rate, when I run post-review I get this error:

    Error creating review request: The repository path specified is
    not in the list of known repositories (code 206)

I added a debug() call to RepositoryInfo.__init__ and get this output when running
with the -d flag:

    >>> Repository info 'Path: cvs.trdlnk.com:/cvs, Base path: None, Supports
changesets: False'
    >>> cvs diff -uN
    >>> Looking for 'udesktop116.wacker.trdlnk.com /' cookie in
/home/titan/skipm/.post-review-cookies.txt
    >>> Loaded valid cookie -- no login required
    >>> Attempting to create review request for None
    >>> HTTP POSTing to
http://udesktop116.wacker.trdlnk.com:8000/api/json/reviewrequests/new/:
{'repository_path': 'cvs.trdlnk.com:/cvs'}
    Error creating review request: The repository path specified is not in the list
of known repositories (code 206)

We are using :pserver:.  If I force a :pserver: prefix in post-review
it still fails.  If I add :pserver: to the repository path on the
server attempts to use the web interface fail.
chipx86
#2 chipx86
What does the repository info in Review Board say?
  • +NeedInfo
#3 skip.mo*******@gmai***** (Google Code) (Is this you? Claim this profile.)
The repository info in the web interface lists CVS as the tool, contains a username and password and
the :pserver: info without the :pserver: prefix, e.g.: "cvs.example.com:/cvs"

If I add the :pserver: prefix the web interface doesn't work.  Based on what poking around I did that appeared
to be a known issue.

Skip

chipx86
#4 chipx86
If the repository info exactly matches the "repository_path" being sent (as shown in
the debug output), then you certainly should not be seeing this error. We just look
up a Repository containing that value directly.

Stupid question probably, but is there any chance that it's talking to the wrong
Review Board server? A development server instead of a production server, for instance?
#5 skip.mo*******@gmai***** (Google Code) (Is this you? Claim this profile.)
Aha!  We abuse DNS in horrible ways, so "cvs.trdlnk.com" resolves though the I have the repository registered
as cvs.wacker.trdlnk.com.  Lots of developers use simply "cvs" as the CVS server's hostname.  I ran
cvs_chroot on my sandbox so the hostname in CVS/Root matches the path in the repository.  Now it works.

Is there some way around this short of making everyone run cvs_chroot?  Maybe create a bunch of repositories
all with different hostnames?

Skip

#6 skip.mo*******@gmai***** (Google Code) (Is this you? Claim this profile.)
OK, here's a patch that converts whatever hostname it finds in the repository path to its canonical name
then uses that when querying the server.  You just need to use the FQDN as the hostname when creating
a CVS repository.

This is probably a bit fragile, but I think you'll get the general idea.

Skip

  • +
    Index: contrib/tools/post-review
    ===================================================================
    --- contrib/tools/post-review   (revision 1513)
    +++ contrib/tools/post-review   (working copy)
    @@ -93,6 +93,7 @@
             self.base_path = base_path
             self.supports_changesets = supports_changesets
             self.supports_parent_diffs = supports_parent_diffs
    +        debug("repository info: %s" % self)
     
         def __str__(self):
             return "Path: %s, Base path: %s, Supports changesets: %s" % \
    @@ -532,6 +533,17 @@
             if i != -1:
                 repository_path = repository_path[i + 1:]
     
    +        i = repository_path.find(":")
    +        if i != -1:
    +            host = repository_path[:i]
    +            try:
    +                ip = socket.gethostbyname(host)
    +                canon = socket.gethostbyaddr(ip)[0]
    +            except socket.error:
    +                pass
    +            else:
    +                repository_path = repository_path.replace('%s:' % host,
    +                        
chipx86
#7 chipx86
Mind posting it on http://reviews.review-board.org/ ?
  • -NeedInfo
    +Confirmed
chipx86
#8 chipx86
  • +Component-Scripts
    +PendingReview
david
#9 david
  • +CVSClient in post-review is particularly fragile with respect to qualified domains
#10 skip.mo*******@gmai***** (Google Code) (Is this you? Claim this profile.)
I've tried several times to post it in the past few minutes, but I have no
idea what it wants for "Base Diff Path".  I tried the following:

    reviewboard
    reviewboard/contrib/tools
    reviewboard/reviewboard
    .
    http://reviewboard.googlecode.com/svn

All yielded tracebacks when I tried to view the diff.  I am completely
flummoxed by this field.  The unidiff was created from my reviewboard
sandbox and compares these files:

    Index: contrib/tools/post-review
    ===================================================================
    --- contrib/tools/post-review   (revision 1513)
    +++ contrib/tools/post-review   (working copy)

I checked out the reviewboard code with this svn command:

    vn checkout http://reviewboard.googlecode.com/svn/trunk/ reviewboard

So, what should I use for the Base Diff Path field?  I googled for
"reviewboard base diff path" and was led to this blog:
http://www.chipx86.com/blog/?p=222 where it states, "the path relative to
the root of your Subversion repository where you generated the diff".

Thx,

Skip

P.S. In case you hadn't noticed, I am a complete novice at this reviewboard.
Coincidentally, I'm also pretty much of a code review and Subversion novice,
so my mistakes are likely to be ones which you might want to cover
thoroughly in tutorial material.

#11 skip.mo*******@gmai***** (Google Code) (Is this you? Claim this profile.)
Can't anybody help me with Comment 10?

chipx86
#12 chipx86
If using svn diff, you should make sure you're in the top-level reviewboard directory
(containing the contrib directory) and run svn diff. For the base diff path, you'll
then use "/trunk/reviewboard"
#13 skip.mo*******@gmai***** (Google Code) (Is this you? Claim this profile.)
Thanks, that worked.  It was just the base diff path I couldn't figure out.  I just published a patch:

    http://reviews.review-board.org/r/576/

Feel free to close this issue or direct it toward your documentation maven(s).
david
#14 david
Fixed in SVN r1522. Thanks!
  • -Confirmed
    +Fixed