Friday 19 August 2016

Wrap Up!

Hi everyone,
This blog post marks the official end of GSOC 2016, however, I will continue my association with Mailman and keep working with same zeal. Below are the links to the branches on which I worked during the GSOC coding period:

1: Phase1 branch:
https://gitlab.com/_Harshit_/mailman/commits/phase1
This is the first branch in a series of four branches(two in mailman core, one in mailman client and one in postorius).
Goals achieved:
1: Allow for storing of styles in database:
For serving this purpose, I have introduced two new models:
1: Stylet
2: Style
Stylets are a partial set of styleable attributes that can be used to compose styles which are a stack of stylets such that stylet at the top overrides the values of the common attributes.
2: Allow for the automatic updation of the settings of the mailing list as soon as the style being used by it is updated:
I have used two of the SqlAlchemy's session level events for this purpose 'after_flush' and 'after_flush_postexec'. Both of the events are fired as soon as a flush occurs. In the 'after_flush', we collect all the stylet/style objects in which there are any net changes. Since this event doesn't allow us to emit further SQL until the flush has been performed, hence I have used after_flush_postexec which is triggered after the flush the has been executed. In this event we update all the mailing list which use the updated stylet/style.
3: Change the style used by a mailing list after its creation:
This branch allows for the changing of the style of the mailing list after its creation. The mailing list whose style is changed will start to follow the new style such that any changes made to any style(or any stylet of which this style is composed) will be reflected in the mailing list. However, one important thing to be noted is that there is only a loose coupling between a mailing list and the style it uses in the sense that if a mailing list was using a style which for example defined a value of True for the 'advertised' attribute and later on it switches to another style which defines no value for the 'advertised' attribute then the mailing list will continue to have a value of True for the 'advertised' attribute until the new style defines a value for this attribute.
4: Make a stylet/style immutable:
This branch allows for making a stylet/style immutable. A style once set immutable can't be modified. For this purpose I have overridden the 'setattr' method of the style and stylet model and if a style has been set immutable we raise a StyleUpdateError.
5: Porting the default stylets/styles:
I have ported the default stylets and styles. The stylets/styles are added to the database to the automatically during startup if the stylet table(and hence the style table) is empty.
Things yet to be done:
1: Documentation:
The stylet/style update system and the loose coupling between the styles and the mailing list is too complex and will need extensive documentation.

2: Phase2 branch:
https://gitlab.com/_Harshit_/mailman/commits/phase2
This is the second branch in the series.
Goals achieved:
1: Expose stylets via REST API:
This branch exposes stylets via REST API which means users can now view, edit and delete existing stylets as well as create new stylets.
2: Expose styles via REST API:
This branch also exposes styles via REST API which means just as stylets, users can view, edit and delete existing styles as well as create new one. Not only this, they can also inherit from an exsting style.
3: Remove the existing way of changing list settings:
Since almost all the settings of a mailing list are managed via styles and they can now be updated dynamically updated, hence, this branch removes the existing ListConfiguration class and makes manual editing of list settings non-recommended way of changing list settings.
4: Allow for changing a list's style via REST API:
Earlier, REST API allowed users to apply style to a list only at its creation time. This branch allows users to change the style of a mailing list via REST API.
Things yet to be done:
1: Documentation:
All the REST endpoints needs extensive documentation.

3: Phase3 branch:
https://gitlab.com/_Harshit_/mailmanclient/commits/phase3
This is the third branch in the series.
Goals achieved:
This branch introduces some changes to the exisitng python bindings(mailman client) in accordance to the changes introduced in the REST API in phase2 branch.
Things yet to be done:
1: Testing
2: Documentation

4: Phase4 branch:
https://gitlab.com/_Harshit_/postorius/commits/phase4
Goals achieved:
1: Provide an interface to manage stylets:
This branch introduces a new interface using which users can easily view, edit, copy or delete stylets.
2: Provide an interface to manage styles:
This branch introduces a new interface using which users can easily view, edit, copy, inherit or delete styles.
3: Remove the interface for changing the list settings.


Screenshots: https://mail.python.org/pipermail/mailman-developers/2016-August/025792.html

Things yet to be done:
1: An interface using which users with higher privileges can defer attributes to users with lower privileges.
2: Modify the existing interface so that users can apply styles to a new list or to an existing list.
3: Testing.
4: Documentation.


Read my other blog posts for more info.


Thanks,
Harshit Bansal