Tuesday, July 3, 2012

Hi

The week spent in struggling to find the difference between the online instance and the local instance of melange, since the same online instance was not showing shipment, projects and proposals on student dashboard, which I could see in the  local instance. I used localhost:8080/_ah/admin/interactive console to create entities as Lennard said that it was the right way but unfortunately it did not work too.

Actually, I did not realize that I was signed in as an admin in the online instance instead of as a student while accessing the student dashboard via the URL. The code in gsoc.views.dashboard only allows a student, who has project to see the shipment, proposal and project components.
We have specifics about the spreadsheet too, like it should have exactly the same columns as listed in the task/trackings.py and two worksheets with gid=0 and gid=1, otherwise, the syncing fails.

So I created a student profile to see if I can see the shipment details after syncing. I also manually set student_info.number_of_projects=1 so that the student components are rendered. The syncing now can be done successfully. You can see the demo in my instance.
The details are:
Instance: http://melange-aditi1.appspot.com/

Student username:
atmelange@gmail.com
password:               

Public Spreadsheet: https://docs.google.com/spreadsheet/ccc?key=0AuENNrqFbxWEdFVIaVJSczZOSkVPUWc0MWFrOEo2cXc#gid=0

After this I started working on proposal syncing. I added useGDataJS function in soc.views.helper.response.py for proposal syncing which was missing in the patches supplied by Orcun. I am stuck now at “Sync with Google Documents” not being
appearing as linked. I have mailed Orcun for his help and will proceed further.

Melange Functional Tests.


Hello everyone.

This past week i worked on cleaning the scripts and making the code better. I am making an entire framework using selenium and python for the first time, so its obvious there will be mistakes and i am making a lot of mistakes but this is how i am learning. Everyday i learn something new and its not only about coding skills , but a lot more. My communications skills are improving , i am learning about processes and many other things. I have made a couple of scripts till now, they are running fine but there is lot more space to improve. Oh wait, do they really run. Everybody likes screenshots. How about a video !!!

                                

Speed of exceution as shown in the video is different as compared to original execution. If you wish to see that please clone my branch at google code [0] and give a shot to functional tests. However execution of these tests does not mean that these test scripts are done. There is a lot of space for improvement and a lot more to be done. In the video you will see the execution of following scripts:

test_gci_about_page.py
test_gci_dashboard.py
test_gci_leader_board.py
test_gci_student_registration.py
test_gsoc_about_page.py
test_gsoc_accepted_orgs_page.py
test_gsoc_dashboard.py
test_gsoc_profile_page.py
test_gsoc_search_page.py
test_gsoc_student_registration.py  

Most of all i am enjoying a lot  working on this project. Not only this project is adding to my coding skills but also educating me on  how effectively we can contribute to open source projects.

[0] http://code.google.com/p/soc/source/browse/?name=functional_testing



Monday, July 2, 2012

Functional Connection Module

Hey there, so this past week I've been working out the kinks I've been avoiding having to deal with and "finalizing" as much as possible for the first fully working implementation of the connection module. And also doing pretty much all the work on ShowConnection. I feel like I've got an excellent handle on the URL configuration and redirect stuff, so I'm pretty pumped about this. This round the code seems to be free of stupid mistakes (e.g. if org_mentor is False and org_org_admin is False:, which Lenard pointed out to my amusement/horror) and does everything I think it's expected to. Excited? Wonderful, me too.


I had accidentally moved the line to run the method to create the entity inside of a transaction outside of the foor loop for users in OrgConnectionPage, so after fixing that and something else (I forget what it was) I got the form to start properly creating entities again. Speaking of the form, it also now supports either a drop-down or a radio button if you uncomment the code in order to allow an org admin to choose the role to offer the user. I also made some changes to the template that the views were using in order to properly display form erros this time around, which was causing a certain degree of frustration and occasional raging. So this is fully working by my expectations, but do let me know if there's anything else that this view is supposed to do other than create a GSoCConnection model. Oh, a screenshot you ask? Well alright.


