{"action":"created","issue":{"url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/4385","repository_url":"https://api.github.com/repos/cfpb/cfgov-refresh","labels_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/4385/labels{/name}","comments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/4385/comments","events_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/4385/events","html_url":"https://github.com/cfpb/cfgov-refresh/pull/4385","id":345307538,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0NDk0MTQ2","number":4385,"title":"Create Media to ContentImage data migration","user":{"login":"Scotchester","id":1044670,"node_id":"MDQ6VXNlcjEwNDQ2NzA=","avatar_url":"https://avatars3.githubusercontent.com/u/1044670?v=4","gravatar_id":"","url":"https://api.github.com/users/Scotchester","html_url":"https://github.com/Scotchester","followers_url":"https://api.github.com/users/Scotchester/followers","following_url":"https://api.github.com/users/Scotchester/following{/other_user}","gists_url":"https://api.github.com/users/Scotchester/gists{/gist_id}","starred_url":"https://api.github.com/users/Scotchester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scotchester/subscriptions","organizations_url":"https://api.github.com/users/Scotchester/orgs","repos_url":"https://api.github.com/users/Scotchester/repos","events_url":"https://api.github.com/users/Scotchester/events{/privacy}","received_events_url":"https://api.github.com/users/Scotchester/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-27T17:32:31Z","updated_at":"2018-08-03T16:09:01Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/4385","html_url":"https://github.com/cfpb/cfgov-refresh/pull/4385","diff_url":"https://github.com/cfpb/cfgov-refresh/pull/4385.diff","patch_url":"https://github.com/cfpb/cfgov-refresh/pull/4385.patch"},"body":"The new unified `ContentImage` block was created in #4177, leaving the original full-width Media in place until a data migration could be written. This is that data migration.\r\n\r\n## Additions\r\n\r\n- Data migration to migrate all content that used to go in `FullWidthText` `media` fields into `image_inset` fields (old name, but now refer to the  `ContentImage' block – see the todos below).\r\n- A test for said data migration\r\n\r\n## Testing\r\n\r\n_Remember: When looking at images from a production dump in the local Wagtail admin, you won't see the actual images, but all the metadata should be there._\r\n\r\n1. Open http://localhost:8000/admin/pages/3007/edit/ and see a few of ye olde `media` blockes\r\n1. Pull branch\r\n1. Run migrations\r\n1. Refresh http://localhost:8000/admin/pages/3007/edit/ and see that the `media` blocks have been converted to the new `image` block.\r\n1. Go to http://localhost:8000/admin/pages/11718/edit/ and see that the most recently-created blog with an `image` block is still showing correctly.\r\n\r\n## Notes\r\n\r\nThere is no backward migration from `image_inset` back to `media` in 0117. @chosak agreed that this probably wasn't necessary, but if you disagree with that, let me know.\r\n\r\n## Todos\r\n\r\n- [x] It's occurring to me now that, while we're here writing a data migration, I could also rename `FullWidthText.image_inset` to just `image`. I'll do that!\r\n- [x] Can also add a regular migration to this that removes `media` entirely.\r\n\r\n## Checklist\r\n\r\n- [x] PR has an informative and human-readable title\r\n- [x] Changes are limited to a single goal (no scope creep)\r\n- [x] Code can be automatically merged (no conflicts)\r\n- [x] Code follows the standards laid out in the [development playbook](https://github.com/cfpb/development)\r\n- [x] Passes all existing automated tests\r\n- [x] Any _change_ in functionality is tested\r\n- [x] New functions are documented (with a description, list of inputs, and expected output)\r\n- [x] Placeholder code is flagged / future todos are captured in comments\r\n- [x] Visually tested in supported browsers and devices (see checklist below :point_down:)\r\n- [x] Project documentation has been updated\r\n- [x] Reviewers requested with the [Reviewers tool](https://help.github.com/articles/requesting-a-pull-request-review/) :arrow_right:"},"comment":{"url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/comments/410301100","html_url":"https://github.com/cfpb/cfgov-refresh/pull/4385#issuecomment-410301100","issue_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/4385","id":410301100,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDMwMTEwMA==","user":{"login":"hillaryj","id":10235730,"node_id":"MDQ6VXNlcjEwMjM1NzMw","avatar_url":"https://avatars3.githubusercontent.com/u/10235730?v=4","gravatar_id":"","url":"https://api.github.com/users/hillaryj","html_url":"https://github.com/hillaryj","followers_url":"https://api.github.com/users/hillaryj/followers","following_url":"https://api.github.com/users/hillaryj/following{/other_user}","gists_url":"https://api.github.com/users/hillaryj/gists{/gist_id}","starred_url":"https://api.github.com/users/hillaryj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hillaryj/subscriptions","organizations_url":"https://api.github.com/users/hillaryj/orgs","repos_url":"https://api.github.com/users/hillaryj/repos","events_url":"https://api.github.com/users/hillaryj/events{/privacy}","received_events_url":"https://api.github.com/users/hillaryj/received_events","type":"User","site_admin":false},"created_at":"2018-08-03T16:09:01Z","updated_at":"2018-08-03T16:09:01Z","author_association":"MEMBER","body":"Works for me locally - thanks for the well-written instructions!"}}
{"actor":{"display_login":"hillaryj"}}