[Tracker-discuss] Adding a "Rietveld this" button?

Daniel (ajax) Diniz ajaksu at gmail.com
Fri Mar 6 00:29:25 CET 2009

Martin v. Löwis wrote:
> I would like to see two things
> a) make "Rietveld link" a part of the issue page (rendered only if there
>   actually is one)

It'll need a storage place, could be a Link, Multilink (if we cater to
multiple reviews of a single issue)  or simply a column in _issue
(hackish, but might be sufficient). Once we decide where this should
be stored, I can work on that, plus template and whatever behavior
change is necessary.

> b) provide an upload script that has an option of giving a tracker issue
>   number during upload, so that it can
>   1. add the tracker to the Rietveld issue, and
>   2. correctly set the subject of the Rietveld issue.

OK, would a patch against Rietveld's upload.py be enough? Or should it
be a wrapper that forwards any command line options it doesn't handle
to upload.py?

Here's a proposed implementation for the 'correctly set the subject'
part, IIUC it should output a '--message' snippet to upload.py:

from urllib import urlopen, urlencode
def get_title(id, tracker='http://bugs.python.org'):
    # This should be the smallest query able to return an issue title
    query_tpl = [('@action', 'export_csv'), ('@columns', 'title'),
                 ('@filter', 'id'), ('id', id)]
    # Request path + query
    issue = '/issue?' + urlencode(query_tpl)
    title = urlopen(tracker + issue).readlines()
    if title[0] == 'title\r\n':
        # Got a single data row CSV, format and return it
        return '[issue%s] %s' % (id, title[1].strip())


More information about the Tracker-discuss mailing list