Roundup Tracker - Issues

Message5368

Author rouilj
Recipients rouilj
Date 2015-09-06.15:08:42
Message-id <1441552124.44.0.564229026219.issue2550734@psf.upfronthosting.co.za>
In-reply-to
Googe Summer of Code 2015 has produced a patch for this.

From the roundup mailing list:

Date:    Sun, 06 Sep 2015 14:36:39 +0300
To:      roundup-devel 
cc:      Hieu Nguyen <hieuh25ATgmail.com>, dangchau1991ATgmail.com

From:    Ezio Melotti <ezio.melottiATgmail.com>
Subject: [Roundup-devel] REST interface -- GSoC Project Report

Hi,
Google Summer of Code is now over, and I'm glad to inform you that the
project "Adding a REST API to Roundup" has been completed.  The work
has been done on the Roundup clone used for bugs.python.org, since we
plan to integrate it and test it there first.  The changes shouldn't
affect any b.p.o-specific parts though, so you should be able to apply
the changes on a regular Roundup clone too.  I eventually plan to port
this to upstream Roundup if it proves successful on b.p.o, but my
resources are currently limited, so you are welcomed to beat me to it.

You can find the code at
https://bitbucket.org/kinggreedy1991/roundup-bpo , more information
about the project at https://bpaste.net/show/7e2303d2aa7a , and the
related core-workflow thread with more information (including another
related project) at
https://mail.python.org/pipermail/core-workflow/2015-September/000220.html
.

Best Regards,
Ezio Melotti

==== from bpaste:

=======================
RESTful API for Roundup
=======================


description
------------

The Restful API for Roundup is built up to provide an interface to
communicate
through HTTP. Using the provided API, users can easily access and get data
from Roundup.


source
-------

repo: https://bitbucket.org/kinggreedy1991/roundup-bpo


deploy
-------

a. Setup a b.p.o tracker and apply patch file located at
  
https://bitbucket.org/kinggreedy1991/roundup-bpo/downloads/roundupRestfulAPI.patch

b. Or setup a tracker from the source repo, branch REST


usage
------

1. Documentation Repository is located at 
   https://bitbucket.org/kinggreedy1991/restfulapidocumentation

   The documentation is based on Swagger-UI and need a web server to view.

   a. The project documentation is located inside ProjectDocumentation
folder.

   b. If you want to try the operations, you need to use a detailed version 
      located in DocumentationForTesting. However, this documentation is not
      correct in general case.

2. The RESTful API start with '/rest'

   Example: Tracker location is http://bugs.python.org/ ,
            Restful service will be located at: http://bugs.python.org/rest/

3. You can add new custom URI to the Restful service by making URL Route
   Registrations:

    3.1. Add a new function to class RestfulInstance at roundup/rest.py

         The new function can receive the submitted form by declaring
``input``
         in the parameter

              def summary(self, input)

         Your function must return an ``array`` that will be converted to 
         json string by the module.
      
    3.2. Use ``Routing.route()`` decorator

         Variable parts in the route can be specified with angular brackets
         starting with colon (/data/<:user>). The variable part in the URL
         accepts any string without a slash.

         Variable parts are passed to the function as keyword arguments.
         Variable type is string.

         Trailing slashes will be stripped, leading 'rest/' will also be
         stripped.

         You can also apply multiple route for the same function. 2
routes are
         considered different if rule is different or the method is
different.

             @Routing.route('/issue/')
             @Routing.route('/class/issue/<:issue_id>')
             @Routing.route('/class/issueattr/', methods = ['POST', 'PUT'])
             def get_issue(page):
                 pass

          Here are the parameters that Routing.route(rule, methods) accept.

            rule (string): the URL rule

            methods (string or tuple or list): the http method(s) will be
                handled by the function. Default value is ``GET``

    3.3. Use ``_data_decorator()`` if you want to handle error and
formatting 
         automatically


notes
------

If you cannot access the restful through your browser, try cleaning the
cache
files (roundup/cgi/client.py, roundup/scripts/roundup_server.py) and
reinstall
the tracker.
======

Also the email:

  https://mail.python.org/pipermail/core-workflow/2015-September/000220.html

discusses a mercurial integration as well

=====

Some questions I have are:

 Can a tracker add its own routes without changing the base roundup
 code? (Similar to how you can add functions, attributes and classes.)

 It would be nice to have a pdf or single page html document of the
 rest api. Maybe swagger can do that, I am not sure.
History
Date User Action Args
2015-09-06 15:08:44rouiljsetmessageid: <1441552124.44.0.564229026219.issue2550734@psf.upfronthosting.co.za>
2015-09-06 15:08:44rouiljsetrecipients: + rouilj
2015-09-06 15:08:44rouiljlinkissue2550734 messages
2015-09-06 15:08:42rouiljcreate