{"action":"closed","number":844,"pull_request":{"url":"https://api.github.com/repos/DoSomething/phoenix-next/pulls/844","id":182259780,"html_url":"https://github.com/DoSomething/phoenix-next/pull/844","diff_url":"https://github.com/DoSomething/phoenix-next/pull/844.diff","patch_url":"https://github.com/DoSomething/phoenix-next/pull/844.patch","issue_url":"https://api.github.com/repos/DoSomething/phoenix-next/issues/844","number":844,"state":"closed","locked":false,"title":"Contentful slug transform script","user":{"login":"mendelB","id":12417657,"avatar_url":"https://avatars3.githubusercontent.com/u/12417657?v=4","gravatar_id":"","url":"https://api.github.com/users/mendelB","html_url":"https://github.com/mendelB","followers_url":"https://api.github.com/users/mendelB/followers","following_url":"https://api.github.com/users/mendelB/following{/other_user}","gists_url":"https://api.github.com/users/mendelB/gists{/gist_id}","starred_url":"https://api.github.com/users/mendelB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mendelB/subscriptions","organizations_url":"https://api.github.com/users/mendelB/orgs","repos_url":"https://api.github.com/users/mendelB/repos","events_url":"https://api.github.com/users/mendelB/events{/privacy}","received_events_url":"https://api.github.com/users/mendelB/received_events","type":"User","site_admin":false},"body":"## _PULL REQUEST OVERVIEW_\r\n\r\n### What does this PR do?\r\n\r\nThis PR adds a script that uses the [contentful-management-api (js sdk)](https://contentful.github.io/contentful-management.js/contentful-management/5.0.0/) to transform all `Page` - `slug` fields over to the [new format](https://github.com/orgs/DoSomething/teams/team-rocket/discussions/17)\r\n\r\nTo run this script (in command line from `phoenix-next` project root directory):\r\n```\r\n$ node contentful/management-api-scripts/[transformation-filename] --space-id [contentful space id] --access-token [contentful-access-token]\r\n```\r\n\r\n\r\n### Any background context you want to provide?\r\n- We tried doing this with our usual transformation process using the Contentful Migration CLI, however, we ran into a roadblock with needing a `Campaign`s own `slug`field  in order to transform it's individual linked `pages` `slug` fields (`campaign-slug/page-slug`). However, the CLI only allows us access to the `Page`s individually when targeting `Page` directly (without any means of knowing the source campaigns slug), or only the `linkEntry` reference to the pages when targeting the `campaign` itself for the transformation. [Slack thread](https://dosomething.slack.com/archives/C3ASB4204/p1523914344000281)\r\n\r\n- There would be *way* fewer API calls being made in the script, however, frustratingly, the [`include`](https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/links) and [`resolveLinks`](https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters) options don't seem to be working at all with this sdk.\r\n\r\n- I tested this all using my personal Contentful space, modeled with Campaigns and pages etc. So this *should* work with our space as well.\r\n![comic](http://i.imgur.com/PnvK7v6.png)\r\n\r\n### What are the relevant tickets/cards?\r\nhttps://www.pivotaltracker.com/story/show/156771576 -- I think\r\n\r\n","created_at":"2018-04-17T18:46:13Z","updated_at":"2018-04-18T19:58:53Z","closed_at":"2018-04-18T19:58:52Z","merged_at":"2018-04-18T19:58:52Z","merge_commit_sha":"276276b32113c7bb8ecb0af23edb85fff8e4e3aa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/DoSomething/phoenix-next/pulls/844/commits","review_comments_url":"https://api.github.com/repos/DoSomething/phoenix-next/pulls/844/comments","review_comment_url":"https://api.github.com/repos/DoSomething/phoenix-next/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DoSomething/phoenix-next/issues/844/comments","statuses_url":"https://api.github.com/repos/DoSomething/phoenix-next/statuses/ea1b5655eea35a295ddc92f3f3d0d89a6087f0b1","head":{"label":"DoSomething:contentful-slug-transform","ref":"contentful-slug-transform","sha":"ea1b5655eea35a295ddc92f3f3d0d89a6087f0b1","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":75642790,"name":"phoenix-next","full_name":"DoSomething/phoenix-next","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/phoenix-next","description":"🔥 The new DoSomething.org campaign template.","fork":false,"url":"https://api.github.com/repos/DoSomething/phoenix-next","forks_url":"https://api.github.com/repos/DoSomething/phoenix-next/forks","keys_url":"https://api.github.com/repos/DoSomething/phoenix-next/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/phoenix-next/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/phoenix-next/teams","hooks_url":"https://api.github.com/repos/DoSomething/phoenix-next/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/phoenix-next/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/phoenix-next/events","assignees_url":"https://api.github.com/repos/DoSomething/phoenix-next/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/phoenix-next/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/phoenix-next/tags","blobs_url":"https://api.github.com/repos/DoSomething/phoenix-next/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/phoenix-next/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/phoenix-next/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/phoenix-next/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/phoenix-next/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/phoenix-next/languages","stargazers_url":"https://api.github.com/repos/DoSomething/phoenix-next/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/phoenix-next/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/phoenix-next/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/phoenix-next/subscription","commits_url":"https://api.github.com/repos/DoSomething/phoenix-next/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/phoenix-next/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/phoenix-next/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/phoenix-next/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/phoenix-next/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/phoenix-next/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/phoenix-next/merges","archive_url":"https://api.github.com/repos/DoSomething/phoenix-next/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/phoenix-next/downloads","issues_url":"https://api.github.com/repos/DoSomething/phoenix-next/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/phoenix-next/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/phoenix-next/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/phoenix-next/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/phoenix-next/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/phoenix-next/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/phoenix-next/deployments","created_at":"2016-12-05T16:08:36Z","updated_at":"2018-04-18T17:04:39Z","pushed_at":"2018-04-18T19:58:52Z","git_url":"git://github.com/DoSomething/phoenix-next.git","ssh_url":"git@github.com:DoSomething/phoenix-next.git","clone_url":"https://github.com/DoSomething/phoenix-next.git","svn_url":"https://github.com/DoSomething/phoenix-next","homepage":"https://next.dosomething.org","size":11002,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":17,"license":null,"forks":6,"open_issues":17,"watchers":1,"default_branch":"master"}},"base":{"label":"DoSomething:master","ref":"master","sha":"74db19f823f36bcbf0ec7d0e80717a440e7b7bdc","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":75642790,"name":"phoenix-next","full_name":"DoSomething/phoenix-next","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/phoenix-next","description":"🔥 The new DoSomething.org campaign template.","fork":false,"url":"https://api.github.com/repos/DoSomething/phoenix-next","forks_url":"https://api.github.com/repos/DoSomething/phoenix-next/forks","keys_url":"https://api.github.com/repos/DoSomething/phoenix-next/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/phoenix-next/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/phoenix-next/teams","hooks_url":"https://api.github.com/repos/DoSomething/phoenix-next/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/phoenix-next/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/phoenix-next/events","assignees_url":"https://api.github.com/repos/DoSomething/phoenix-next/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/phoenix-next/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/phoenix-next/tags","blobs_url":"https://api.github.com/repos/DoSomething/phoenix-next/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/phoenix-next/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/phoenix-next/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/phoenix-next/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/phoenix-next/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/phoenix-next/languages","stargazers_url":"https://api.github.com/repos/DoSomething/phoenix-next/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/phoenix-next/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/phoenix-next/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/phoenix-next/subscription","commits_url":"https://api.github.com/repos/DoSomething/phoenix-next/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/phoenix-next/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/phoenix-next/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/phoenix-next/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/phoenix-next/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/phoenix-next/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/phoenix-next/merges","archive_url":"https://api.github.com/repos/DoSomething/phoenix-next/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/phoenix-next/downloads","issues_url":"https://api.github.com/repos/DoSomething/phoenix-next/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/phoenix-next/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/phoenix-next/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/phoenix-next/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/phoenix-next/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/phoenix-next/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/phoenix-next/deployments","created_at":"2016-12-05T16:08:36Z","updated_at":"2018-04-18T17:04:39Z","pushed_at":"2018-04-18T19:58:52Z","git_url":"git://github.com/DoSomething/phoenix-next.git","ssh_url":"git@github.com:DoSomething/phoenix-next.git","clone_url":"https://github.com/DoSomething/phoenix-next.git","svn_url":"https://github.com/DoSomething/phoenix-next","homepage":"https://next.dosomething.org","size":11002,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":17,"license":null,"forks":6,"open_issues":17,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DoSomething/phoenix-next/pulls/844"},"html":{"href":"https://github.com/DoSomething/phoenix-next/pull/844"},"issue":{"href":"https://api.github.com/repos/DoSomething/phoenix-next/issues/844"},"comments":{"href":"https://api.github.com/repos/DoSomething/phoenix-next/issues/844/comments"},"review_comments":{"href":"https://api.github.com/repos/DoSomething/phoenix-next/pulls/844/comments"},"review_comment":{"href":"https://api.github.com/repos/DoSomething/phoenix-next/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DoSomething/phoenix-next/pulls/844/commits"},"statuses":{"href":"https://api.github.com/repos/DoSomething/phoenix-next/statuses/ea1b5655eea35a295ddc92f3f3d0d89a6087f0b1"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"mendelB","id":12417657,"avatar_url":"https://avatars3.githubusercontent.com/u/12417657?v=4","gravatar_id":"","url":"https://api.github.com/users/mendelB","html_url":"https://github.com/mendelB","followers_url":"https://api.github.com/users/mendelB/followers","following_url":"https://api.github.com/users/mendelB/following{/other_user}","gists_url":"https://api.github.com/users/mendelB/gists{/gist_id}","starred_url":"https://api.github.com/users/mendelB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mendelB/subscriptions","organizations_url":"https://api.github.com/users/mendelB/orgs","repos_url":"https://api.github.com/users/mendelB/repos","events_url":"https://api.github.com/users/mendelB/events{/privacy}","received_events_url":"https://api.github.com/users/mendelB/received_events","type":"User","site_admin":false},"comments":3,"review_comments":13,"maintainer_can_modify":false,"commits":17,"additions":141,"deletions":4,"changed_files":3}}
{"actor":{"display_login":"mendelB"}}