{"action":"created","issue":{"url":"https://api.github.com/repos/deanishe/alfred-workflow/issues/55","repository_url":"https://api.github.com/repos/deanishe/alfred-workflow","labels_url":"https://api.github.com/repos/deanishe/alfred-workflow/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/deanishe/alfred-workflow/issues/55/comments","events_url":"https://api.github.com/repos/deanishe/alfred-workflow/issues/55/events","html_url":"https://github.com/deanishe/alfred-workflow/issues/55","id":52612046,"number":55,"title":"The big V2 refactoring and API thread","user":{"login":"deanishe","id":747913,"avatar_url":"https://avatars.githubusercontent.com/u/747913?v=3","gravatar_id":"","url":"https://api.github.com/users/deanishe","html_url":"https://github.com/deanishe","followers_url":"https://api.github.com/users/deanishe/followers","following_url":"https://api.github.com/users/deanishe/following{/other_user}","gists_url":"https://api.github.com/users/deanishe/gists{/gist_id}","starred_url":"https://api.github.com/users/deanishe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deanishe/subscriptions","organizations_url":"https://api.github.com/users/deanishe/orgs","repos_url":"https://api.github.com/users/deanishe/repos","events_url":"https://api.github.com/users/deanishe/events{/privacy}","received_events_url":"https://api.github.com/users/deanishe/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/deanishe/alfred-workflow/labels/v2.0","name":"v2.0","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":62,"created_at":"2014-12-22T01:02:29Z","updated_at":"2016-03-04T18:06:17Z","closed_at":null,"body":"A significant refactoring of Alfred-Workflow is long overdue. The `Workflow` class has grown very large and the unittests are a horror show, largely due to the necessity of a workflow-like environment to run them in.\r\n\r\nI'd love to hear your ideas on how the library should be refactored and how the API should be changed.\r\n\r\nMy thoughts so far:\r\n\r\n### Refactoring\r\n\r\n- Move all the code that requires a workflow environment (`info.plist` or `version` files, Alfred environmental variables) to its own module(s).\r\n- Split the different feature groups of `Workflow` into separate modules (data storage and cache functions, settings, filtering, text processing, serialisation etc.).\r\n- Generalise the update API, so other backends (e.g. RSS, Packal) can be added easily.\r\n- Add lots of mocking to unittests, especially to return canned HTTP responses and avoid hitting web APIs.\r\n\r\n### API changes\r\n\r\n- Change default `max_age` to 0 in `Workflow.cached_data()`, so cached data is always returned regardless of age by default.\r\n- Move `version` from `update_settings` dict to a `Workflow` argument (as an alternative to `version` file).\r\n- (Possibly) allow `filter()` to be called with an empty `query`, whereupon it will return all `items`. This would mirror the way the built-in Python `filter()` function works, and allow @smargh to not bother checking whether `query` is empty.\r\n\r\nPaging @smargh @fniephaus @owenwater :grinning: \r\n"},"comment":{"url":"https://api.github.com/repos/deanishe/alfred-workflow/issues/comments/192386381","html_url":"https://github.com/deanishe/alfred-workflow/issues/55#issuecomment-192386381","issue_url":"https://api.github.com/repos/deanishe/alfred-workflow/issues/55","id":192386381,"user":{"login":"idpaterson","id":507058,"avatar_url":"https://avatars.githubusercontent.com/u/507058?v=3","gravatar_id":"","url":"https://api.github.com/users/idpaterson","html_url":"https://github.com/idpaterson","followers_url":"https://api.github.com/users/idpaterson/followers","following_url":"https://api.github.com/users/idpaterson/following{/other_user}","gists_url":"https://api.github.com/users/idpaterson/gists{/gist_id}","starred_url":"https://api.github.com/users/idpaterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idpaterson/subscriptions","organizations_url":"https://api.github.com/users/idpaterson/orgs","repos_url":"https://api.github.com/users/idpaterson/repos","events_url":"https://api.github.com/users/idpaterson/events{/privacy}","received_events_url":"https://api.github.com/users/idpaterson/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T18:06:17Z","updated_at":"2016-03-04T18:06:17Z","body":"That is reassuring. From the screenshot it looks like primarily changes within the info.plist but I'm looking forward to learning more as it is unveiled on the blog over the coming weeks."}}