{"action":"closed","number":145,"pull_request":{"url":"https://api.github.com/repos/censusreporter/censusreporter/pulls/145","id":50714897,"html_url":"https://github.com/censusreporter/censusreporter/pull/145","diff_url":"https://github.com/censusreporter/censusreporter/pull/145.diff","patch_url":"https://github.com/censusreporter/censusreporter/pull/145.patch","issue_url":"https://api.github.com/repos/censusreporter/censusreporter/issues/145","number":145,"state":"closed","locked":false,"title":"WIP embed code pulls from release-specific and chart-specific json","user":{"login":"ryanpitts","id":56477,"avatar_url":"https://avatars.githubusercontent.com/u/56477?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanpitts","html_url":"https://github.com/ryanpitts","followers_url":"https://api.github.com/users/ryanpitts/followers","following_url":"https://api.github.com/users/ryanpitts/following{/other_user}","gists_url":"https://api.github.com/users/ryanpitts/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanpitts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanpitts/subscriptions","organizations_url":"https://api.github.com/users/ryanpitts/orgs","repos_url":"https://api.github.com/users/ryanpitts/repos","events_url":"https://api.github.com/users/ryanpitts/events{/privacy}","received_events_url":"https://api.github.com/users/ryanpitts/received_events","type":"User","site_admin":false},"body":"**This needs review and conversation before merging!**\r\n\r\n_The problem we are addressing:_ By enabling 2014 1-year data on the site, we will in many cases provide profile pages with a mix of 2014 and 2013 data, where the geography is big enough as a whole for 1-year data, but certain table universes fall below that threshhold. Our API's \"latest\" endpoint knows, in that case, to fall back to smaller releases, which for the next few months will mean dipping into 2013 data. Meanwhile, when we enable 2014 data, we would ​*also*​ be updating the cache dir in S3 from /2013 --> /2014. So the risk is that someone will be looking at a mixed-release profile page, which will be pulling data from /2014 JSON, and then decide to embed a chart that comes from 2013 data. The embed code knows the chart data comes from 2013, and so will look in /2013 for the data, with no guarantee that it exists.\r\n\r\nThis implementation:\r\n* refactors our embed code to look for chart-specific JSON inside of release-specific directories in our S3 bucket. E.g. `1.0./data/charts/[RELEASE_KEY]/[GEO_ID]-[CHART_KEY].json`\r\n* creates (if necessary) that chart-specific JSON whenever someone clicks \"embed\" next to a chart. That chart already knows what data it needs to build itself, so it fires a POST request at a new URL endpoint, `/make-json/charts/`, which builds a condensed version of our usual profile JSON, with only the data necessary for that specific chart. For example: https://embed.censusreporter.org.s3.amazonaws.com/1.0/data/charts/ACS_2013_1-year/16000US5367000-demographics-age-distribution_by_category.json\r\n* continues to support old embed code. Previous embed querystrings do not contain the `releaseID` param, so the embed frame code falls back to previous data directories.\r\n* leaves the chart-rendering code alone. The full-profile JSON used by old code and the chart-specific JSON used by the new code both have the same nested hierarchy, so the chart code method of drilling into the JSON obj to find the right dataset still works in either case.","created_at":"2015-11-14T03:14:46Z","updated_at":"2015-11-30T18:36:02Z","closed_at":"2015-11-30T18:36:02Z","merged_at":"2015-11-30T18:36:02Z","merge_commit_sha":"49f1600e9f18075cc657698979f77ab78dc9b850","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/censusreporter/censusreporter/pulls/145/commits","review_comments_url":"https://api.github.com/repos/censusreporter/censusreporter/pulls/145/comments","review_comment_url":"https://api.github.com/repos/censusreporter/censusreporter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/censusreporter/censusreporter/issues/145/comments","statuses_url":"https://api.github.com/repos/censusreporter/censusreporter/statuses/61ac1eb7a7dd940be46485e1df4c0380a51c0455","head":{"label":"censusreporter:update-embeds","ref":"update-embeds","sha":"61ac1eb7a7dd940be46485e1df4c0380a51c0455","user":{"login":"censusreporter","id":3924386,"avatar_url":"https://avatars.githubusercontent.com/u/3924386?v=3","gravatar_id":"","url":"https://api.github.com/users/censusreporter","html_url":"https://github.com/censusreporter","followers_url":"https://api.github.com/users/censusreporter/followers","following_url":"https://api.github.com/users/censusreporter/following{/other_user}","gists_url":"https://api.github.com/users/censusreporter/gists{/gist_id}","starred_url":"https://api.github.com/users/censusreporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/censusreporter/subscriptions","organizations_url":"https://api.github.com/users/censusreporter/orgs","repos_url":"https://api.github.com/users/censusreporter/repos","events_url":"https://api.github.com/users/censusreporter/events{/privacy}","received_events_url":"https://api.github.com/users/censusreporter/received_events","type":"Organization","site_admin":false},"repo":{"id":10183514,"name":"censusreporter","full_name":"censusreporter/censusreporter","owner":{"login":"censusreporter","id":3924386,"avatar_url":"https://avatars.githubusercontent.com/u/3924386?v=3","gravatar_id":"","url":"https://api.github.com/users/censusreporter","html_url":"https://github.com/censusreporter","followers_url":"https://api.github.com/users/censusreporter/followers","following_url":"https://api.github.com/users/censusreporter/following{/other_user}","gists_url":"https://api.github.com/users/censusreporter/gists{/gist_id}","starred_url":"https://api.github.com/users/censusreporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/censusreporter/subscriptions","organizations_url":"https://api.github.com/users/censusreporter/orgs","repos_url":"https://api.github.com/users/censusreporter/repos","events_url":"https://api.github.com/users/censusreporter/events{/privacy}","received_events_url":"https://api.github.com/users/censusreporter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/censusreporter/censusreporter","description":"Census Reporter is a Knight News Challenge-funded project to make it easier for journalists to write stories using information from the U.S. Census bureau.","fork":false,"url":"https://api.github.com/repos/censusreporter/censusreporter","forks_url":"https://api.github.com/repos/censusreporter/censusreporter/forks","keys_url":"https://api.github.com/repos/censusreporter/censusreporter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/censusreporter/censusreporter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/censusreporter/censusreporter/teams","hooks_url":"https://api.github.com/repos/censusreporter/censusreporter/hooks","issue_events_url":"https://api.github.com/repos/censusreporter/censusreporter/issues/events{/number}","events_url":"https://api.github.com/repos/censusreporter/censusreporter/events","assignees_url":"https://api.github.com/repos/censusreporter/censusreporter/assignees{/user}","branches_url":"https://api.github.com/repos/censusreporter/censusreporter/branches{/branch}","tags_url":"https://api.github.com/repos/censusreporter/censusreporter/tags","blobs_url":"https://api.github.com/repos/censusreporter/censusreporter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/censusreporter/censusreporter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/censusreporter/censusreporter/git/refs{/sha}","trees_url":"https://api.github.com/repos/censusreporter/censusreporter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/censusreporter/censusreporter/statuses/{sha}","languages_url":"https://api.github.com/repos/censusreporter/censusreporter/languages","stargazers_url":"https://api.github.com/repos/censusreporter/censusreporter/stargazers","contributors_url":"https://api.github.com/repos/censusreporter/censusreporter/contributors","subscribers_url":"https://api.github.com/repos/censusreporter/censusreporter/subscribers","subscription_url":"https://api.github.com/repos/censusreporter/censusreporter/subscription","commits_url":"https://api.github.com/repos/censusreporter/censusreporter/commits{/sha}","git_commits_url":"https://api.github.com/repos/censusreporter/censusreporter/git/commits{/sha}","comments_url":"https://api.github.com/repos/censusreporter/censusreporter/comments{/number}","issue_comment_url":"https://api.github.com/repos/censusreporter/censusreporter/issues/comments{/number}","contents_url":"https://api.github.com/repos/censusreporter/censusreporter/contents/{+path}","compare_url":"https://api.github.com/repos/censusreporter/censusreporter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/censusreporter/censusreporter/merges","archive_url":"https://api.github.com/repos/censusreporter/censusreporter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/censusreporter/censusreporter/downloads","issues_url":"https://api.github.com/repos/censusreporter/censusreporter/issues{/number}","pulls_url":"https://api.github.com/repos/censusreporter/censusreporter/pulls{/number}","milestones_url":"https://api.github.com/repos/censusreporter/censusreporter/milestones{/number}","notifications_url":"https://api.github.com/repos/censusreporter/censusreporter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/censusreporter/censusreporter/labels{/name}","releases_url":"https://api.github.com/repos/censusreporter/censusreporter/releases{/id}","created_at":"2013-05-20T22:46:00Z","updated_at":"2015-11-13T20:55:27Z","pushed_at":"2015-11-30T18:36:02Z","git_url":"git://github.com/censusreporter/censusreporter.git","ssh_url":"git@github.com:censusreporter/censusreporter.git","clone_url":"https://github.com/censusreporter/censusreporter.git","svn_url":"https://github.com/censusreporter/censusreporter","homepage":"http://censusreporter.org","size":73488,"stargazers_count":121,"watchers_count":121,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":72,"forks":52,"open_issues":72,"watchers":121,"default_branch":"master"}},"base":{"label":"censusreporter:master","ref":"master","sha":"cd46442577285b47f3173f200aac53362bc5857a","user":{"login":"censusreporter","id":3924386,"avatar_url":"https://avatars.githubusercontent.com/u/3924386?v=3","gravatar_id":"","url":"https://api.github.com/users/censusreporter","html_url":"https://github.com/censusreporter","followers_url":"https://api.github.com/users/censusreporter/followers","following_url":"https://api.github.com/users/censusreporter/following{/other_user}","gists_url":"https://api.github.com/users/censusreporter/gists{/gist_id}","starred_url":"https://api.github.com/users/censusreporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/censusreporter/subscriptions","organizations_url":"https://api.github.com/users/censusreporter/orgs","repos_url":"https://api.github.com/users/censusreporter/repos","events_url":"https://api.github.com/users/censusreporter/events{/privacy}","received_events_url":"https://api.github.com/users/censusreporter/received_events","type":"Organization","site_admin":false},"repo":{"id":10183514,"name":"censusreporter","full_name":"censusreporter/censusreporter","owner":{"login":"censusreporter","id":3924386,"avatar_url":"https://avatars.githubusercontent.com/u/3924386?v=3","gravatar_id":"","url":"https://api.github.com/users/censusreporter","html_url":"https://github.com/censusreporter","followers_url":"https://api.github.com/users/censusreporter/followers","following_url":"https://api.github.com/users/censusreporter/following{/other_user}","gists_url":"https://api.github.com/users/censusreporter/gists{/gist_id}","starred_url":"https://api.github.com/users/censusreporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/censusreporter/subscriptions","organizations_url":"https://api.github.com/users/censusreporter/orgs","repos_url":"https://api.github.com/users/censusreporter/repos","events_url":"https://api.github.com/users/censusreporter/events{/privacy}","received_events_url":"https://api.github.com/users/censusreporter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/censusreporter/censusreporter","description":"Census Reporter is a Knight News Challenge-funded project to make it easier for journalists to write stories using information from the U.S. Census bureau.","fork":false,"url":"https://api.github.com/repos/censusreporter/censusreporter","forks_url":"https://api.github.com/repos/censusreporter/censusreporter/forks","keys_url":"https://api.github.com/repos/censusreporter/censusreporter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/censusreporter/censusreporter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/censusreporter/censusreporter/teams","hooks_url":"https://api.github.com/repos/censusreporter/censusreporter/hooks","issue_events_url":"https://api.github.com/repos/censusreporter/censusreporter/issues/events{/number}","events_url":"https://api.github.com/repos/censusreporter/censusreporter/events","assignees_url":"https://api.github.com/repos/censusreporter/censusreporter/assignees{/user}","branches_url":"https://api.github.com/repos/censusreporter/censusreporter/branches{/branch}","tags_url":"https://api.github.com/repos/censusreporter/censusreporter/tags","blobs_url":"https://api.github.com/repos/censusreporter/censusreporter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/censusreporter/censusreporter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/censusreporter/censusreporter/git/refs{/sha}","trees_url":"https://api.github.com/repos/censusreporter/censusreporter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/censusreporter/censusreporter/statuses/{sha}","languages_url":"https://api.github.com/repos/censusreporter/censusreporter/languages","stargazers_url":"https://api.github.com/repos/censusreporter/censusreporter/stargazers","contributors_url":"https://api.github.com/repos/censusreporter/censusreporter/contributors","subscribers_url":"https://api.github.com/repos/censusreporter/censusreporter/subscribers","subscription_url":"https://api.github.com/repos/censusreporter/censusreporter/subscription","commits_url":"https://api.github.com/repos/censusreporter/censusreporter/commits{/sha}","git_commits_url":"https://api.github.com/repos/censusreporter/censusreporter/git/commits{/sha}","comments_url":"https://api.github.com/repos/censusreporter/censusreporter/comments{/number}","issue_comment_url":"https://api.github.com/repos/censusreporter/censusreporter/issues/comments{/number}","contents_url":"https://api.github.com/repos/censusreporter/censusreporter/contents/{+path}","compare_url":"https://api.github.com/repos/censusreporter/censusreporter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/censusreporter/censusreporter/merges","archive_url":"https://api.github.com/repos/censusreporter/censusreporter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/censusreporter/censusreporter/downloads","issues_url":"https://api.github.com/repos/censusreporter/censusreporter/issues{/number}","pulls_url":"https://api.github.com/repos/censusreporter/censusreporter/pulls{/number}","milestones_url":"https://api.github.com/repos/censusreporter/censusreporter/milestones{/number}","notifications_url":"https://api.github.com/repos/censusreporter/censusreporter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/censusreporter/censusreporter/labels{/name}","releases_url":"https://api.github.com/repos/censusreporter/censusreporter/releases{/id}","created_at":"2013-05-20T22:46:00Z","updated_at":"2015-11-13T20:55:27Z","pushed_at":"2015-11-30T18:36:02Z","git_url":"git://github.com/censusreporter/censusreporter.git","ssh_url":"git@github.com:censusreporter/censusreporter.git","clone_url":"https://github.com/censusreporter/censusreporter.git","svn_url":"https://github.com/censusreporter/censusreporter","homepage":"http://censusreporter.org","size":73488,"stargazers_count":121,"watchers_count":121,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":72,"forks":52,"open_issues":72,"watchers":121,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/censusreporter/censusreporter/pulls/145"},"html":{"href":"https://github.com/censusreporter/censusreporter/pull/145"},"issue":{"href":"https://api.github.com/repos/censusreporter/censusreporter/issues/145"},"comments":{"href":"https://api.github.com/repos/censusreporter/censusreporter/issues/145/comments"},"review_comments":{"href":"https://api.github.com/repos/censusreporter/censusreporter/pulls/145/comments"},"review_comment":{"href":"https://api.github.com/repos/censusreporter/censusreporter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/censusreporter/censusreporter/pulls/145/commits"},"statuses":{"href":"https://api.github.com/repos/censusreporter/censusreporter/statuses/61ac1eb7a7dd940be46485e1df4c0380a51c0455"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"ryanpitts","id":56477,"avatar_url":"https://avatars.githubusercontent.com/u/56477?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanpitts","html_url":"https://github.com/ryanpitts","followers_url":"https://api.github.com/users/ryanpitts/followers","following_url":"https://api.github.com/users/ryanpitts/following{/other_user}","gists_url":"https://api.github.com/users/ryanpitts/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanpitts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanpitts/subscriptions","organizations_url":"https://api.github.com/users/ryanpitts/orgs","repos_url":"https://api.github.com/users/ryanpitts/repos","events_url":"https://api.github.com/users/ryanpitts/events{/privacy}","received_events_url":"https://api.github.com/users/ryanpitts/received_events","type":"User","site_admin":false},"comments":6,"review_comments":0,"commits":1,"additions":131,"deletions":9,"changed_files":5}}