{"action":"opened","number":343,"pull_request":{"url":"https://api.github.com/repos/guardian/dotcom-rendering/pulls/343","id":241791434,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxNzkxNDM0","html_url":"https://github.com/guardian/dotcom-rendering/pull/343","diff_url":"https://github.com/guardian/dotcom-rendering/pull/343.diff","patch_url":"https://github.com/guardian/dotcom-rendering/pull/343.patch","issue_url":"https://api.github.com/repos/guardian/dotcom-rendering/issues/343","number":343,"state":"open","locked":false,"title":"Log client-side JavaScript errors in sentry using raven-js","user":{"login":"GHaberis","id":1590704,"node_id":"MDQ6VXNlcjE1OTA3MDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1590704?v=4","gravatar_id":"","url":"https://api.github.com/users/GHaberis","html_url":"https://github.com/GHaberis","followers_url":"https://api.github.com/users/GHaberis/followers","following_url":"https://api.github.com/users/GHaberis/following{/other_user}","gists_url":"https://api.github.com/users/GHaberis/gists{/gist_id}","starred_url":"https://api.github.com/users/GHaberis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GHaberis/subscriptions","organizations_url":"https://api.github.com/users/GHaberis/orgs","repos_url":"https://api.github.com/users/GHaberis/repos","events_url":"https://api.github.com/users/GHaberis/events{/privacy}","received_events_url":"https://api.github.com/users/GHaberis/received_events","type":"User","site_admin":false},"body":"## What does this change?\r\n\r\nThis PR introduces the dependency `raven-js` that will allow us to log clientside JavaScript errors in Sentry.\r\n\r\nChanges in this PR include:\r\n\r\n- Update `extract-capi` and `extract-config` to pull data from frontend's JSON into the`CAPI` and `config` objects.\r\n- Introduce new module `frontend/web/lib/appData.ts` for querying `window.guardian.app.data`\r\n- Introduce new module `frontend/web/lib/detectAdBlocker.ts` to determine whether a user is using an adBlocker, we don't report JavaScript errors for users using adBlockers in Sentry.\r\n- Introduce new module `frontend/web/lib/raven.ts` which initialises an instance Raven\r\n- Update `/frontend/web/browser.ts` to wrap all clientside \"hydration\" login in a Raven context.\r\n- Update `/frontend/model/validators.ts` to export a new `getObject` function\r\n\r\n## Why?\r\n\r\nThis allows us to monitor JS errors in the new client-side rendering tier.\r\n","created_at":"2019-01-02T16:36:48Z","updated_at":"2019-01-02T16:36:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/guardian/dotcom-rendering/pulls/343/commits","review_comments_url":"https://api.github.com/repos/guardian/dotcom-rendering/pulls/343/comments","review_comment_url":"https://api.github.com/repos/guardian/dotcom-rendering/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/dotcom-rendering/issues/343/comments","statuses_url":"https://api.github.com/repos/guardian/dotcom-rendering/statuses/1294824ba377f20612f5d65229e30ec63571ed51","head":{"label":"guardian:gh-sentry-raven","ref":"gh-sentry-raven","sha":"1294824ba377f20612f5d65229e30ec63571ed51","user":{"login":"guardian","id":164318,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDMxOA==","avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":107111499,"node_id":"MDEwOlJlcG9zaXRvcnkxMDcxMTE0OTk=","name":"dotcom-rendering","full_name":"guardian/dotcom-rendering","private":false,"owner":{"login":"guardian","id":164318,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDMxOA==","avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/guardian/dotcom-rendering","description":"⍺⁴𝙻","fork":false,"url":"https://api.github.com/repos/guardian/dotcom-rendering","forks_url":"https://api.github.com/repos/guardian/dotcom-rendering/forks","keys_url":"https://api.github.com/repos/guardian/dotcom-rendering/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/dotcom-rendering/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/dotcom-rendering/teams","hooks_url":"https://api.github.com/repos/guardian/dotcom-rendering/hooks","issue_events_url":"https://api.github.com/repos/guardian/dotcom-rendering/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/dotcom-rendering/events","assignees_url":"https://api.github.com/repos/guardian/dotcom-rendering/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/dotcom-rendering/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/dotcom-rendering/tags","blobs_url":"https://api.github.com/repos/guardian/dotcom-rendering/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/dotcom-rendering/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/dotcom-rendering/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/dotcom-rendering/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/dotcom-rendering/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/dotcom-rendering/languages","stargazers_url":"https://api.github.com/repos/guardian/dotcom-rendering/stargazers","contributors_url":"https://api.github.com/repos/guardian/dotcom-rendering/contributors","subscribers_url":"https://api.github.com/repos/guardian/dotcom-rendering/subscribers","subscription_url":"https://api.github.com/repos/guardian/dotcom-rendering/subscription","commits_url":"https://api.github.com/repos/guardian/dotcom-rendering/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/dotcom-rendering/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/dotcom-rendering/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/dotcom-rendering/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/dotcom-rendering/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/dotcom-rendering/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/dotcom-rendering/merges","archive_url":"https://api.github.com/repos/guardian/dotcom-rendering/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/dotcom-rendering/downloads","issues_url":"https://api.github.com/repos/guardian/dotcom-rendering/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/dotcom-rendering/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/dotcom-rendering/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/dotcom-rendering/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/dotcom-rendering/labels{/name}","releases_url":"https://api.github.com/repos/guardian/dotcom-rendering/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/dotcom-rendering/deployments","created_at":"2017-10-16T10:13:32Z","updated_at":"2019-01-02T13:10:13Z","pushed_at":"2019-01-02T16:33:47Z","git_url":"git://github.com/guardian/dotcom-rendering.git","ssh_url":"git@github.com:guardian/dotcom-rendering.git","clone_url":"https://github.com/guardian/dotcom-rendering.git","svn_url":"https://github.com/guardian/dotcom-rendering","homepage":"","size":14587,"stargazers_count":8,"watchers_count":8,"language":"HTML","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":12,"watchers":8,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"559bc0d7bd20797055f515372c53bdbc03433339","user":{"login":"guardian","id":164318,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDMxOA==","avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":107111499,"node_id":"MDEwOlJlcG9zaXRvcnkxMDcxMTE0OTk=","name":"dotcom-rendering","full_name":"guardian/dotcom-rendering","private":false,"owner":{"login":"guardian","id":164318,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDMxOA==","avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/guardian/dotcom-rendering","description":"⍺⁴𝙻","fork":false,"url":"https://api.github.com/repos/guardian/dotcom-rendering","forks_url":"https://api.github.com/repos/guardian/dotcom-rendering/forks","keys_url":"https://api.github.com/repos/guardian/dotcom-rendering/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/dotcom-rendering/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/dotcom-rendering/teams","hooks_url":"https://api.github.com/repos/guardian/dotcom-rendering/hooks","issue_events_url":"https://api.github.com/repos/guardian/dotcom-rendering/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/dotcom-rendering/events","assignees_url":"https://api.github.com/repos/guardian/dotcom-rendering/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/dotcom-rendering/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/dotcom-rendering/tags","blobs_url":"https://api.github.com/repos/guardian/dotcom-rendering/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/dotcom-rendering/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/dotcom-rendering/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/dotcom-rendering/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/dotcom-rendering/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/dotcom-rendering/languages","stargazers_url":"https://api.github.com/repos/guardian/dotcom-rendering/stargazers","contributors_url":"https://api.github.com/repos/guardian/dotcom-rendering/contributors","subscribers_url":"https://api.github.com/repos/guardian/dotcom-rendering/subscribers","subscription_url":"https://api.github.com/repos/guardian/dotcom-rendering/subscription","commits_url":"https://api.github.com/repos/guardian/dotcom-rendering/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/dotcom-rendering/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/dotcom-rendering/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/dotcom-rendering/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/dotcom-rendering/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/dotcom-rendering/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/dotcom-rendering/merges","archive_url":"https://api.github.com/repos/guardian/dotcom-rendering/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/dotcom-rendering/downloads","issues_url":"https://api.github.com/repos/guardian/dotcom-rendering/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/dotcom-rendering/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/dotcom-rendering/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/dotcom-rendering/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/dotcom-rendering/labels{/name}","releases_url":"https://api.github.com/repos/guardian/dotcom-rendering/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/dotcom-rendering/deployments","created_at":"2017-10-16T10:13:32Z","updated_at":"2019-01-02T13:10:13Z","pushed_at":"2019-01-02T16:33:47Z","git_url":"git://github.com/guardian/dotcom-rendering.git","ssh_url":"git@github.com:guardian/dotcom-rendering.git","clone_url":"https://github.com/guardian/dotcom-rendering.git","svn_url":"https://github.com/guardian/dotcom-rendering","homepage":"","size":14587,"stargazers_count":8,"watchers_count":8,"language":"HTML","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":12,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/dotcom-rendering/pulls/343"},"html":{"href":"https://github.com/guardian/dotcom-rendering/pull/343"},"issue":{"href":"https://api.github.com/repos/guardian/dotcom-rendering/issues/343"},"comments":{"href":"https://api.github.com/repos/guardian/dotcom-rendering/issues/343/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/dotcom-rendering/pulls/343/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/dotcom-rendering/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/dotcom-rendering/pulls/343/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/dotcom-rendering/statuses/1294824ba377f20612f5d65229e30ec63571ed51"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":15,"additions":418,"deletions":66,"changed_files":16}}
{"actor":{"display_login":"GHaberis"}}