GSoC 2015: Improving the Issue Tracker of MoinMoin 2.0

MoinMoin is an open source, advanced, easy to use wiki engine implemented in Python . It is a collaborative software that runs a...



MoinMoin is an open source, advanced, easy to use wiki engine implemented in Python. It is a collaborative software that runs a wiki which allows users to create and edit web pages collaboratively. Some of the sites using MoinMoin wiki engine includes: Python, Mercurial, Apache, Ubuntu, Debian, Wireshark and many more.

In GSoC 2015, I'll be working on improving the issue tracker of MoinMoin 2.0. 

Project Details

MoinMoin 2.0 has an existing implementation of a simple issue tracker. The current issue tracker requires some improvement in its UI/UX and few more features which would be good to have for better use.

Implementation

For improvement of the current issue tracker, the implementation of the task can be divided into 3 parts:
  • Creation of new tickets
  • View containing ticket list, searching / filtering of tickets
  • Ticket update view

Creation of new tickets

  • Enter title to the issue
  • Search for possible duplicates: This can be implemented by providing auto suggestion of existing tickets based on the title of new ticket which the use wants to create. Currently, MoinMoin 2.0 uses Whoosh for searching queries, we can use this and jQuery for displaying real time suggestions of existing tickets if the title of new ticket to be created matches with any of the existing tickets.
  • Improve metadata fields and add new fields
  • File upload: add a feature to allow user to add upload a screenshot, media or a patch file
Wireframe for ticket creation view:

View containing ticket list (/+tickets), searching / filtering of tickets

Currently the /+tickets view lists all the tickets with some options including few important
filters like "all", open, "closed" and "tags". Also, the current view consist of an option for creating a new ticket and a search box to find tickets. In this view, we can include an "Advanced Search" feature where we can add additional filters for filtering tickets based on a particular "author", "tags", "assignee", "difficulty", "effort", "severity" and "priority".

For "Advanced Search" option, a new view /+tickets/query will be created, where additional filters will be provided through which we will filter the results based in the query applied in the view: /+tickets?<query_type>=<query>. We will also allow to apply multiple filters in our advanced search.

Wireframe for ticket list view and advanced search view:
http://i.imgur.com/gQiCCJf.png

Ticket update view 

The update ticket view is similar to ticket create view. In this view, the comment mechanism can be improved by adding feature to reply to any comment, delete any comment, adding Markdown formatting syntax and posting comments after any updates in the meta data of the ticket.

Wireframe for update ticket view:
http://i.imgur.com/ZuRUUIX.png

Community Bonding

In the community bonding period, I reviewed my proposal again and discussed with my mentors about what features are necessary, how things should be implemented and cleared my doubts. I read the documentation, read the code to understand the flow of execution and how things have been implemented.

I learned about form processing using Flatland, and its really cool :) as explained in their website:

Flatland maps between rich, structured Python application data and the string-oriented flat namespace of web forms, key/value stores, text files and user input. Flatland provides a schema-driven mapping toolkit with optional data validation.
I allows DWIM (Do What I Mean) binding. Here is a run-of-the-mill example to explain:
>>> from flatland.out.markup import Generator
>>> from flatland import Form, String
>>> html = Generator()
>>> class Name(Form):
...     firstname = String
...     lastname = String
...
>>> form = Login({'firstname': 'Vipul'})
"Do What I Mean" binding:
>>> print html.input(form['firstname'])
<input name="firstname" value="Vipul" />
I also read about Jinja2 template engine,  a beautiful full featured template engine for Python. Having tried my hands on Django, I was a little familiar with Django template language which was also the inspiration for Jinja2. I read how macros work in Jinja2. Macros can be compared to functions in programming languages. Its a nice tool to promote DRY (Don't Repeat Yourself) principle while writing templates. The most often used elements can be written in a reusable function i.e. a macro which can be called like a function in the templates.

A small example to demonstrate how to render a form element:

    {% macro render_input(n, value='', type='text', size=20) -%}
        <input type="{{ type }}" name="{{ n }}" value="{{ value|e }}" size="{{ size }}">
    {%- endmacro %}
This macro can be called like a function:
    <p>{{ render_input('firstname') }}</p>
    <p>{{ render_input('lastname') }}</p>
 
I also read about Whoosh. Its an amazing and quite robust searching library implemented purely in Python. Programmers can use it to add searching functionality in their applications and websites. Whoosh allows indexing of free-form or structured text and quick retrieval of matching documents based on simple or complex queries. The speed of Whoosh in processing queries fascinates me very much. it is pretty fast in processing even some complex queries.

6 comments