Sunday 30 November 2014

Week 12

Week 12 was the last full week for UCOSP, and the last full week of classes. Needless to say, things are busy. Officially I still have two more days of classes, which means I likewise have two more days to finish up and close my final PR!

What I Worked On

After receiving some feedback on the API Configuration implementation, I set to making some needed additions and changes:
- Refactored the configuration controller code into its own subpackage with a module just for the endpoints, and another to contain all of the associated helper methods.
- Implemented the endpoint for listing existing plugin instances from the plugin.conf file
- Implemented the creation of unique plugin instances using UUIDs
- Numerous style changes and comments
- Unit tests for the newly implemented endpoints

I also spent some time testing all of the endpoints using a chrome extension for sending REST Client requests (Advanced REST Client): 

It was very cool to see all of the configuration changes made from the client.


What I Will Be Working On

I'll be looking for more feedback on the API Configuration PR, then working on it to get it merged before my the end of my last day of classes on Tuesday: 

One particular detail I need to follow up on is adjusting the above PR to take dbrenden's HTTP error changes into account, which were just merged into master. Aside from that, I'd like to write some good comments into the configuration code itself since there are a couple of outstanding issues related to the plugin framework that could be addressed by a later contributer.

Sunday 23 November 2014

Week 11

Nearing the end of term, and last week felt like the calm before a storm. A very big storm. I had two days off on monday and tuesday for the fall reading break, and used that extra time fairly effectively.

What I Worked On

I spent part of my reading week off-days looking into #654 and #658, issues related to the plugin configuration work I did earlier in the term. #654 was caused by not having a valid default value set for the USB source configuration's input property. 

My initial fix for #654 was to have the Configuration class call a method to find an appropriate default value when the Configuration instance is first created. However, this caused further issues because the method that detects compatible devices had OS-specific code in its body (see #658!). My final fix involved calling the method to detect a default input only if the plugin binary was being loaded and there wasn't already an input source selected by the user. The binary should only ever be called when the user is preparing to record and has already selected their plugins, and so no OS-incompatible plugin code should be run at that point. So far this seems to be working best.

Aside from the above issues, I also addressed some feedback for two PRs I had open at the end of last week related to both Freeseer's ProfileManager, and also to the json schemas I was adding to Freeseer's Configuration and Option classes: 

I managed to get both of those merged into master, which made it possible for me to get back to working on the Configuration API endpoints. I spent a fair amount of time on the endpoints, their unit tests, and various helper methods, and have working code for most of the configuration as described in the API doc:


See this PR for details:

Issues

The main issue i have run into, which is serious enough to block progress on a couple of the Configuration endpoints, is that Freeseer's PluginManager does not track instances for plugins.

1 - It's also currently not possible to determine which particular instance of a plugin is being used by an audio or videomixer from its configuration.
2 - PluginManager doesn't keep track of how many instances have been created for some plugin.
3 - There is no way to get all of the existing instances for a plugin from PluginManager.

These points are all ultimately related to this old issue:

What I Will be Working On

I will mostly be working on addressing feedback for #632, and on updating and editing the API configuration docs. Aside from the two endpoints that I cannot implement without larger changes to the PluginManager, the API configuration is currently in working condition and hopefully can still be used as a starting point for any further work related to making a headless Freeseer server.

Sunday 16 November 2014

Week 10

The past week was a particularly busy one due to the convergence of various assignments and a lot of additional work grading projects for the class that I TA. I wasn't able to get nearly as much done on Freeseer as I had hoped, although it wasn't a total loss since I did add to and improve two of the PRs that I have open.


What I Worked On

This week I mainly added to and responded to feedback on two pull requests I currently have open:

Expands ProfileManager and profile unit tests:

For this request I mostly just responded to feedback on the PR, renaming some methods, adding more unit tests for the new methods, etc.

Add schema methods to options and Config files:

I added code to produce 'default' properties in the Option schemas when options have their default values set. I moved the option-specific schema tests into the test classes for their individual Option classes. I created a test_float.py file to test FloatOptions, which was previously missing from the test suite. Aside from that, I mostly just adjusted code in response to feedback on the PR.


What I Will Be Working On

I was unable to get the above two PRs merged this past week, so this is my first priority for the coming week. Once both of these PRs are in, I can resume implementing the endpoints on the Configuration API here: 

Sunday 9 November 2014

Week 9

I could tell this week that we're getting into the late fall and nearing the end of the semester. Not from the weather, of course, since I spent all week sitting indoors at school: I could tell because my various class assignment deadlines are so unreasonably close together, and the labs are packed even on weekend nights. I always wonder why most classes seem to present about 50% of the assigned work in the last 25% of the term.

This means it's also the UCOSP home stretch! I spent this past week trying to implement features needed for the Configuration API that are missing from the Freeseer ProfileManager, as well as adding json-schemas to the Configuration and Option classes.


What I Worked On

Some of the functionality needed from Freeseer's ProfileManager for remote Configuration is missing, or just unimplemented: Listing profiles, deleting profiles, and explicit creation of Profiles. I extended the ProfileManager class to add this functionality so that it can then be used by the Configuration API. This work is here:


