{"action":"created","issue":{"url":"https://api.github.com/repos/alphagov/content-store/issues/153","labels_url":"https://api.github.com/repos/alphagov/content-store/issues/153/labels{/name}","comments_url":"https://api.github.com/repos/alphagov/content-store/issues/153/comments","events_url":"https://api.github.com/repos/alphagov/content-store/issues/153/events","html_url":"https://github.com/alphagov/content-store/pull/153","id":111172740,"number":153,"title":"Fix inconsistent redirects for policies","user":{"login":"tijmenb","id":233676,"avatar_url":"https://avatars.githubusercontent.com/u/233676?v=3","gravatar_id":"","url":"https://api.github.com/users/tijmenb","html_url":"https://github.com/tijmenb","followers_url":"https://api.github.com/users/tijmenb/followers","following_url":"https://api.github.com/users/tijmenb/following{/other_user}","gists_url":"https://api.github.com/users/tijmenb/gists{/gist_id}","starred_url":"https://api.github.com/users/tijmenb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tijmenb/subscriptions","organizations_url":"https://api.github.com/users/tijmenb/orgs","repos_url":"https://api.github.com/users/tijmenb/repos","events_url":"https://api.github.com/users/tijmenb/events{/privacy}","received_events_url":"https://api.github.com/users/tijmenb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-13T12:47:16Z","updated_at":"2015-10-13T13:17:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/alphagov/content-store/pulls/153","html_url":"https://github.com/alphagov/content-store/pull/153","diff_url":"https://github.com/alphagov/content-store/pull/153.diff","patch_url":"https://github.com/alphagov/content-store/pull/153.patch"},"body":"In New World Publishing, applications send content to the publishing-api, which forwards it to the content-store and also registers routes for the document with the router-api.\r\n\r\nHowever, in the past apps have sent routes directly to router-api. This has happened frequently when setting up redirects.\r\n\r\nIt means we have a bunch of routes in the router for which either no content items exist, or for which the content item doesn't match the content item. \r\n\r\nThe rake task added in the first commit is used to find a subset of the last case. It finds policies with format \"placeholder\" in the content-store that are actually redirects. The outputted information is used to bring the database up-to-date by turning the content items into [proper redirect content items](https://github.com/alphagov/content-store/blob/master/doc/redirect_item.md).\r\n\r\nI've extracted the `InconsistentRedirectFinder` to enable us to re-use the code to fix other inconsistent redirects. The `rake data_hygiene:inconstent_policy_redirects` task is temporary and will be removed once we've fixed them.\r\n\r\nThe motive to fix the policies now is that they have duplicate content_ids and we need to fix that for tagging.\r\n\r\nTrello: https://trello.com/c/fhz6hWaA/367-fix-duplicate-content-id-for-policies\r\n"},"comment":{"url":"https://api.github.com/repos/alphagov/content-store/issues/comments/147711249","html_url":"https://github.com/alphagov/content-store/pull/153#issuecomment-147711249","issue_url":"https://api.github.com/repos/alphagov/content-store/issues/153","id":147711249,"user":{"login":"tijmenb","id":233676,"avatar_url":"https://avatars.githubusercontent.com/u/233676?v=3","gravatar_id":"","url":"https://api.github.com/users/tijmenb","html_url":"https://github.com/tijmenb","followers_url":"https://api.github.com/users/tijmenb/followers","following_url":"https://api.github.com/users/tijmenb/following{/other_user}","gists_url":"https://api.github.com/users/tijmenb/gists{/gist_id}","starred_url":"https://api.github.com/users/tijmenb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tijmenb/subscriptions","organizations_url":"https://api.github.com/users/tijmenb/orgs","repos_url":"https://api.github.com/users/tijmenb/repos","events_url":"https://api.github.com/users/tijmenb/events{/privacy}","received_events_url":"https://api.github.com/users/tijmenb/received_events","type":"User","site_admin":false},"created_at":"2015-10-13T13:17:59Z","updated_at":"2015-10-13T13:17:59Z","body":"Since I've also added https://github.com/alphagov/content-store/commit/afe84fa60f6404dded1331bac9be8a2d5e3e529d, I've updated PR title + description."}}