Monday, August 16, 2010

Social Features Project: Week 12

The final week of GSoC has rolled in and my blog post is incredibly late too as I spent much of my time working on my code.

My final version is upload on my app engine instance here. It consists of User Pages, Calendars and a Map View. The Calendars feature is functional and works as per the workflow I had originally planned. The past week had some last minute bugs which popped up only when I ran my code on AppEngine as they were not detected while I was testing on local host. The bug was that I was storing a universal session authtoken for the entire application instead of one for each user. This did not show on my own machine as I always used it under my own google account! Hence, I had to spend time to rectify this and ensure that each User model stores the session token and later the services uses the set token when the user decides to use the calendars feature.
This issue has been fixed now. However, I believe it will take a bit more work to integrate it and will have to spend time with my mentor in revising the finer details before actual code integration with the main code base. I look forward to doing this in the week after next.

My latest code is uploaded to my bit bucket account here.

Some problems still awaiting to be solved are nasty server error being cause by issues in the Google Calendars API, which I thought I resolved however, they still seem to pop up randomly. The issue has been taken up by others using the API here, although there does not seem to be a good fix for this yet.

Another thing that needs to be settled is the scalability of the Maps View. As GSoC has about a 1000 students, 1000 mentors and then org_admins etc. Right now, as I am having to manually populate the data, the map view has hardly 40-50 pointers on it. Hence how will the JS handle a large number of objects is to be seen as yet.

Finally, it has been a great experience with loads of learning and coding. It has been great working with the Melange team, and specially my mentor Madhu. :)
I am looking forward to staying with Melange and contributing to the project as best as I can in the future too.

GSoC 2010 Data Seeder: Wrapping up for end of GSoC

So GSoC is coming to an end, it's time to wrap up the project to a pretty much fully functional and usable state, while there could still be much to do. So, my latest changes mostly include usability improvements like being able to test the configuration for a data provider and get some sample values, include provider and parameters descriptions, being able to validate, download or upload a configuration sheet.

Other improvements include some visual styling, although I personally find my work very ugly, I'm hoping someone with better visual appeal might help me with this part in the future.

As a final proof of concept, I will provide a number of configuration sheets that will demonstrate the full power of the module: being able to generate mass amounts of "real world" data very easily (although doing a first-time configuration might be a little time consuming).

I have also encountered some unexpected problems. It seems that GAE (or maybe the Mapper API, I'm not sure) limits the amount of data that a task can receive as a parameter. Configuration sheets can get pretty big (I won't be surprised to see some reach tens of KBs) so I needed to find a workaround. My solution involves storing the actual configuration sheet in a model, and then each task would read the configuration sheet from the datastore. While this solution speeds down the process by quite a bit, it might prove more scalable and also provide some historical value, should the configuration sheets remain in the datastore.

Enough about the technical stuff... It's been a real joy working with everyone around the Melange community and I'm sorry if I haven't been all that serious all the time during GSoC. Many thanks to my mentor Mario who has provided me with priceless information all the time and who has made all my work so far possible. Also, thanks to all the other developers (Lennard, Sverre, Madhusudan and Daniel), you are simply great and it's been a pleasure to work with you all. Cheers to all other GSoC students (Leo, Pavel and Savitha), I hope we'll see each other in the future as well. Having said that, it's time to continue working on the project, there's still a lot of things that can be improved.

Cheers!

GSoC 2010 Melange Testing Project: Week 12 (Final) of the Coding Period

In this week, I have cleaned up, commited and pushed all the tasks testing code to my online clone. I also worked on adding test cases for soc.logic.cleaning with suggestion of Sverre. Besides, I have also uncovered a couple of bugs in the soc.modules.ghop.tasks.task_update module and sent a patch to the mailing list. Lennard was very kind to help me merge the patch. I have also uncovered one issue with my test code for soc.modules.gsoc.tasks.accept_proposals (set the timelimit parameter too small) and then corrected it. In addition, I have also investigated the diference between the console and html coverage report. It seems that the console one counts statements while the html one counts lines.

