This week completes the two week task of adding functionality of grouping exceptions together manually and automatically. I have changed the way of storing the reports in the database from storing all the data in the reports table to storing exceptions in the incidents table and similar incidents are grouped in the reports table.
I have added functionality to group related reports together such that they show the combined information of their incidents in the reports description page. I have also offloaded the code that creates new incidents and reports to the incidents model. I have refactored it to split it into separate functions.
I have also modified code in phpmadmin to anonymize the host name from the error report as well as remove unneeded params such as database and table names. I have also isolated the actual files and php scripts where the exception occurs to be used in grouping the reports together.
I also added some sanitization in html entities that are stored in the database. there needs to be more sanitization done in the coming weeks to cover all the user submitted data.
I created a pull request here for all the changes including some other checkstyle changes. I will also create a new seed file soon for the new changes since the old one would not work anymore.
As for next week it is the first week in another two week task to add graphs to visualize the statistics both for a single report as well as all the reports as a whole. Additionally I would add another field to the report summary which is which page the exception happens in, as well as sanitize the rest of the user submitted fields to prevent XSS.
The task this week was simple. It was to submit bugs to the sourceforge bugtracker. I had already spent a long time trying to get an authentication token in an earlier week. I was able to use this authentication token this week to submit error reports.
Sourceforge uses OAuth V1 which was much more complicated than V2. I was able to use a component created for OAuth V1 for cakephp. I wrote my own component specifically for sourceforge api, similar to the one I did for github. It allows most of the logic to be out from the controller so that it is much simpler.
Since I noticed there is a lack of components relating to apis for cakephp, I wanted to to release them on a separate repo to help others who may need to do what I did. The components I created were a bit specific, not in a way that they can only be used on phpmyadmin or my project, but in that I only implemented the parts of the api I needed. The api is pretty big and while most of the functions are not specific to phpmyadmin, they do not come close to covering a large portion of the api.
Anyway I created code to allow me to get authentication tickets in the future for any application and user credentials so that when the deployment time comes I can easily generate proper credentials other than the ones I was using for testing.
I also finished the line number translator in the phpmyadmin repo. I went with a much cheaper way than what I originally planned. It works great I just have to make it more resilient incase the line count cache file is missing.
Next week is one of the hardest tasks not because of too much coding is required but because I will be dealing with hypotheticals. I am expected to find some sort of measure to group reports together that is as accurate as possible with no way to test it in the wild. There are a million ways it can go wrong and I wouldn’t know until we actually deploy and test it.
I will be trying out the different ways a stacktrace can appear (it changes depending on how the code containing the exception was loaded). I will try to find some way to group them without alienating too many similar reports. We will see how it goes.
This week I have finished the client side component and once the api between the client and the server is complete I will request merging into master. This should be the last week of me working on the client side component.
My system now currently catches any errors that occur and offer to submit the error report to our servers. It uses file_get_contents or curl depending on availability and respects the proxy settings set by the user.
I wrap all global functions starting with PMA_ I also wrap the callback for AJAX.registerOnload as well as the handler for $.fn.on since it is used excessively throughout the code.
I have tested the code in the latest versions of browsers available on linux (so no IE or safari yet) and it works ok.
I have started on the server side component and created a repo. I have setup the server on my computer. Once I make things more portable I will probably push the initial version of the server early this week. A lot of things are currently dependant on my current setup so it is of no use to push them to a public repo for now.
I will be using cakephp as my development framework. I would have rather used Ruby on Rails but I figure it would be easier on the developers who already know the language to use a php framework.
This week my task is to basically create the server. I have gotten a head start already. I will be using the extra time to take on some of the tasks of the next week so that I would be ahead of schedule.