{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/treeherder/pulls/comments/36449821","id":36449821,"diff_hunk":"@@ -274,10 +274,9 @@ treeherder.directive('thCloneJobs', [\n                     ev.preventDefault();\n                     //Middle mouse button pressed\n                     ThJobModel.get(this.repoName, job.id).then(function(data){\n-                        //Retrieve the job reference data and open a new\n-                        //window on the job's log file\n-                        if(data.logs.length > 0){\n-                            window.open(data.logs[0].url, \"Log\");\n+                        // Open the logviewer in a new window\n+                        if (data.logs.length > 0 && data.state === 'completed') {","path":"ui/js/directives/treeherder/clonejobs.js","position":9,"original_position":9,"commit_id":"9b67919d445afae55e5b925928c2488ae5a1d2e2","original_commit_id":"9b67919d445afae55e5b925928c2488ae5a1d2e2","user":{"login":"tojonmz","id":3660661,"avatar_url":"https://avatars.githubusercontent.com/u/3660661?v=3","gravatar_id":"","url":"https://api.github.com/users/tojonmz","html_url":"https://github.com/tojonmz","followers_url":"https://api.github.com/users/tojonmz/followers","following_url":"https://api.github.com/users/tojonmz/following{/other_user}","gists_url":"https://api.github.com/users/tojonmz/gists{/gist_id}","starred_url":"https://api.github.com/users/tojonmz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tojonmz/subscriptions","organizations_url":"https://api.github.com/users/tojonmz/orgs","repos_url":"https://api.github.com/users/tojonmz/repos","events_url":"https://api.github.com/users/tojonmz/events{/privacy}","received_events_url":"https://api.github.com/users/tojonmz/received_events","type":"User","site_admin":false},"body":"Perfect, will do.","created_at":"2015-08-06T18:40:45Z","updated_at":"2015-08-06T18:40:45Z","html_url":"https://github.com/mozilla/treeherder/pull/839#discussion_r36449821","pull_request_url":"https://api.github.com/repos/mozilla/treeherder/pulls/839","_links":{"self":{"href":"https://api.github.com/repos/mozilla/treeherder/pulls/comments/36449821"},"html":{"href":"https://github.com/mozilla/treeherder/pull/839#discussion_r36449821"},"pull_request":{"href":"https://api.github.com/repos/mozilla/treeherder/pulls/839"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/treeherder/pulls/839","id":41818346,"html_url":"https://github.com/mozilla/treeherder/pull/839","diff_url":"https://github.com/mozilla/treeherder/pull/839.diff","patch_url":"https://github.com/mozilla/treeherder/pull/839.patch","issue_url":"https://api.github.com/repos/mozilla/treeherder/issues/839","number":839,"state":"open","locked":false,"title":"Bug 1077338 - Open logviewer on middle-mouse job click","user":{"login":"tojonmz","id":3660661,"avatar_url":"https://avatars.githubusercontent.com/u/3660661?v=3","gravatar_id":"","url":"https://api.github.com/users/tojonmz","html_url":"https://github.com/tojonmz","followers_url":"https://api.github.com/users/tojonmz/followers","following_url":"https://api.github.com/users/tojonmz/following{/other_user}","gists_url":"https://api.github.com/users/tojonmz/gists{/gist_id}","starred_url":"https://api.github.com/users/tojonmz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tojonmz/subscriptions","organizations_url":"https://api.github.com/users/tojonmz/orgs","repos_url":"https://api.github.com/users/tojonmz/repos","events_url":"https://api.github.com/users/tojonmz/events{/privacy}","received_events_url":"https://api.github.com/users/tojonmz/received_events","type":"User","site_admin":false},"body":"This fixes Bugzilla bug [1077338](https://bugzilla.mozilla.org/show_bug.cgi?id=1077338).\r\n\r\nIn the change we open Logviewer for a completed job, when the user selects a job via middle-mouse click. So we start here:\r\n\r\n![mmbclick](https://cloud.githubusercontent.com/assets/3660661/9119398/71b774e6-3c44-11e5-9666-fce1fbe578f6.jpg)\r\n\r\nWe land here:\r\n\r\n![landingproposed](https://cloud.githubusercontent.com/assets/3660661/9119410/7c0462b0-3c44-11e5-92f7-b5c6a40e6b37.jpg)\r\n\r\nEverything seems fine on both browsers, testing a variety of jobs (testfailed, busted, success, retry) where we launch, and pending and running where we will do nothing on the click event, the same as we do now when a raw log doesn't exist.\r\n\r\nTested on OSX 10.10.3:\r\nNightly **42.0a1 (2015-08-05)**\r\nChrome Latest Release **44.0.2403.130 (64-bit)**\r\n\r\nAdding @edmorley for review.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/mozilla/treeherder/839)\n<!-- Reviewable:end -->\n","created_at":"2015-08-06T18:22:35Z","updated_at":"2015-08-06T18:40:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7eeaf785a6ffce8b122ff6a5aeadf4a71f014947","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/treeherder/pulls/839/commits","review_comments_url":"https://api.github.com/repos/mozilla/treeherder/pulls/839/comments","review_comment_url":"https://api.github.com/repos/mozilla/treeherder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/treeherder/issues/839/comments","statuses_url":"https://api.github.com/repos/mozilla/treeherder/statuses/9b67919d445afae55e5b925928c2488ae5a1d2e2","head":{"label":"tojonmz:mmb-logviewer","ref":"mmb-logviewer","sha":"9b67919d445afae55e5b925928c2488ae5a1d2e2","user":{"login":"tojonmz","id":3660661,"avatar_url":"https://avatars.githubusercontent.com/u/3660661?v=3","gravatar_id":"","url":"https://api.github.com/users/tojonmz","html_url":"https://github.com/tojonmz","followers_url":"https://api.github.com/users/tojonmz/followers","following_url":"https://api.github.com/users/tojonmz/following{/other_user}","gists_url":"https://api.github.com/users/tojonmz/gists{/gist_id}","starred_url":"https://api.github.com/users/tojonmz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tojonmz/subscriptions","organizations_url":"https://api.github.com/users/tojonmz/orgs","repos_url":"https://api.github.com/users/tojonmz/repos","events_url":"https://api.github.com/users/tojonmz/events{/privacy}","received_events_url":"https://api.github.com/users/tojonmz/received_events","type":"User","site_admin":false},"repo":{"id":22761777,"name":"treeherder","full_name":"tojonmz/treeherder","owner":{"login":"tojonmz","id":3660661,"avatar_url":"https://avatars.githubusercontent.com/u/3660661?v=3","gravatar_id":"","url":"https://api.github.com/users/tojonmz","html_url":"https://github.com/tojonmz","followers_url":"https://api.github.com/users/tojonmz/followers","following_url":"https://api.github.com/users/tojonmz/following{/other_user}","gists_url":"https://api.github.com/users/tojonmz/gists{/gist_id}","starred_url":"https://api.github.com/users/tojonmz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tojonmz/subscriptions","organizations_url":"https://api.github.com/users/tojonmz/orgs","repos_url":"https://api.github.com/users/tojonmz/repos","events_url":"https://api.github.com/users/tojonmz/events{/privacy}","received_events_url":"https://api.github.com/users/tojonmz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tojonmz/treeherder","description":"The backend of treeherder, a replacement for TBPL. See wiki page for where to file bugs.","fork":true,"url":"https://api.github.com/repos/tojonmz/treeherder","forks_url":"https://api.github.com/repos/tojonmz/treeherder/forks","keys_url":"https://api.github.com/repos/tojonmz/treeherder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tojonmz/treeherder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tojonmz/treeherder/teams","hooks_url":"https://api.github.com/repos/tojonmz/treeherder/hooks","issue_events_url":"https://api.github.com/repos/tojonmz/treeherder/issues/events{/number}","events_url":"https://api.github.com/repos/tojonmz/treeherder/events","assignees_url":"https://api.github.com/repos/tojonmz/treeherder/assignees{/user}","branches_url":"https://api.github.com/repos/tojonmz/treeherder/branches{/branch}","tags_url":"https://api.github.com/repos/tojonmz/treeherder/tags","blobs_url":"https://api.github.com/repos/tojonmz/treeherder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tojonmz/treeherder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tojonmz/treeherder/git/refs{/sha}","trees_url":"https://api.github.com/repos/tojonmz/treeherder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tojonmz/treeherder/statuses/{sha}","languages_url":"https://api.github.com/repos/tojonmz/treeherder/languages","stargazers_url":"https://api.github.com/repos/tojonmz/treeherder/stargazers","contributors_url":"https://api.github.com/repos/tojonmz/treeherder/contributors","subscribers_url":"https://api.github.com/repos/tojonmz/treeherder/subscribers","subscription_url":"https://api.github.com/repos/tojonmz/treeherder/subscription","commits_url":"https://api.github.com/repos/tojonmz/treeherder/commits{/sha}","git_commits_url":"https://api.github.com/repos/tojonmz/treeherder/git/commits{/sha}","comments_url":"https://api.github.com/repos/tojonmz/treeherder/comments{/number}","issue_comment_url":"https://api.github.com/repos/tojonmz/treeherder/issues/comments{/number}","contents_url":"https://api.github.com/repos/tojonmz/treeherder/contents/{+path}","compare_url":"https://api.github.com/repos/tojonmz/treeherder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tojonmz/treeherder/merges","archive_url":"https://api.github.com/repos/tojonmz/treeherder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tojonmz/treeherder/downloads","issues_url":"https://api.github.com/repos/tojonmz/treeherder/issues{/number}","pulls_url":"https://api.github.com/repos/tojonmz/treeherder/pulls{/number}","milestones_url":"https://api.github.com/repos/tojonmz/treeherder/milestones{/number}","notifications_url":"https://api.github.com/repos/tojonmz/treeherder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tojonmz/treeherder/labels{/name}","releases_url":"https://api.github.com/repos/tojonmz/treeherder/releases{/id}","created_at":"2014-08-08T15:11:51Z","updated_at":"2015-04-28T21:02:11Z","pushed_at":"2015-08-06T18:18:48Z","git_url":"git://github.com/tojonmz/treeherder.git","ssh_url":"git@github.com:tojonmz/treeherder.git","clone_url":"https://github.com/tojonmz/treeherder.git","svn_url":"https://github.com/tojonmz/treeherder","homepage":"https://wiki.mozilla.org/Auto-tools/Projects/Treeherder","size":35547,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"727d91f45652b99f27883b5fadddf5578d6d2601","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":8463294,"name":"treeherder","full_name":"mozilla/treeherder","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/treeherder","description":"A reporting dashboard & service for managing CI data for commits to Mozilla projects","fork":false,"url":"https://api.github.com/repos/mozilla/treeherder","forks_url":"https://api.github.com/repos/mozilla/treeherder/forks","keys_url":"https://api.github.com/repos/mozilla/treeherder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/treeherder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/treeherder/teams","hooks_url":"https://api.github.com/repos/mozilla/treeherder/hooks","issue_events_url":"https://api.github.com/repos/mozilla/treeherder/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/treeherder/events","assignees_url":"https://api.github.com/repos/mozilla/treeherder/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/treeherder/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/treeherder/tags","blobs_url":"https://api.github.com/repos/mozilla/treeherder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/treeherder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/treeherder/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/treeherder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/treeherder/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/treeherder/languages","stargazers_url":"https://api.github.com/repos/mozilla/treeherder/stargazers","contributors_url":"https://api.github.com/repos/mozilla/treeherder/contributors","subscribers_url":"https://api.github.com/repos/mozilla/treeherder/subscribers","subscription_url":"https://api.github.com/repos/mozilla/treeherder/subscription","commits_url":"https://api.github.com/repos/mozilla/treeherder/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/treeherder/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/treeherder/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/treeherder/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/treeherder/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/treeherder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/treeherder/merges","archive_url":"https://api.github.com/repos/mozilla/treeherder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/treeherder/downloads","issues_url":"https://api.github.com/repos/mozilla/treeherder/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/treeherder/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/treeherder/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/treeherder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/treeherder/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/treeherder/releases{/id}","created_at":"2013-02-27T19:17:37Z","updated_at":"2015-07-02T05:58:54Z","pushed_at":"2015-08-06T18:22:41Z","git_url":"git://github.com/mozilla/treeherder.git","ssh_url":"git@github.com:mozilla/treeherder.git","clone_url":"https://github.com/mozilla/treeherder.git","svn_url":"https://github.com/mozilla/treeherder","homepage":"https://wiki.mozilla.org/Auto-tools/Projects/Treeherder","size":400254,"stargazers_count":25,"watchers_count":25,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":60,"mirror_url":null,"open_issues_count":22,"forks":60,"open_issues":22,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/treeherder/pulls/839"},"html":{"href":"https://github.com/mozilla/treeherder/pull/839"},"issue":{"href":"https://api.github.com/repos/mozilla/treeherder/issues/839"},"comments":{"href":"https://api.github.com/repos/mozilla/treeherder/issues/839/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/treeherder/pulls/839/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/treeherder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/treeherder/pulls/839/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/treeherder/statuses/9b67919d445afae55e5b925928c2488ae5a1d2e2"}}}}