Wednesday, July 15, 2015

Week 7

Hi everyone

In the past few week, I had my schedule screwed up so I didn't have a new post.

I have made many improvements to the rest module. One of them is adding filtering and pagination. So user can get a filtered list of data they want, for example, issue?where_status=open&where_priority=normal,critical&page_size=50&page_index=0 will return the first 50 issues which have status as "open", and priority as "normal" or "critical".

User can also request the server to send pretty output by adding 'pretty=true'. Pretty output will have 4 spaces indent.

Another improvement is having a routing decorator. So people can add new function to the tracker easily like Flask

@Routing.route("/hello", 'GET')
    def hello_world(self, input):
        return 200, 'Hello World'

Unit test and basic authentication are also done to provide testing.

Wednesday, June 24, 2015

Week 4

In the previous week, I have been testing the code and preparing the documentation.

For testing, I was interested in Pyrestest at the beginning because of its simplicity. However it doesn’t support dynamic variable assign between tests, so I decided to switch to Javascript. This also brings convenience in the next step, I will need to write a demo client using Javascript. For documentation, Swagger.io is a great tool. It provides user friendly, quick testing, support authentication & API key.

I still feel like the code needs more polishing and it is not good enough for demonstration. So I decided to hold back the demo version for a while. In the mean time I will tell more details about the project in the blog posts.

The REST handler will be separated from the rest of the tracker. Any request uri begins with ‘/rest’ will be forwarded to REST handler. At this point, request is divided into 3 groups ‘class’, ‘object’, and ‘attribute’ with 5 possible actions ‘GET’, ‘POST’, ‘PUT’, ‘DELETE’ and ‘PATCH’.
Example:

  • 'issue' is a class, ‘GET’ request to /rest/issue will return the whole collection of “issue” class.
  • 'issue12' is an object, ‘DELETE’ request to /rest/issue12 will delete the issue12 from the database
  • 'title' is an attribute of 'issue12', ‘PUT’ request to /rest/issue12/title with form “data=new title” will make the title of issue12 becomes “new title”

REST Handler also accept HTTP Header ‘X-HTTP-Method-Override’ to override GET, POST with PUT, DELETE and PATCH in case the client cannot perform those methods. For PUT and POST, the object will be using form data format

Error status will appear in both HTTP Status code and response body, so if the client cannot access the response header, it will retrieve the status from the response object.

Detail information of the standard will be published in the documentation.

Tuesday, June 16, 2015

Week 3

So far, I have my Roundup REST live and working now. During next week, I will have the Documentation published, so people can start making feedback on them.


This week:
Roundup can perform GET, POST, PUT, DELETE and return the data
Errors and Exception handling

Next week:
Perform PATCH
Documentation
Simple client that uses REST from Roundup


Thursday, June 11, 2015

Week 2

In the previous week, I had implemented GET prototype using the same method as xmlrpc handler. With this implementation, I will achieve better manipulation with information, in comparison with the last method.

The current challenge is making my module as clean and easy as possible, in order to upgrade it. Moreover, taking the full advantage of the roundup design is necessary.

So that's it for this week. My target is having a working REST by the end of this week.

Sunday, May 31, 2015

Week 1: Warming up with Roundup

This week, I had been playing Maze game with Roundup. The project structure is quite complex, I can say. However, my experiment was a success in creating a REST-like GET page based on the template of displaying list of issue.

The first step is reached but I'm not satisfied with it. It is relying on the web template and so, it is restricted in many way: loaded via zope, restricted from displaying only 50 items in the list, being slow (600ms delay on localhost, I'm sure it can be improved), ....

So next week, I'm looking to hook my code to a lower level, my target is the same as Web and xmlprc at client.py to lower the cost of unnecessary process, thus increase the speed.

Tuesday, May 12, 2015

About me

Greeting, everybody.

My name is Chau (pronounce as /chow/). You might notice that my nickname is kinggreedy, with "greedy" from "Greedy Algorithm". Why "king" then ? Well, I love the greedy algorithm so much that I will make sure no one will ever greedier than me, That's why it's "king". (Hint: I did choose my GSoC project based on Greedy Algorithm :P)

About my project
This summer, I'm working for CorePython. My project is "Create a RESTful API for Roundup". Roundup is an issue tracker for Python. Currently there is no official web API to get the data from Roundup. This project aims to implement the RESTful API for Roundup, thus enable the opportunities for developers to create and develop new services and features, which can easily keep track of the data for users.

Additionally, I have to develop some basic tools that use the API, for example, improved stats page or dashboard. And my ultimate aim is to contribute it upstream.


Monday, May 11, 2015

Week -2: Getting my workspace setup

This week, I have my workspace setup on my computer. Usually, this part is very boring and it always a nightmare for me. We all want to get into the fun soon™ and no one wants to spend to much time trying to open the box.

But now, I got the solution. My mentors are using Vagrant as instructed here https://wiki.python.org/moin/TrackerDevelopment (they will move to Docker soon).  So I just needed to install Vagrant, VirtualBox and type in "vagrant up", and ta dah, my VM got installed and configured. The guest home directory is synchronized with host directory, so I can use PyCharm (yes I'm Windows-user) to develop without having to make a deployment script.

Talking about performance, the VM is very light, it just takes 400MB RAM away and nothing more. So now I can spend my time tinkering with Roundup.