I then spent some time reading and learning about json-schema from here (http://json-schema.org/), so that I could add methods to both the Options and Config classes that returned their schemas. This functionality will be useful for the Configuration API, as it makes validation of a user's PATCH requests much simpler, and also makes it easy to tell a user what form their requests need to be made in. The work for json-schemas is here:



What I Will Be Working On

The first part of this week must unfortunately be a Freeseer-free time for me: I have two rather large assignments due on Monday and Wednesday, along with two smaller ones also due over the same two days (seriously, who schedules these things?!).

I plan on focusing on Freeseer starting on Thursday. Hopefully the two above pull requests can get merged by then, which means I can continue to focus on the Configuration API itself:

- Implementing all of the Profile endpoints.
- Add the json-schema validation to requests.
- Re-focus on implementing the plugin endpoints.
- Any accompanying unit tests.

The bolded item may require some further tweaking of Freeseer's Config and Option classes, as noted in my notes in the Config API spec:

Sunday 2 November 2014

Week 8

This past week felt like a breather compared to the previous, even if I did have assignments due on Monday and Wednesday. I also spent some extra time on TA duties, invigilating a term test on Monday night, then a 4 hour grading session on Thursday. Regardless, I was able to spend a fair amount of time on Freeseer over the course of the week.

What I Worked On


The first task I worked on was figuring out what code changes would be necessary to implement the profile endpoints. Freeseer's ProfileManager class is fairly simple and doesn't offer explicit methods for listing, creating, and deleting profiles.

Likewise, I looked over the endpoints specified in the Config API document and started listing any other potential code modifications required to implement them. You can see some of my annotations (although some are already resolved) on the doc:


Later in the week I started working on the implementation for the configuration controller. I focused mainly on the endpoints that don't require extra code modification, but also set up 'unimplemented' stubs for the others.

I also created a test_configuration.py file and started filling in some unit tests for each of the endpoints. Again, many of these simply test for the 'unimplemented' response for now, since the endpoints themselves are not yet coded. I had to spend a bit of reading time on practices for unit testing Flask apps, and going over the existing test_server code to figure out how to best test the configuration app.

All of the configuration work can be seen in this WIP pull request:


What I Will Be Working On


Over the next week I will continue to flesh out both the unit tests and the implementation code for the configuration api. 

If I have extra time, I may return to an issue I ran into while originally refactoring plugins that required ChoiceOptions, since it affects both the configuration API and possibly also the issue I opened last week:

I initially explained the issue with ChoiceOption plugins and unsupported devices in this doc:


Sunday 26 October 2014

Week 7

This past week was the busiest school week yet. Midterms really threw a wrench in my usual plans for managing the workload. I also happen to have assignments due on the first three days of the coming week, so I have spent all of the weekend at home doing work. That said, my schedule looks like it's clearing up a little after Wednesday, so I may actually get to spend next weekend doing something other than schoolwork!


What I Worked On

Earlier in the week I met with mtomwing over IRC and got some excellent feedback on the Configuration API draft that I started writing a couple of weeks ago. I reworked most of the Configuration endpoints based on his feedback. These can be seen here:


Later in the week, I spent some time debugging an issue with the refactored plugins code where different instances of a plugin were being saved under the same section in the plugin.conf file. I fixed that issue, made a few other suggested changes and improvements, and the plugins refactoring PR was merged into master! 

While testing the plugins code I also discovered a quirk with the plugin settings widgets: hitting 'close' on a settings window does not save the configuration, so for some of the plugins the default settings shown in their config widgets don't match the settings actually written to file until the user actively changes them. I opened an issue with a more detailed description:


What I Will be Working On

This week I want to prioritize work on the Configuration API, as I think there will probably be many details to work out once I start delving into implementation.

I would also like to have another look at https://github.com/Freeseer/freeseer/issues/636 to see if it's possible to improve the plugin widgets by adding config.save() callback methods to their close buttons.

Saturday 18 October 2014

Week 6

This felt like a very short week: probably because we had our last meeting on tuesday due to Thanksgiving weekend travel plans. It also happened to be a very busy week for me in terms of assignments, so I can't say I got as much done for Freeseer as I would have liked.


What I Worked On


Plugins

I made some changes to the plugin refactoring PR after receiving some feedback:


Configuration API Spec

I made a few changes to several endpoints in the spec. The biggest change being that I completely separated the endpoints for viewing/setting the configuration profile from the endpoints that cover the configuration itself.

The spec draft can be viewed here:


Flask and Configuration

I spent some time reading about flask (http://flask.pocoo.org/), and going over the existing recording.py and server.py code. I started experimenting on the configuration controller implementation, and opened a WIP pull request to keep track of these experiments: https://github.com/Freeseer/freeseer/pull/632

Issues

I encountered a unit test failure while testing some of my plugin configuration changes. Strangely enough, it was related to the server tests using the user's real configuration dir and not at all related to the plugins. I opened an issue for it: https://github.com/Freeseer/freeseer/issues/629


What I Will Be Working On

I will mostly be working on the configuration.py controller and some of the related functionality. 

An enhancement I would like to see for the Config classes is to have a method that returns the Config's options wrapped as key-value pairs in a dictionary. ChoiceOption classes could be represented as a list of available options plus its selected one. This will make the implementation of the configuration endpoints much cleaner and straight-forward. I may tackle this over the next week, since it makes sense to have this enhancement before going too deep into implementing the configuration back end.

Next week also happens to be particularly busy again due to midterms and a nasty assignment due date, so I may not get much time to work on Freeseer until later in the week: probably friday and saturday. However, I will check for and respond to any feedback I get on the config API spec.