{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/whitehall/pulls/comments/81712851","pull_request_review_id":2671874,"id":81712851,"diff_hunk":"@@ -33,9 +33,8 @@ def fire_transition!\n     unwithdrawn_edition.minor_change = true\n     unwithdrawn_edition.editorial_remarks << EditorialRemark.create(author: user, edition: edition, body: \"Unwithdrawn\")\n \n-    Edition::AuditTrail.acting_as(user) do\n-      Whitehall.edition_services.force_publisher(unwithdrawn_edition).perform!\n-    end\n+    EditionForcePublisher.new(unwithdrawn_edition).send(:prepare_edition)","path":"app/services/edition_unwithdrawer.rb","position":13,"original_position":13,"commit_id":"3a006edf510648eb310801d5fccde254b02edac1","original_commit_id":"3a006edf510648eb310801d5fccde254b02edac1","user":{"login":"mgrassotti","id":6908677,"avatar_url":"https://avatars.githubusercontent.com/u/6908677?v=3","gravatar_id":"","url":"https://api.github.com/users/mgrassotti","html_url":"https://github.com/mgrassotti","followers_url":"https://api.github.com/users/mgrassotti/followers","following_url":"https://api.github.com/users/mgrassotti/following{/other_user}","gists_url":"https://api.github.com/users/mgrassotti/gists{/gist_id}","starred_url":"https://api.github.com/users/mgrassotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgrassotti/subscriptions","organizations_url":"https://api.github.com/users/mgrassotti/orgs","repos_url":"https://api.github.com/users/mgrassotti/repos","events_url":"https://api.github.com/users/mgrassotti/events{/privacy}","received_events_url":"https://api.github.com/users/mgrassotti/received_events","type":"User","site_admin":false},"body":"I see... the problem is that these calls should be done on `unwithdrawn_edition` and not on `edition`, which is the default target for each of these methods, so a new object should instantiated anyway with `unwithdrawn_edition`.\r\nAlso I am not sure that `EditionUnwithdrawer` should inherit from `EditionPublisher`, nor from `EditionForcePublisher`. Maybe it should simply inherit from `EditionService` as in master.","created_at":"2016-10-04T09:00:00Z","updated_at":"2016-10-04T09:00:00Z","html_url":"https://github.com/alphagov/whitehall/pull/2745#discussion_r81712851","pull_request_url":"https://api.github.com/repos/alphagov/whitehall/pulls/2745","_links":{"self":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/comments/81712851"},"html":{"href":"https://github.com/alphagov/whitehall/pull/2745#discussion_r81712851"},"pull_request":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/2745"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/whitehall/pulls/2745","id":84453303,"html_url":"https://github.com/alphagov/whitehall/pull/2745","diff_url":"https://github.com/alphagov/whitehall/pull/2745.diff","patch_url":"https://github.com/alphagov/whitehall/pull/2745.patch","issue_url":"https://api.github.com/repos/alphagov/whitehall/issues/2745","number":2745,"state":"open","locked":false,"title":"Fix documents unwithdrawing","user":{"login":"mgrassotti","id":6908677,"avatar_url":"https://avatars.githubusercontent.com/u/6908677?v=3","gravatar_id":"","url":"https://api.github.com/users/mgrassotti","html_url":"https://github.com/mgrassotti","followers_url":"https://api.github.com/users/mgrassotti/followers","following_url":"https://api.github.com/users/mgrassotti/following{/other_user}","gists_url":"https://api.github.com/users/mgrassotti/gists{/gist_id}","starred_url":"https://api.github.com/users/mgrassotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgrassotti/subscriptions","organizations_url":"https://api.github.com/users/mgrassotti/orgs","repos_url":"https://api.github.com/users/mgrassotti/repos","events_url":"https://api.github.com/users/mgrassotti/events{/privacy}","received_events_url":"https://api.github.com/users/mgrassotti/received_events","type":"User","site_admin":false},"body":"Trello: https://trello.com/c/6AUwUK9X/473-re-publishing-unwithdrawing-content-not-reflecting-for-certain-whitehall-formats-medium\r\n\r\nThe ForcePublisher service, called during unwithdrawing, generated a new transaction, which was competing with the unwithdrawn edition saving. The unwanted consequence of that was that the content was not unwithdrawn and the withdrawn notice was still visible on the public page.\r\n\r\nWe are now performing the unwithdrawing as an additional event, listened by PublishingApiPusher, instead of using the ForcePublisher.\r\n\r\nNow if an editor publishes content on the website, withdraw the content and then re-publishes (unwithdraws) the content again, the withdraw notice should not be displayed anymore. \r\n\r\nThis was happening on some Whitehall migrated formats, such as Detailed Guides and Case Studies.","created_at":"2016-09-08T10:36:59Z","updated_at":"2016-10-04T09:00:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6aa847af3ffbdc4074ecce993be4d029da6af0e7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/whitehall/pulls/2745/commits","review_comments_url":"https://api.github.com/repos/alphagov/whitehall/pulls/2745/comments","review_comment_url":"https://api.github.com/repos/alphagov/whitehall/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/whitehall/issues/2745/comments","statuses_url":"https://api.github.com/repos/alphagov/whitehall/statuses/3a006edf510648eb310801d5fccde254b02edac1","head":{"label":"alphagov:fix-unwithdrawing","ref":"fix-unwithdrawing","sha":"3a006edf510648eb310801d5fccde254b02edac1","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-10-02T14:41:27Z","pushed_at":"2016-10-04T08:31:13Z","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":247163,"stargazers_count":364,"watchers_count":364,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":145,"mirror_url":null,"open_issues_count":7,"forks":145,"open_issues":7,"watchers":364,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"be7e6f4f46525aaf606ff3bc2d66b454c04becce","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-10-02T14:41:27Z","pushed_at":"2016-10-04T08:31:13Z","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":247163,"stargazers_count":364,"watchers_count":364,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":145,"mirror_url":null,"open_issues_count":7,"forks":145,"open_issues":7,"watchers":364,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/2745"},"html":{"href":"https://github.com/alphagov/whitehall/pull/2745"},"issue":{"href":"https://api.github.com/repos/alphagov/whitehall/issues/2745"},"comments":{"href":"https://api.github.com/repos/alphagov/whitehall/issues/2745/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/2745/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/2745/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/whitehall/statuses/3a006edf510648eb310801d5fccde254b02edac1"}}}}
{"actor":{"display_login":"mgrassotti"}}