Next, we have the user side of things. I modified pretty much the same stuff as OrgConnectionPage as I recall, which was basically just entity creation and template modification for errors. Here's what it looks like:

Most of the work was dedicated ShowConnectionPage. I messed around with the URL configuration in order to get it to display properly. You can get to this page through the dashboard, though now the dashboard will display ALL GSoCConnection objects rather than just those related to the current user or org admin. One thing I need to fix is the org_admin_for member of the RequestData object in the dashboard object that handles displaying the connections, as it's only populating with one org. In the meantime this view itself works with a proper checkAccess() method and template to display all of the buttons. Though the buttons could be spaced out and organized better; this will be a refinement I intend to tackle in the second half of GSoC :). A user and an org admin are presented with buttons that allow them to take action in response to the current state of the connection, notably that a user can accept only a mentoring role if they are offered an org admin role. There are a series of methods to handle promoting the user in the event that the org admin and user change their side of the connection to equivalent values. In the spirit of a gratuitous number of screenshots, here's a picture of a mentor invitation on the org admin side:


Among other modifications include changes to the show_connection() method in the soc/views/helper request_data module in order to reflect a change in URL schema, AccessChecker's canViewConnection() method in order to determine who can view a GSoCConnection, and the soc/views/helper/notification connectionContext() method and associated template for email messages when a new connection is formed.

All of the above changes can be found on the main repo in an updated version of the connection_demo branch, so feel free to give it a look. I won't go so far as to say that for a first version it's perfect, but I think it's a great basis upon which we can make refinements and improve this mechanism. I've still got a little time to make adjustments before the midterm evaluation, so if there's anything you would like to see added or done differently than let me know and I'll get it done.



Tuesday, June 26, 2012

Shipment Tracking and Proposal Sync

Last week I worked on making the shipment tracking work on a live instance. I deployed the working instance to appspot and I faced the same problems that I faced locally. The syncing did not work because of the missing program key. I am sure that a program is seeded because I use seed_db to seed the datastore. I select the program GSoC 2009 in /site/edit too if its available and sometimes the programs doesn’t even appear in /site/edit after multiple seeding too. I spent quite a lot time trying to figure out where the problem is but in vain. At last, I approached Madhu for help but we could not fix up any meeting as it was quite a busy week for him.
    Finally, I decided to work on proposal syncing and attack shipment tracking when Madhu is available. I spent most of my time studying how proposal syncing works and reading the relevant django docs for forms processing etc. First I tried to see if proposal syncing feature worked. When I visited the proposal submission page, I got an AttributeError in gsoc.views.proposal.ProposalPage stating that response_helper had no attribute useGDataJS. So, I just commented that line to see if there are no crashes. Proposal submission page loaded fine but “Sync With Google Documents” was disabled in the page. I could not find useGDataJS helper function in any of the patches given by Orcun. I guess I have to contact Orcun to know more about this function or figure it out myself. This pretty much sums up my work.

Melange Functional Testing

Hi,

This week i worked on creating the test scripts for  gci student registration, gci dashboard, gci leaderboard, gci about page, gsoc accepted organisation page. I also made few changes to base module melange_functional_actions.py, added a new method to login on melange using Google account in case functional test is exceuted against the melange instance hosted on App Engine. I was successfull in running test cases with nose. I can execute all the tests with $ bin/run-tests tests/functional. It picks all the test scripts and execute them one by one. I am currently in process of moving all the scripts from my repository on github to my soc functional_testing branch.

Now, I am planning to refine the test cases i have written so far and send them to Leo and list for review and suggestions. Next week i am planning to work on already written test cases and make them better.

Monday, June 25, 2012

Connection Module and Related Views

This week's work went towards finally implementing the connection module with the views I've been envisioning. I started off with two - ConnectionPage and ShowConnectionPage - to be replaced by OrgConnectionPage, UserConnectionPage, and ShowConnectionPage in order to divide up the logic between views and cut down on the (admittedly small) number of conditionals within these pages. You can find the updated model on the main repo, and also right here. Apologies to anybody who might get notifications of commits, I've pretty much been spamming them almost every time I do something substantial or interesting.

