{"action":"opened","number":2852,"pull_request":{"url":"https://api.github.com/repos/alphagov/whitehall/pulls/2852","id":94800153,"html_url":"https://github.com/alphagov/whitehall/pull/2852","diff_url":"https://github.com/alphagov/whitehall/pull/2852.diff","patch_url":"https://github.com/alphagov/whitehall/pull/2852.patch","issue_url":"https://api.github.com/repos/alphagov/whitehall/issues/2852","number":2852,"state":"open","locked":false,"title":"Refactor some of the rummager indexing code","user":{"login":"MatMoore","id":87579,"avatar_url":"https://avatars.githubusercontent.com/u/87579?v=3","gravatar_id":"","url":"https://api.github.com/users/MatMoore","html_url":"https://github.com/MatMoore","followers_url":"https://api.github.com/users/MatMoore/followers","following_url":"https://api.github.com/users/MatMoore/following{/other_user}","gists_url":"https://api.github.com/users/MatMoore/gists{/gist_id}","starred_url":"https://api.github.com/users/MatMoore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatMoore/subscriptions","organizations_url":"https://api.github.com/users/MatMoore/orgs","repos_url":"https://api.github.com/users/MatMoore/repos","events_url":"https://api.github.com/users/MatMoore/events{/privacy}","received_events_url":"https://api.github.com/users/MatMoore/received_events","type":"User","site_admin":false},"body":"The aim is to get rid of the searchable mixin and create presenter\r\nclasses that can be used with gds-api-adapters instead of rummageable.\r\n\r\nThe search indexing code has two ways of doing the same thing and both\r\nrely on a deprecated gem (rummageable). Normally we index content via\r\nthe sidekiq workers, but some rake tasks skip this and run the indexing\r\nsynchronously.\r\n\r\nThe indexing code is also very intertwined with the model code at\r\nthe moment - it would be easier to work with if we could separate\r\nthis logic out, as we have done for publishing api.\r\n\r\nI think this is worth addressing now because the existing code is so\r\nunintutive. `#search_index` is not a search index - it's a collection\r\nof payloads for rummager.\r\n\r\nAt some point in the future I expect us to get to be able to index all\r\ncontent directly from the publishing platform and this integration can\r\ngo away - but this is not going to happen soon.\r\n\r\nThis commit moves rummager functionality out of the \"Whitehall\" module.\r\nI've moved methods for generating rummager payloads for multiple content\r\nitems to a new SearchPresenters namespace. I decided not to define the\r\nnames of the indexes here - I've moved that to the\r\nWhitehall::SearchIndex class instead. This entire class should be\r\nremoved and replaced with GDS API adapters.\r\n\r\nSearchPresenters also contains the logic for deciding which classes go\r\nto which index - which is mostly pointless because DetailedGuides is the\r\nonly exception and there is no longer any meaningful distinction between\r\nhow the indexes are used. At some point these will be combined.  The\r\nonly other place that reference these methods is a `rummager_export.rb`\r\nscript.  I suspect this script is not useful anymore either but I've\r\nleft it alone for now.\r\n\r\nI've also changed some Plek calls to use `rummager` rather than\r\n`search` since the `search` vhost is deprecated: see also\r\nhttps://github.com/alphagov/gds-api-adapters/commit/ddae94d1656f59f7778ca794a0cce356fc75e7e2\r\n\r\nThis commit leaves behind all the `#search_index` methods in the models,\r\nthat present a single content item to rummager. That should be addressed\r\nin a separate PR.\r\n\r\nhttps://trello.com/c/BvriiajH/328-whitehall-search-indexing-tech-debt","created_at":"2016-11-22T11:59:42Z","updated_at":"2016-11-22T11:59:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/whitehall/pulls/2852/commits","review_comments_url":"https://api.github.com/repos/alphagov/whitehall/pulls/2852/comments","review_comment_url":"https://api.github.com/repos/alphagov/whitehall/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/whitehall/issues/2852/comments","statuses_url":"https://api.github.com/repos/alphagov/whitehall/statuses/76962e48f53b0c8f4297fe1eb9ba6405fe4f6cf7","head":{"label":"alphagov:search_index_is_not_a_search_index","ref":"search_index_is_not_a_search_index","sha":"76962e48f53b0c8f4297fe1eb9ba6405fe4f6cf7","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":2416064,"name":"whitehall","full_name":"alphagov/whitehall","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/whitehall","description":"Rails application that serves most pages on www.gov.uk/government","fork":false,"url":"https://api.github.com/repos/alphagov/whitehall","forks_url":"https://api.github.com/repos/alphagov/whitehall/forks","keys_url":"https://api.github.com/repos/alphagov/whitehall/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/whitehall/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/whitehall/teams","hooks_url":"https://api.github.com/repos/alphagov/whitehall/hooks","issue_events_url":"https://api.github.com/repos/alphagov/whitehall/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/whitehall/events","assignees_url":"https://api.github.com/repos/alphagov/whitehall/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/whitehall/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/whitehall/tags","blobs_url":"https://api.github.com/repos/alphagov/whitehall/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/whitehall/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/whitehall/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/whitehall/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/whitehall/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/whitehall/languages","stargazers_url":"https://api.github.com/repos/alphagov/whitehall/stargazers","contributors_url":"https://api.github.com/repos/alphagov/whitehall/contributors","subscribers_url":"https://api.github.com/repos/alphagov/whitehall/subscribers","subscription_url":"https://api.github.com/repos/alphagov/whitehall/subscription","commits_url":"https://api.github.com/repos/alphagov/whitehall/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/whitehall/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/whitehall/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/whitehall/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/whitehall/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/whitehall/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/whitehall/merges","archive_url":"https://api.github.com/repos/alphagov/whitehall/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/whitehall/downloads","issues_url":"https://api.github.com/repos/alphagov/whitehall/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/whitehall/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/whitehall/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/whitehall/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/whitehall/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/whitehall/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/whitehall/deployments","created_at":"2011-09-19T15:10:49Z","updated_at":"2016-11-21T10:14:00Z","pushed_at":"2016-11-22T11:59:17Z","git_url":"git://github.com/alphagov/whitehall.git","ssh_url":"git@github.com:alphagov/whitehall.git","clone_url":"https://github.com/alphagov/whitehall.git","svn_url":"https://github.com/alphagov/whitehall","homepage":"","size":247861,"stargazers_count":371,"watchers_count":371,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":148,"mirror_url":null,"open_issues_count":11,"forks":148,"open_issues":11,"watchers":371,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"e5ec9b3b5ce8ab7d872d8cd44a6035a3b150a7e1","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":2416064,"name":"whitehall","full_name":"alphagov/whitehall","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/whitehall","description":"Rails application that serves most pages on www.gov.uk/government","fork":false,"url":"https://api.github.com/repos/alphagov/whitehall","forks_url":"https://api.github.com/repos/alphagov/whitehall/forks","keys_url":"https://api.github.com/repos/alphagov/whitehall/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/whitehall/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/whitehall/teams","hooks_url":"https://api.github.com/repos/alphagov/whitehall/hooks","issue_events_url":"https://api.github.com/repos/alphagov/whitehall/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/whitehall/events","assignees_url":"https://api.github.com/repos/alphagov/whitehall/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/whitehall/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/whitehall/tags","blobs_url":"https://api.github.com/repos/alphagov/whitehall/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/whitehall/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/whitehall/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/whitehall/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/whitehall/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/whitehall/languages","stargazers_url":"https://api.github.com/repos/alphagov/whitehall/stargazers","contributors_url":"https://api.github.com/repos/alphagov/whitehall/contributors","subscribers_url":"https://api.github.com/repos/alphagov/whitehall/subscribers","subscription_url":"https://api.github.com/repos/alphagov/whitehall/subscription","commits_url":"https://api.github.com/repos/alphagov/whitehall/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/whitehall/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/whitehall/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/whitehall/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/whitehall/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/whitehall/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/whitehall/merges","archive_url":"https://api.github.com/repos/alphagov/whitehall/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/whitehall/downloads","issues_url":"https://api.github.com/repos/alphagov/whitehall/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/whitehall/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/whitehall/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/whitehall/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/whitehall/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/whitehall/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/whitehall/deployments","created_at":"2011-09-19T15:10:49Z","updated_at":"2016-11-21T10:14:00Z","pushed_at":"2016-11-22T11:59:17Z","git_url":"git://github.com/alphagov/whitehall.git","ssh_url":"git@github.com:alphagov/whitehall.git","clone_url":"https://github.com/alphagov/whitehall.git","svn_url":"https://github.com/alphagov/whitehall","homepage":"","size":247861,"stargazers_count":371,"watchers_count":371,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":148,"mirror_url":null,"open_issues_count":11,"forks":148,"open_issues":11,"watchers":371,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/2852"},"html":{"href":"https://github.com/alphagov/whitehall/pull/2852"},"issue":{"href":"https://api.github.com/repos/alphagov/whitehall/issues/2852"},"comments":{"href":"https://api.github.com/repos/alphagov/whitehall/issues/2852/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/2852/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/2852/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/whitehall/statuses/76962e48f53b0c8f4297fe1eb9ba6405fe4f6cf7"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":102,"deletions":104,"changed_files":9}}
{"actor":{"display_login":"MatMoore"}}