{"action":"created","comment":{"url":"https://api.github.com/repos/gocd/gocd/pulls/comments/271578556","pull_request_review_id":222004399,"id":271578556,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI3MTU3ODU1Ng==","diff_hunk":"@@ -207,10 +210,16 @@ public String getPluginStatusReport(String pluginId) {\n         throw new UnsupportedOperationException(\"Plugin does not plugin support status report.\");\n     }\n \n-    public String getAgentStatusReport(String pluginId, JobIdentifier jobIdentifier, String elasticAgentId) {\n+    public String getAgentStatusReport(String pluginId, JobIdentifier jobIdentifier, String elasticAgentId) throws Exception {\n         final ElasticAgentPluginInfo pluginInfo = elasticAgentMetadataStore.getPluginInfo(pluginId);\n         if (pluginInfo.getCapabilities().supportsAgentStatusReport()) {\n-            return elasticAgentPluginRegistry.getAgentStatusReport(pluginId, jobIdentifier, elasticAgentId);\n+            JobPlan jobPlan = jobInstanceSqlMapDao.loadPlan(jobIdentifier.getId());\n+            if (jobPlan != null) {\n+                ClusterProfile clusterProfile = jobPlan.getClusterProfile();\n+                Map<String, String> clusterProfileConfigurations = (clusterProfile == null) ? Collections.emptyMap() : clusterProfile.getConfigurationAsMap(true);\n+                return elasticAgentPluginRegistry.getAgentStatusReport(pluginId, jobIdentifier, elasticAgentId, clusterProfileConfigurations);\n+            }\n+            throw new Exception(\"Agent has been terminated. Hence, status is no longer available\");","path":"server/src/main/java/com/thoughtworks/go/server/service/ElasticAgentPluginService.java","position":61,"original_position":61,"commit_id":"9e88af00a7398627ce950bab63ed01203cf3ad8e","original_commit_id":"9e88af00a7398627ce950bab63ed01203cf3ad8e","user":{"login":"GaneshSPatil","id":15275847,"node_id":"MDQ6VXNlcjE1Mjc1ODQ3","avatar_url":"https://avatars0.githubusercontent.com/u/15275847?v=4","gravatar_id":"","url":"https://api.github.com/users/GaneshSPatil","html_url":"https://github.com/GaneshSPatil","followers_url":"https://api.github.com/users/GaneshSPatil/followers","following_url":"https://api.github.com/users/GaneshSPatil/following{/other_user}","gists_url":"https://api.github.com/users/GaneshSPatil/gists{/gist_id}","starred_url":"https://api.github.com/users/GaneshSPatil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GaneshSPatil/subscriptions","organizations_url":"https://api.github.com/users/GaneshSPatil/orgs","repos_url":"https://api.github.com/users/GaneshSPatil/repos","events_url":"https://api.github.com/users/GaneshSPatil/events{/privacy}","received_events_url":"https://api.github.com/users/GaneshSPatil/received_events","type":"User","site_admin":false},"body":"Can we say `Could not fetch agent status report for agent \"agent-uuid\" as either the job running on the agent has been completed or the agent has been terminated.`","created_at":"2019-04-03T04:55:41Z","updated_at":"2019-04-03T04:55:48Z","html_url":"https://github.com/gocd/gocd/pull/6054#discussion_r271578556","pull_request_url":"https://api.github.com/repos/gocd/gocd/pulls/6054","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/gocd/gocd/pulls/comments/271578556"},"html":{"href":"https://github.com/gocd/gocd/pull/6054#discussion_r271578556"},"pull_request":{"href":"https://api.github.com/repos/gocd/gocd/pulls/6054"}}},"pull_request":{"url":"https://api.github.com/repos/gocd/gocd/pulls/6054","id":266497822,"node_id":"MDExOlB1bGxSZXF1ZXN0MjY2NDk3ODIy","html_url":"https://github.com/gocd/gocd/pull/6054","diff_url":"https://github.com/gocd/gocd/pull/6054.diff","patch_url":"https://github.com/gocd/gocd/pull/6054.patch","issue_url":"https://api.github.com/repos/gocd/gocd/issues/6054","number":6054,"state":"open","locked":false,"title":"Updated get-agent-status-report call","user":{"login":"kritika-singh3","id":41165891,"node_id":"MDQ6VXNlcjQxMTY1ODkx","avatar_url":"https://avatars0.githubusercontent.com/u/41165891?v=4","gravatar_id":"","url":"https://api.github.com/users/kritika-singh3","html_url":"https://github.com/kritika-singh3","followers_url":"https://api.github.com/users/kritika-singh3/followers","following_url":"https://api.github.com/users/kritika-singh3/following{/other_user}","gists_url":"https://api.github.com/users/kritika-singh3/gists{/gist_id}","starred_url":"https://api.github.com/users/kritika-singh3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kritika-singh3/subscriptions","organizations_url":"https://api.github.com/users/kritika-singh3/orgs","repos_url":"https://api.github.com/users/kritika-singh3/repos","events_url":"https://api.github.com/users/kritika-singh3/events{/privacy}","received_events_url":"https://api.github.com/users/kritika-singh3/received_events","type":"User","site_admin":false},"body":"Added cluster profile settings to get-agent-status-report call to elastic agent plugins\r\nLink to the issue: #5937","created_at":"2019-04-02T05:57:26Z","updated_at":"2019-04-03T04:55:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b28099cd6351e256d9eb3e8c403c0fb4886ad1bc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/gocd/gocd/pulls/6054/commits","review_comments_url":"https://api.github.com/repos/gocd/gocd/pulls/6054/comments","review_comment_url":"https://api.github.com/repos/gocd/gocd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gocd/gocd/issues/6054/comments","statuses_url":"https://api.github.com/repos/gocd/gocd/statuses/9e88af00a7398627ce950bab63ed01203cf3ad8e","head":{"label":"kritika-singh3:agent-status-report","ref":"agent-status-report","sha":"9e88af00a7398627ce950bab63ed01203cf3ad8e","user":{"login":"kritika-singh3","id":41165891,"node_id":"MDQ6VXNlcjQxMTY1ODkx","avatar_url":"https://avatars0.githubusercontent.com/u/41165891?v=4","gravatar_id":"","url":"https://api.github.com/users/kritika-singh3","html_url":"https://github.com/kritika-singh3","followers_url":"https://api.github.com/users/kritika-singh3/followers","following_url":"https://api.github.com/users/kritika-singh3/following{/other_user}","gists_url":"https://api.github.com/users/kritika-singh3/gists{/gist_id}","starred_url":"https://api.github.com/users/kritika-singh3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kritika-singh3/subscriptions","organizations_url":"https://api.github.com/users/kritika-singh3/orgs","repos_url":"https://api.github.com/users/kritika-singh3/repos","events_url":"https://api.github.com/users/kritika-singh3/events{/privacy}","received_events_url":"https://api.github.com/users/kritika-singh3/received_events","type":"User","site_admin":false},"repo":{"id":161285165,"node_id":"MDEwOlJlcG9zaXRvcnkxNjEyODUxNjU=","name":"gocd","full_name":"kritika-singh3/gocd","private":false,"owner":{"login":"kritika-singh3","id":41165891,"node_id":"MDQ6VXNlcjQxMTY1ODkx","avatar_url":"https://avatars0.githubusercontent.com/u/41165891?v=4","gravatar_id":"","url":"https://api.github.com/users/kritika-singh3","html_url":"https://github.com/kritika-singh3","followers_url":"https://api.github.com/users/kritika-singh3/followers","following_url":"https://api.github.com/users/kritika-singh3/following{/other_user}","gists_url":"https://api.github.com/users/kritika-singh3/gists{/gist_id}","starred_url":"https://api.github.com/users/kritika-singh3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kritika-singh3/subscriptions","organizations_url":"https://api.github.com/users/kritika-singh3/orgs","repos_url":"https://api.github.com/users/kritika-singh3/repos","events_url":"https://api.github.com/users/kritika-singh3/events{/privacy}","received_events_url":"https://api.github.com/users/kritika-singh3/received_events","type":"User","site_admin":false},"html_url":"https://github.com/kritika-singh3/gocd","description":"Main repository for GoCD - Continuous Delivery server","fork":true,"url":"https://api.github.com/repos/kritika-singh3/gocd","forks_url":"https://api.github.com/repos/kritika-singh3/gocd/forks","keys_url":"https://api.github.com/repos/kritika-singh3/gocd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kritika-singh3/gocd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kritika-singh3/gocd/teams","hooks_url":"https://api.github.com/repos/kritika-singh3/gocd/hooks","issue_events_url":"https://api.github.com/repos/kritika-singh3/gocd/issues/events{/number}","events_url":"https://api.github.com/repos/kritika-singh3/gocd/events","assignees_url":"https://api.github.com/repos/kritika-singh3/gocd/assignees{/user}","branches_url":"https://api.github.com/repos/kritika-singh3/gocd/branches{/branch}","tags_url":"https://api.github.com/repos/kritika-singh3/gocd/tags","blobs_url":"https://api.github.com/repos/kritika-singh3/gocd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kritika-singh3/gocd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kritika-singh3/gocd/git/refs{/sha}","trees_url":"https://api.github.com/repos/kritika-singh3/gocd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kritika-singh3/gocd/statuses/{sha}","languages_url":"https://api.github.com/repos/kritika-singh3/gocd/languages","stargazers_url":"https://api.github.com/repos/kritika-singh3/gocd/stargazers","contributors_url":"https://api.github.com/repos/kritika-singh3/gocd/contributors","subscribers_url":"https://api.github.com/repos/kritika-singh3/gocd/subscribers","subscription_url":"https://api.github.com/repos/kritika-singh3/gocd/subscription","commits_url":"https://api.github.com/repos/kritika-singh3/gocd/commits{/sha}","git_commits_url":"https://api.github.com/repos/kritika-singh3/gocd/git/commits{/sha}","comments_url":"https://api.github.com/repos/kritika-singh3/gocd/comments{/number}","issue_comment_url":"https://api.github.com/repos/kritika-singh3/gocd/issues/comments{/number}","contents_url":"https://api.github.com/repos/kritika-singh3/gocd/contents/{+path}","compare_url":"https://api.github.com/repos/kritika-singh3/gocd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kritika-singh3/gocd/merges","archive_url":"https://api.github.com/repos/kritika-singh3/gocd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kritika-singh3/gocd/downloads","issues_url":"https://api.github.com/repos/kritika-singh3/gocd/issues{/number}","pulls_url":"https://api.github.com/repos/kritika-singh3/gocd/pulls{/number}","milestones_url":"https://api.github.com/repos/kritika-singh3/gocd/milestones{/number}","notifications_url":"https://api.github.com/repos/kritika-singh3/gocd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kritika-singh3/gocd/labels{/name}","releases_url":"https://api.github.com/repos/kritika-singh3/gocd/releases{/id}","deployments_url":"https://api.github.com/repos/kritika-singh3/gocd/deployments","created_at":"2018-12-11T06:04:03Z","updated_at":"2019-03-29T05:09:30Z","pushed_at":"2019-04-02T12:49:43Z","git_url":"git://github.com/kritika-singh3/gocd.git","ssh_url":"git@github.com:kritika-singh3/gocd.git","clone_url":"https://github.com/kritika-singh3/gocd.git","svn_url":"https://github.com/kritika-singh3/gocd","homepage":"https://www.gocd.org","size":279206,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gocd:master","ref":"master","sha":"b41c08c0cef95b925adbd2446ecd6072dd1e3f38","user":{"login":"gocd","id":6099846,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwOTk4NDY=","avatar_url":"https://avatars1.githubusercontent.com/u/6099846?v=4","gravatar_id":"","url":"https://api.github.com/users/gocd","html_url":"https://github.com/gocd","followers_url":"https://api.github.com/users/gocd/followers","following_url":"https://api.github.com/users/gocd/following{/other_user}","gists_url":"https://api.github.com/users/gocd/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd/subscriptions","organizations_url":"https://api.github.com/users/gocd/orgs","repos_url":"https://api.github.com/users/gocd/repos","events_url":"https://api.github.com/users/gocd/events{/privacy}","received_events_url":"https://api.github.com/users/gocd/received_events","type":"Organization","site_admin":false},"repo":{"id":15155534,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE1NTUzNA==","name":"gocd","full_name":"gocd/gocd","private":false,"owner":{"login":"gocd","id":6099846,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwOTk4NDY=","avatar_url":"https://avatars1.githubusercontent.com/u/6099846?v=4","gravatar_id":"","url":"https://api.github.com/users/gocd","html_url":"https://github.com/gocd","followers_url":"https://api.github.com/users/gocd/followers","following_url":"https://api.github.com/users/gocd/following{/other_user}","gists_url":"https://api.github.com/users/gocd/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd/subscriptions","organizations_url":"https://api.github.com/users/gocd/orgs","repos_url":"https://api.github.com/users/gocd/repos","events_url":"https://api.github.com/users/gocd/events{/privacy}","received_events_url":"https://api.github.com/users/gocd/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/gocd/gocd","description":"Main repository for GoCD - Continuous Delivery server","fork":false,"url":"https://api.github.com/repos/gocd/gocd","forks_url":"https://api.github.com/repos/gocd/gocd/forks","keys_url":"https://api.github.com/repos/gocd/gocd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gocd/gocd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gocd/gocd/teams","hooks_url":"https://api.github.com/repos/gocd/gocd/hooks","issue_events_url":"https://api.github.com/repos/gocd/gocd/issues/events{/number}","events_url":"https://api.github.com/repos/gocd/gocd/events","assignees_url":"https://api.github.com/repos/gocd/gocd/assignees{/user}","branches_url":"https://api.github.com/repos/gocd/gocd/branches{/branch}","tags_url":"https://api.github.com/repos/gocd/gocd/tags","blobs_url":"https://api.github.com/repos/gocd/gocd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gocd/gocd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gocd/gocd/git/refs{/sha}","trees_url":"https://api.github.com/repos/gocd/gocd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gocd/gocd/statuses/{sha}","languages_url":"https://api.github.com/repos/gocd/gocd/languages","stargazers_url":"https://api.github.com/repos/gocd/gocd/stargazers","contributors_url":"https://api.github.com/repos/gocd/gocd/contributors","subscribers_url":"https://api.github.com/repos/gocd/gocd/subscribers","subscription_url":"https://api.github.com/repos/gocd/gocd/subscription","commits_url":"https://api.github.com/repos/gocd/gocd/commits{/sha}","git_commits_url":"https://api.github.com/repos/gocd/gocd/git/commits{/sha}","comments_url":"https://api.github.com/repos/gocd/gocd/comments{/number}","issue_comment_url":"https://api.github.com/repos/gocd/gocd/issues/comments{/number}","contents_url":"https://api.github.com/repos/gocd/gocd/contents/{+path}","compare_url":"https://api.github.com/repos/gocd/gocd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gocd/gocd/merges","archive_url":"https://api.github.com/repos/gocd/gocd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gocd/gocd/downloads","issues_url":"https://api.github.com/repos/gocd/gocd/issues{/number}","pulls_url":"https://api.github.com/repos/gocd/gocd/pulls{/number}","milestones_url":"https://api.github.com/repos/gocd/gocd/milestones{/number}","notifications_url":"https://api.github.com/repos/gocd/gocd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gocd/gocd/labels{/name}","releases_url":"https://api.github.com/repos/gocd/gocd/releases{/id}","deployments_url":"https://api.github.com/repos/gocd/gocd/deployments","created_at":"2013-12-13T05:26:16Z","updated_at":"2019-04-02T22:48:02Z","pushed_at":"2019-04-03T04:26:40Z","git_url":"git://github.com/gocd/gocd.git","ssh_url":"git@github.com:gocd/gocd.git","clone_url":"https://github.com/gocd/gocd.git","svn_url":"https://github.com/gocd/gocd","homepage":"https://www.gocd.org","size":279245,"stargazers_count":4787,"watchers_count":4787,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":768,"mirror_url":null,"archived":false,"open_issues_count":761,"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":768,"open_issues":761,"watchers":4787,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gocd/gocd/pulls/6054"},"html":{"href":"https://github.com/gocd/gocd/pull/6054"},"issue":{"href":"https://api.github.com/repos/gocd/gocd/issues/6054"},"comments":{"href":"https://api.github.com/repos/gocd/gocd/issues/6054/comments"},"review_comments":{"href":"https://api.github.com/repos/gocd/gocd/pulls/6054/comments"},"review_comment":{"href":"https://api.github.com/repos/gocd/gocd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gocd/gocd/pulls/6054/commits"},"statuses":{"href":"https://api.github.com/repos/gocd/gocd/statuses/9e88af00a7398627ce950bab63ed01203cf3ad8e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"GaneshSPatil"}}