First let me start off by saying that I've made some adjustments to the ConnectionModel per Daniel's suggestion and a couple of my own design. The new method for determining the state of the connection relies on four boolean variables: user_mentor, user_org_admin, org_mentor, and org_org_admin. These little switches allow for easily determining the implied state and any promotions. I've also set the parent entity of this model to be the User instance from the org-user relationship and changed it so that the model contains the Profile instance for the User to make it easier to handle promotions and getting certain information in the ShowConnectionPage class.

OrgConnectionPage is fully working, allowing an org admin to initiate a connection between an organization that they are an admin for and a user, granting them the role of either org admin or mentor. Except for the fact that it won't show the ValidationErrors for the role checkboxes...still workin on that one. It will validate (I stole the existing link id cleaning methods for now), create a GSoCConnection entity, and post back onto itself.  The url configuration is pretty simple, just in the format of connect/sponsor/program/organization and you can get to it from the org admin dashboard by clicking on an organization under "My Organizations." I combined the two links for "Invite Mentor" and "Invite Org Admin" into "Start Connection," which I think will suffice until I come up with a more intuitive name. Within the view is a checkbox that allows you to pick either one or both roles to offer. Everybody likes screenshots, so here's a picture:




UserConnectionPage has been giving me a headache. It took me a while but I finally understand the URL configuration system (....I think)  and how it all fits into the big picture along with AccessChecker and RedirectHelper. It's giving me problems at the moment since my connect() method in AccessChecker requires a user keyword argument, and I'm linking it from the Apply class in gsoc/views/org_home which doesn't have the data I need and I'm not seeing a way to put it there. Once I figure that out though (most likely by harassing people on IRC), all I have to do is make a small change in the class's generate() method and it should be working.

The checkAccess() methods on both of these classes should be good to go, but it's likely that someone will point out something I missed and I'm going to feel like a moron. But it's an easy fix, so I'm not stressed out about that at the moment.

The notification module's connectionContext() method should also be very easy to whip together once I get the ShowConnectionPage working, it should just involve creating a template and finishing the rest of the method.

Speaking of ShowConnectionPage, I had this guy working for a little while. Originally I was redirecting to this page after a successful post in OrgConnectionPage and it was showing me everything I wanted to see, but I ended up not liking how it was working and the url configuration started to give me problems so I scrapped most of the work and will take it on this upcoming week. Right after I convince my friend dashboard.py to behave and show all of the GSoCConnection instances properly. Mario if you're reading this I'm probably going to try and track you down with Javascript questions! 

That's all for this week. I've got a couple of questions for the conference call tomorrow (the checkbox errors not showing up and making org_home cooperate for UserConnectionPage, if anyone wants to prepare :P) but if I can figure those out I'll have this fully working by the midterm evaluation.

Tuesday, June 19, 2012

Shipment Tracking and Data Syncing

Hi,

This week I spent time working on Syncing of shipment tracking data, available on admin dashboard with student shipment list which is available on student dashboard.  First I sorted out the consumer key and consumer key secret problem which were set to none, by creating an API access key for http://localhost:8080/ and then supplied them in respective fields in http://localhost:8080/site/edit page.  

And the whole week had been a great experience for learning by mistakes. I pushed a wrong commit “Change date format” in gsoc/views/trackings shipmenttracking branch and happened to mix up the commit messages of two patches “Change date format” and “Change worksheet id”  ‘.’ I learnt these situations can be avoided with extra carefulness  while pushing the branch to remote origin.

I also thought of changing the column names in soc.modules.gsoc.tasks.trackings and not to hardcore the worksheet id in spreadsheet link. A discussion with Madhu made me clear that since Google provides us data in the particular format and the code is written according to that so I need not think about that. So the shipment tracking and sync part has been integrated successfully to melange and this week I’ll be working on Proposal Sync and hoping that I’ll make it work by this weekend.