397: Web API should include /api/json/reviewrequests/to/user/USER/directly/

msab****@gmai***** (Google Code) (Is this you? Claim this profile.)
Feb. 25, 2008
Maybe I was misunderstanding what /api/json/reviewrequests/to/user/%s/
does, but it didn't do what I expected (to only list reviews where the
given user was in the target_people. Many of the review requests returned
don't have the given user in the target_people field - in fact, quite
often, target_people is blank. I will post a code sample to illustrate.
#1 msab****@gmai***** (Google Code) (Is this you? Claim this profile.)
  • +
    #!/usr/bin/env python
    REVIEWBOARD_HOST = 'http://reviewboard.eng.vmware.com'
    import httplib, mimetypes, mimetools, urllib2, cookielib, os, sys, getpass
    import re
    import simplejson
    from optparse import OptionParser
    from tempfile import mkstemp
    VERSION = "0.1"
    if os.environ.has_key("USERPROFILE"):
        cookiepath = os.path.join(os.environ["USERPROFILE"], "UserData")
    else:
        cookiepath = os.environ["HOME"]
    cj = cookielib.MozillaCookieJar()
    cookiefile = os.path.join(cookiepath, ".post-review-cookies.txt")
    opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
    opener.addheaders = [('User-agent', 'reviewboard-bug.py/' + VERSION)]
    urllib2.install_opener(opener)
    tempfiles = []
    options = None
    class APIError(Exception):
        pass
    def debug(s):
        pass
        #print ">>> %s" % s
    def die(msg=None):
        for tmpfile in tempfiles:
            try:
                os.unlink(tmpfile)
            except:
                pass
        if msg:
            print msg
        sys.exit(1)
chipx86
#2 chipx86
  • +Component-API
chipx86
#3 chipx86
This is meant for any review request that goes to a user, whether the user's listed
directly in the reviewers list or indirectly. We should have a separate API function
for accessing the ones directly to the user.
  • -Type-Defect
    +Type-Enhancement
    +Milestone-Release1.0
  • +Web API should include /api/json/reviewrequests/to/user/USER/directly/
chipx86
#4 chipx86
  • +Fixed