When I tried to move the the gaetestbed and pymox modules to buildout dependencies, however, I found the easy_installed versions of both modules have problems (easy_install is used during Melange buildout). For gaetestbed, I found that the gaetestbed on PyPi is an old version which cannot check the html body of an email. So, I emailed the author to ask him to put the latest version onto PyPI. The author (JJ Geewax) was very kind to have helped me do it. For pymox, the easy_installed version available is a quite old version (0.5.0) which has a bug fixed in the later versions. Unfortunately, these newer versions are not available on PyPi, so not easy_install searchable. I reported the issue to the project issue tracker. One of its authors (Steve) was also very kind to helped me to put a newer version (0.5.3) to PyPi. After all these problems have been sorted out, there remains one issue that gaetestbed currently depends on webtest even though you do not need this part of function due to the design of gaetestbed, which the author agreed to resolve in the near future. After consulting Sverre, I finally moved the the gaetestbed and pymox modules to buildout dependenciesi and then commited and pushed the change to my online clone.

In the next week, I will add the experience of how to do mail and taskqueue related tests with gaetestbed to the testing wiki page, make a patch for removing the cron/job related modules and then send it to the list as well as add more test cases for existing Melange modules.

This is the last week of GSoC2010. It was a quite exciting and enjoyable summer. My project is very interesting, my mentor (Sverre), other developers (Lennard, Daniel, Madhusudan, Mario) and GSoC administrator (Carol) are very helpful, and my fellow students (Felix, Pavel and Savitha) are also very nice people to work with. Specially thank my wonderful mentor, Sverre, who is always ready to help me out when I got stuck and without whom I may not complete my project. During this period of time, I have also learned a lot about GAE and Melange, I have also come up with something useful and merged to the trunk, and uncovered several issues. Though the program has ended, it does not mean the end of my project or my involement in Melange. On the contrary, I will continue to work on the testing project after GSoC, i.e. add more test cases for more modules, improve the testing design and code, integrate Felix' data seeder, and so on, which have not been done because of the time limit of GSoC or dependency. I also hope to work for Melange beyond the testing project and hopefully become one core developer of Melange in the future. I also wish to come up some ideas to improve Melange so that I can serve as a mentor for Melange in the next GSoC and experience the excitement of these guys about the upcoming mentor summit :-).

Document Editor: Last week of GSoC coding

Last week of GSoC coding was devoted to... everything :)

I spent 4 days on form saving framework. First of all I had to fix JS code, which sends dirty fields to the server. The problem was as follows: framework was saving only dirty fields of the form. If you loaded the form for the second time, initial state might have been rewritten. This issue was fixed and now form states are consistent. Then I've implemented back-end. I needed to create model which stores temporary fields as a JSON dumped dict. Some logic class which manipulates all the stuff has been implemented. I also had to change createGet, createPost, editGet and editPost methods of the soc.views.models.base.View class to support temporary form saving. Temporary form saving for the model is enabled via "form_autosave" key of the params dict.

After form saving I started testing the code. An issue happened immediately. There was a problem with home documents for different models which derive from soc.models.presence.Presence. Views and logic were not aware of the revision control for the document, so exceptions were raised. This issue is fixed now. I also had to fix soc.models.seed_db.seed function to seed documents in the right way.

I've also refactored diff template, so it can now show arbitrary number of diffs for different revisable fields of the model.

At last I worked at the UI. I've added "Show revisions" button on the edit page for the model. Models that support RC are now distinguished by the "revisable" key of the params dict.
I've also rearranged fields of the Document and StudentProposal forms, so they look as supposed.

Final version of my GSoC contribution was uploaded to the appspot instance http://melange-editor.appspot.com

GSoC coding has come to it's end. And I must admit that it was quite an experience. I've already participated in large software projects and earn my living with development, but GSoC is really memorable. It was cool to participate in such a big and complex open-source project! I want to thank Melange dev team, Carol, fellow GSoCers and my mentor Daniel. They were very helpful and opened. And, you know what? I wish they let me continue contributing :) Come on, guys, I love it!