{"action":"created","comment":{"url":"https://api.github.com/repos/zendesk/related_tickets_app/pulls/comments/88816289","pull_request_review_id":9377413,"id":88816289,"diff_hunk":"@@ -0,0 +1,22 @@\n+function appendParams(url, params) {\n+  let hashIndex = url.indexOf('#'),\n+      urlBeforeHash = hashIndex > 0 ? url.substring(0, hashIndex) : url,\n+      hasParams = urlBeforeHash.indexOf('?') > 0,\n+      divider = hasParams ? '&' : '?',\n+      urlWithParams = urlBeforeHash + divider + params;\n+\n+  if (hashIndex > 0) {\n+    return urlWithParams + url.substring(hashIndex);\n+  }\n+\n+  return urlWithParams;\n+}\n+\n+// Mock url params required by ZAF SDK\n+if (history.pushState) {\n+  let url = window.location.href;\n+  let origin = encodeURIComponent(window.top.location.origin);\n+  let app_guid = '36618c17-34c9-4ec3-8daa-24a9fa728461';\n+  let newUrl = appendParams(url, `origin=${origin}&app_guid=${app_guid}`);\n+  window.history.pushState({ path: newUrl }, '', newUrl);","path":"spec/helpers/zaf.js","position":21,"original_position":21,"commit_id":"8ad720c7efc379bfa07b8d36777810fd8cc1c7f4","original_commit_id":"8ad720c7efc379bfa07b8d36777810fd8cc1c7f4","user":{"login":"adammw","id":153219,"avatar_url":"https://avatars.githubusercontent.com/u/153219?v=3","gravatar_id":"","url":"https://api.github.com/users/adammw","html_url":"https://github.com/adammw","followers_url":"https://api.github.com/users/adammw/followers","following_url":"https://api.github.com/users/adammw/following{/other_user}","gists_url":"https://api.github.com/users/adammw/gists{/gist_id}","starred_url":"https://api.github.com/users/adammw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adammw/subscriptions","organizations_url":"https://api.github.com/users/adammw/orgs","repos_url":"https://api.github.com/users/adammw/repos","events_url":"https://api.github.com/users/adammw/events{/privacy}","received_events_url":"https://api.github.com/users/adammw/received_events","type":"User","site_admin":false},"body":"bit confused why we need this, was this just hard-coded for testing?","created_at":"2016-11-21T00:09:27Z","updated_at":"2016-11-21T00:09:27Z","html_url":"https://github.com/zendesk/related_tickets_app/pull/18#discussion_r88816289","pull_request_url":"https://api.github.com/repos/zendesk/related_tickets_app/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/zendesk/related_tickets_app/pulls/comments/88816289"},"html":{"href":"https://github.com/zendesk/related_tickets_app/pull/18#discussion_r88816289"},"pull_request":{"href":"https://api.github.com/repos/zendesk/related_tickets_app/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/zendesk/related_tickets_app/pulls/18","id":94538281,"html_url":"https://github.com/zendesk/related_tickets_app/pull/18","diff_url":"https://github.com/zendesk/related_tickets_app/pull/18.diff","patch_url":"https://github.com/zendesk/related_tickets_app/pull/18.patch","issue_url":"https://api.github.com/repos/zendesk/related_tickets_app/issues/18","number":18,"state":"open","locked":false,"title":"Migrate to ZAF v2","user":{"login":"fvzzy","id":8508387,"avatar_url":"https://avatars.githubusercontent.com/u/8508387?v=3","gravatar_id":"","url":"https://api.github.com/users/fvzzy","html_url":"https://github.com/fvzzy","followers_url":"https://api.github.com/users/fvzzy/followers","following_url":"https://api.github.com/users/fvzzy/following{/other_user}","gists_url":"https://api.github.com/users/fvzzy/gists{/gist_id}","starred_url":"https://api.github.com/users/fvzzy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fvzzy/subscriptions","organizations_url":"https://api.github.com/users/fvzzy/orgs","repos_url":"https://api.github.com/users/fvzzy/repos","events_url":"https://api.github.com/users/fvzzy/events{/privacy}","received_events_url":"https://api.github.com/users/fvzzy/received_events","type":"User","site_admin":false},"body":"✌️ \r\n\r\n/cc @zendesk/vegemite \r\n\r\n### Description\r\n\r\n- Migrates app over to ZAF v2\r\n- Minor refactor to simplify testing\r\n- Adds partial unit test coverage for app methods","created_at":"2016-11-20T23:44:53Z","updated_at":"2016-11-21T00:09:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0dd7076777d3ca31e53034f4214e117a3c634f24","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zendesk/related_tickets_app/pulls/18/commits","review_comments_url":"https://api.github.com/repos/zendesk/related_tickets_app/pulls/18/comments","review_comment_url":"https://api.github.com/repos/zendesk/related_tickets_app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendesk/related_tickets_app/issues/18/comments","statuses_url":"https://api.github.com/repos/zendesk/related_tickets_app/statuses/8ad720c7efc379bfa07b8d36777810fd8cc1c7f4","head":{"label":"zendesk:farhan/v2","ref":"farhan/v2","sha":"8ad720c7efc379bfa07b8d36777810fd8cc1c7f4","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":7198220,"name":"related_tickets_app","full_name":"zendesk/related_tickets_app","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/related_tickets_app","description":"A Zendesk app that shows related tickets","fork":false,"url":"https://api.github.com/repos/zendesk/related_tickets_app","forks_url":"https://api.github.com/repos/zendesk/related_tickets_app/forks","keys_url":"https://api.github.com/repos/zendesk/related_tickets_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/related_tickets_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/related_tickets_app/teams","hooks_url":"https://api.github.com/repos/zendesk/related_tickets_app/hooks","issue_events_url":"https://api.github.com/repos/zendesk/related_tickets_app/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/related_tickets_app/events","assignees_url":"https://api.github.com/repos/zendesk/related_tickets_app/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/related_tickets_app/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/related_tickets_app/tags","blobs_url":"https://api.github.com/repos/zendesk/related_tickets_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/related_tickets_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/related_tickets_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/related_tickets_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/related_tickets_app/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/related_tickets_app/languages","stargazers_url":"https://api.github.com/repos/zendesk/related_tickets_app/stargazers","contributors_url":"https://api.github.com/repos/zendesk/related_tickets_app/contributors","subscribers_url":"https://api.github.com/repos/zendesk/related_tickets_app/subscribers","subscription_url":"https://api.github.com/repos/zendesk/related_tickets_app/subscription","commits_url":"https://api.github.com/repos/zendesk/related_tickets_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/related_tickets_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/related_tickets_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/related_tickets_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/related_tickets_app/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/related_tickets_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/related_tickets_app/merges","archive_url":"https://api.github.com/repos/zendesk/related_tickets_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/related_tickets_app/downloads","issues_url":"https://api.github.com/repos/zendesk/related_tickets_app/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/related_tickets_app/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/related_tickets_app/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/related_tickets_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/related_tickets_app/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/related_tickets_app/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/related_tickets_app/deployments","created_at":"2012-12-17T02:24:59Z","updated_at":"2016-02-05T01:25:08Z","pushed_at":"2016-11-20T23:44:53Z","git_url":"git://github.com/zendesk/related_tickets_app.git","ssh_url":"git@github.com:zendesk/related_tickets_app.git","clone_url":"https://github.com/zendesk/related_tickets_app.git","svn_url":"https://github.com/zendesk/related_tickets_app","homepage":null,"size":455,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":1,"default_branch":"master"}},"base":{"label":"zendesk:master","ref":"master","sha":"28116f489e498b2f089e1525659787303ac7de9c","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":7198220,"name":"related_tickets_app","full_name":"zendesk/related_tickets_app","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/related_tickets_app","description":"A Zendesk app that shows related tickets","fork":false,"url":"https://api.github.com/repos/zendesk/related_tickets_app","forks_url":"https://api.github.com/repos/zendesk/related_tickets_app/forks","keys_url":"https://api.github.com/repos/zendesk/related_tickets_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/related_tickets_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/related_tickets_app/teams","hooks_url":"https://api.github.com/repos/zendesk/related_tickets_app/hooks","issue_events_url":"https://api.github.com/repos/zendesk/related_tickets_app/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/related_tickets_app/events","assignees_url":"https://api.github.com/repos/zendesk/related_tickets_app/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/related_tickets_app/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/related_tickets_app/tags","blobs_url":"https://api.github.com/repos/zendesk/related_tickets_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/related_tickets_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/related_tickets_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/related_tickets_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/related_tickets_app/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/related_tickets_app/languages","stargazers_url":"https://api.github.com/repos/zendesk/related_tickets_app/stargazers","contributors_url":"https://api.github.com/repos/zendesk/related_tickets_app/contributors","subscribers_url":"https://api.github.com/repos/zendesk/related_tickets_app/subscribers","subscription_url":"https://api.github.com/repos/zendesk/related_tickets_app/subscription","commits_url":"https://api.github.com/repos/zendesk/related_tickets_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/related_tickets_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/related_tickets_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/related_tickets_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/related_tickets_app/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/related_tickets_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/related_tickets_app/merges","archive_url":"https://api.github.com/repos/zendesk/related_tickets_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/related_tickets_app/downloads","issues_url":"https://api.github.com/repos/zendesk/related_tickets_app/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/related_tickets_app/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/related_tickets_app/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/related_tickets_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/related_tickets_app/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/related_tickets_app/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/related_tickets_app/deployments","created_at":"2012-12-17T02:24:59Z","updated_at":"2016-02-05T01:25:08Z","pushed_at":"2016-11-20T23:44:53Z","git_url":"git://github.com/zendesk/related_tickets_app.git","ssh_url":"git@github.com:zendesk/related_tickets_app.git","clone_url":"https://github.com/zendesk/related_tickets_app.git","svn_url":"https://github.com/zendesk/related_tickets_app","homepage":null,"size":455,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendesk/related_tickets_app/pulls/18"},"html":{"href":"https://github.com/zendesk/related_tickets_app/pull/18"},"issue":{"href":"https://api.github.com/repos/zendesk/related_tickets_app/issues/18"},"comments":{"href":"https://api.github.com/repos/zendesk/related_tickets_app/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/zendesk/related_tickets_app/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/zendesk/related_tickets_app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendesk/related_tickets_app/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/zendesk/related_tickets_app/statuses/8ad720c7efc379bfa07b8d36777810fd8cc1c7f4"}}}}
{"actor":{"display_login":"adammw"}}