{"action":"created","issue":{"url":"https://api.github.com/repos/alphagov/whitehall/issues/3825","repository_url":"https://api.github.com/repos/alphagov/whitehall","labels_url":"https://api.github.com/repos/alphagov/whitehall/issues/3825/labels{/name}","comments_url":"https://api.github.com/repos/alphagov/whitehall/issues/3825/comments","events_url":"https://api.github.com/repos/alphagov/whitehall/issues/3825/events","html_url":"https://github.com/alphagov/whitehall/pull/3825","id":301439137,"number":3825,"title":"Set parent_document_url when updating attachments","user":{"login":"chrisroos","id":6556,"avatar_url":"https://avatars2.githubusercontent.com/u/6556?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisroos","html_url":"https://github.com/chrisroos","followers_url":"https://api.github.com/users/chrisroos/followers","following_url":"https://api.github.com/users/chrisroos/following{/other_user}","gists_url":"https://api.github.com/users/chrisroos/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisroos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisroos/subscriptions","organizations_url":"https://api.github.com/users/chrisroos/orgs","repos_url":"https://api.github.com/users/chrisroos/repos","events_url":"https://api.github.com/users/chrisroos/events{/privacy}","received_events_url":"https://api.github.com/users/chrisroos/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"floehopper","id":3169,"avatar_url":"https://avatars2.githubusercontent.com/u/3169?v=4","gravatar_id":"","url":"https://api.github.com/users/floehopper","html_url":"https://github.com/floehopper","followers_url":"https://api.github.com/users/floehopper/followers","following_url":"https://api.github.com/users/floehopper/following{/other_user}","gists_url":"https://api.github.com/users/floehopper/gists{/gist_id}","starred_url":"https://api.github.com/users/floehopper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floehopper/subscriptions","organizations_url":"https://api.github.com/users/floehopper/orgs","repos_url":"https://api.github.com/users/floehopper/repos","events_url":"https://api.github.com/users/floehopper/events{/privacy}","received_events_url":"https://api.github.com/users/floehopper/received_events","type":"User","site_admin":false},"assignees":[{"login":"floehopper","id":3169,"avatar_url":"https://avatars2.githubusercontent.com/u/3169?v=4","gravatar_id":"","url":"https://api.github.com/users/floehopper","html_url":"https://github.com/floehopper","followers_url":"https://api.github.com/users/floehopper/followers","following_url":"https://api.github.com/users/floehopper/following{/other_user}","gists_url":"https://api.github.com/users/floehopper/gists{/gist_id}","starred_url":"https://api.github.com/users/floehopper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floehopper/subscriptions","organizations_url":"https://api.github.com/users/floehopper/orgs","repos_url":"https://api.github.com/users/floehopper/repos","events_url":"https://api.github.com/users/floehopper/events{/privacy}","received_events_url":"https://api.github.com/users/floehopper/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-03-01T15:07:52Z","updated_at":"2018-03-07T16:12:23Z","closed_at":"2018-03-07T16:12:09Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/alphagov/whitehall/pulls/3825","html_url":"https://github.com/alphagov/whitehall/pull/3825","diff_url":"https://github.com/alphagov/whitehall/pull/3825.diff","patch_url":"https://github.com/alphagov/whitehall/pull/3825.patch"},"body":"Send parent_document_url to AM on publication of docs\r\n\r\nA `Link` header, containing the URL of an attachment's parent document,\r\nwas added to Whitehall attachments in\r\nhttps://github.com/alphagov/whitehall/pull/2202, so that:\r\n\r\n> the cover sheet for an attachment is easily discoverable by crawlers and\r\n> other clients, we should surface the attachment edition's public URL via\r\n> HTTP headers.\r\n\r\nWe need to send the value of the attachment's parent URL to to Asset\r\nManager so that we can continue setting the `Link` header once we're\r\nserving Whitehall attachments from Asset Manager.\r\n\r\nMy implementation differs slightly from that in Whitehall. In Whitehall\r\nthe `Link` header will be set irrespective of whether a document (and\r\ntherefore its attachments) is draft or public. My interpretation of PR\r\n #2202 is that it's unnecessary to set it for draft documents as they're\r\nnot publicly accessible to clients such as web crawlers. As such, I've\r\ndecided to send the `parent_document_url` to Asset Manager at the time a\r\ndocument is published in Whitehall.\r\n\r\nIt's not obvious that it's possible to change the URL of a published\r\ndocument but if it is, and if the change in URL doesn't result in a\r\nredirect from the old to the new, then we might need to add something to\r\nhandle that."},"comment":{"url":"https://api.github.com/repos/alphagov/whitehall/issues/comments/371190527","html_url":"https://github.com/alphagov/whitehall/pull/3825#issuecomment-371190527","issue_url":"https://api.github.com/repos/alphagov/whitehall/issues/3825","id":371190527,"user":{"login":"chrisroos","id":6556,"avatar_url":"https://avatars2.githubusercontent.com/u/6556?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisroos","html_url":"https://github.com/chrisroos","followers_url":"https://api.github.com/users/chrisroos/followers","following_url":"https://api.github.com/users/chrisroos/following{/other_user}","gists_url":"https://api.github.com/users/chrisroos/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisroos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisroos/subscriptions","organizations_url":"https://api.github.com/users/chrisroos/orgs","repos_url":"https://api.github.com/users/chrisroos/repos","events_url":"https://api.github.com/users/chrisroos/events{/privacy}","received_events_url":"https://api.github.com/users/chrisroos/received_events","type":"User","site_admin":false},"created_at":"2018-03-07T16:12:23Z","updated_at":"2018-03-07T16:12:23Z","author_association":"CONTRIBUTOR","body":"Thanks @floehopper. I've addressed your feedback, rebased on master and merged."}}
{"actor":{"display_login":"chrisroos"}}