{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/kitsune/issues/2683","labels_url":"https://api.github.com/repos/mozilla/kitsune/issues/2683/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/kitsune/issues/2683/comments","events_url":"https://api.github.com/repos/mozilla/kitsune/issues/2683/events","html_url":"https://github.com/mozilla/kitsune/pull/2683","id":111894888,"number":2683,"title":"[bug 1215110] Refactor simple and advanced search","user":{"login":"willkg","id":820826,"avatar_url":"https://avatars.githubusercontent.com/u/820826?v=3","gravatar_id":"","url":"https://api.github.com/users/willkg","html_url":"https://github.com/willkg","followers_url":"https://api.github.com/users/willkg/followers","following_url":"https://api.github.com/users/willkg/following{/other_user}","gists_url":"https://api.github.com/users/willkg/gists{/gist_id}","starred_url":"https://api.github.com/users/willkg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willkg/subscriptions","organizations_url":"https://api.github.com/users/willkg/orgs","repos_url":"https://api.github.com/users/willkg/repos","events_url":"https://api.github.com/users/willkg/events{/privacy}","received_events_url":"https://api.github.com/users/willkg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-10-16T19:21:32Z","updated_at":"2015-11-06T18:17:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla/kitsune/pulls/2683","html_url":"https://github.com/mozilla/kitsune/pull/2683","diff_url":"https://github.com/mozilla/kitsune/pull/2683.diff","patch_url":"https://github.com/mozilla/kitsune/pull/2683.patch"},"body":"* centralize duplicate code to both get it out of the way and also make\r\n  it easier to reason about\r\n* remove intermediary variables that aren't needed\r\n* clean up comments\r\n* reduce complexity\r\n\r\nThis is a work in progress. I'm doing a bunch of yak-shaving here and fiddling with things and want to make sure the way things compose makes sense.\r\n\r\nThis mostly adjusts `simple_search`. I haven't really gotten into overhauling `advanced_search`, yet. That's partially because I want to make sure the work I've done on `simple_search` makes sense. Then I'll do similar things to `advanced_search` and other search code.\r\n\r\nFeedback?"},"comment":{"url":"https://api.github.com/repos/mozilla/kitsune/issues/comments/154490808","html_url":"https://github.com/mozilla/kitsune/pull/2683#issuecomment-154490808","issue_url":"https://api.github.com/repos/mozilla/kitsune/issues/2683","id":154490808,"user":{"login":"willkg","id":820826,"avatar_url":"https://avatars.githubusercontent.com/u/820826?v=3","gravatar_id":"","url":"https://api.github.com/users/willkg","html_url":"https://github.com/willkg","followers_url":"https://api.github.com/users/willkg/followers","following_url":"https://api.github.com/users/willkg/following{/other_user}","gists_url":"https://api.github.com/users/willkg/gists{/gist_id}","starred_url":"https://api.github.com/users/willkg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willkg/subscriptions","organizations_url":"https://api.github.com/users/willkg/orgs","repos_url":"https://api.github.com/users/willkg/repos","events_url":"https://api.github.com/users/willkg/events{/privacy}","received_events_url":"https://api.github.com/users/willkg/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T18:17:46Z","updated_at":"2015-11-06T18:17:46Z","body":"^^^ That adds some tests for the json bits some of which were taken from old code and moved around.\r\n\r\nI didn't add a test for `build_results_list` since the unit tests for those views tests that pretty heavily. It didn't seem like it made a lot of sense to test it on its own and the setup would have been involved.\r\n\r\nIncidentally, there's a `json_view` view decorator. At some point, we might want to unify that with some of the json stuff in these views. That could clean things up. It's also possible that the code is still too tangled for that to be wildly helpful. Amongst other things, the context data that gets generated differs greatly between json and html output.\r\n\r\nAnyhow, stuff to think about some other day."}}