payload: {"action":"created","comment":{"url":"https://api.github.com/repos/heketi/heketi/pulls/comments/274938123","pull_request_review_id":226121711,"id":274938123,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI3NDkzODEyMw==","diff_hunk":"@@ -168,3 +169,37 @@ func TestTryOnHosts(t *testing.T) {\n \t\ttests.Assert(t, len(checked) == 1)\n \t})\n }\n+\n+func TestTryOnHostsMultiError(t *testing.T) {\n+\thosts := nodeHosts{\n+\t\t\"foo\": \"123\",\n+\t\t\"bar\": \"456\",\n+\t\t\"baz\": \"789\",\n+\t}\n+\n+\tt.Run(\"oneErrorSkipped\", func(t *testing.T) {\n+\t\terr := newTryOnHosts(hosts).run(func(h string) error {\n+\t\t\tif h == \"foo\" {\n+\t\t\t\treturn fmt.Errorf(\"boop\")\n+\t\t\t}\n+\t\t\treturn nil\n+\t\t})\n+\t\ttests.Assert(t, err == nil)\n+\t})\n+\tt.Run(\"allErrorSame\", func(t *testing.T) {\n+\t\terr := newTryOnHosts(hosts).run(func(h string) error {\n+\t\t\treturn fmt.Errorf(\"boop\")\n+\t\t})\n+\t\ttests.Assert(t, err != nil, \"expected err != nil, got:\", err)\n+\t\ttests.Assert(t, strings.Count(err.Error(), \"boop\") == 1,\n+\t\t\t\"expected 1 instance of 'boop' in\", err)\n+\t})\n+\tt.Run(\"allErrorDifferent\", func(t *testing.T) {\n+\t\terr := newTryOnHosts(hosts).run(func(h string) error {\n+\t\t\treturn fmt.Errorf(\"%v is sad\", h)\n+\t\t})\n+\t\ttests.Assert(t, err != nil, \"expected err != nil, got:\", err)\n+\t\ttests.Assert(t, strings.Count(err.Error(), \"sad\") == 3,\n+\t\t\t\"expected 3 instances of 'sad' in\", err)\n+\t})\n+}","path":"apps/glusterfs/try_on_host_test.go","position":45,"original_position":45,"commit_id":"312695f9c9061149424ce50e0aef05f93db1859a","original_commit_id":"c332e043911919768b5d604cd44c7b848d5c3284","user":{"login":"raghavendra-talur","id":1446375,"node_id":"MDQ6VXNlcjE0NDYzNzU=","avatar_url":"https://avatars3.githubusercontent.com/u/1446375?v=4","gravatar_id":"","url":"https://api.github.com/users/raghavendra-talur","html_url":"https://github.com/raghavendra-talur","followers_url":"https://api.github.com/users/raghavendra-talur/followers","following_url":"https://api.github.com/users/raghavendra-talur/following{/other_user}","gists_url":"https://api.github.com/users/raghavendra-talur/gists{/gist_id}","starred_url":"https://api.github.com/users/raghavendra-talur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raghavendra-talur/subscriptions","organizations_url":"https://api.github.com/users/raghavendra-talur/orgs","repos_url":"https://api.github.com/users/raghavendra-talur/repos","events_url":"https://api.github.com/users/raghavendra-talur/events{/privacy}","received_events_url":"https://api.github.com/users/raghavendra-talur/received_events","type":"User","site_admin":false},"body":"Let us also add a test case for no error case.","created_at":"2019-04-12T14:44:20Z","updated_at":"2019-04-12T14:44:34Z","html_url":"https://github.com/heketi/heketi/pull/1570#discussion_r274938123","pull_request_url":"https://api.github.com/repos/heketi/heketi/pulls/1570","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/heketi/heketi/pulls/comments/274938123"},"html":{"href":"https://github.com/heketi/heketi/pull/1570#discussion_r274938123"},"pull_request":{"href":"https://api.github.com/repos/heketi/heketi/pulls/1570"}}},"pull_request":{"url":"https://api.github.com/repos/heketi/heketi/pulls/1570","id":266272219,"node_id":"MDExOlB1bGxSZXF1ZXN0MjY2MjcyMjE5","html_url":"https://github.com/heketi/heketi/pull/1570","diff_url":"https://github.com/heketi/heketi/pull/1570.diff","patch_url":"https://github.com/heketi/heketi/pull/1570.patch","issue_url":"https://api.github.com/repos/heketi/heketi/issues/1570","number":1570,"state":"open","locked":false,"title":"apps: add a new multi-host-error type for handling tries over many hosts","user":{"login":"phlogistonjohn","id":33039589,"node_id":"MDQ6VXNlcjMzMDM5NTg5","avatar_url":"https://avatars0.githubusercontent.com/u/33039589?v=4","gravatar_id":"","url":"https://api.github.com/users/phlogistonjohn","html_url":"https://github.com/phlogistonjohn","followers_url":"https://api.github.com/users/phlogistonjohn/followers","following_url":"https://api.github.com/users/phlogistonjohn/following{/other_user}","gists_url":"https://api.github.com/users/phlogistonjohn/gists{/gist_id}","starred_url":"https://api.github.com/users/phlogistonjohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phlogistonjohn/subscriptions","organizations_url":"https://api.github.com/users/phlogistonjohn/orgs","repos_url":"https://api.github.com/users/phlogistonjohn/repos","events_url":"https://api.github.com/users/phlogistonjohn/events{/privacy}","received_events_url":"https://api.github.com/users/phlogistonjohn/received_events","type":"User","site_admin":false},"body":"### What does this PR achieve? Why do we need it?\r\n\r\nInstead of hiding the errors returned by various hosts in the\r\ntry-on-hosts loop, capture them all in a new multi-hosts-error type.\r\nThis type works like the multi-cluster-error type. Additionally,\r\nif all hosts return the same error it will \"compact\" the error message.\r\n\r\n### Does this PR fix issues?\r\n\r\nFixes #\r\n\r\n\r\n### Notes for the reviewer\r\n\r\n\r\n","created_at":"2019-04-01T14:41:15Z","updated_at":"2019-04-12T14:44:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"066ede36fe537eefad70015d9fb5f2bdb4dc7cc2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/heketi/heketi/pulls/1570/commits","review_comments_url":"https://api.github.com/repos/heketi/heketi/pulls/1570/comments","review_comment_url":"https://api.github.com/repos/heketi/heketi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/heketi/heketi/issues/1570/comments","statuses_url":"https://api.github.com/repos/heketi/heketi/statuses/312695f9c9061149424ce50e0aef05f93db1859a","head":{"label":"phlogistonjohn:jjm-multi-hosts-error","ref":"jjm-multi-hosts-error","sha":"312695f9c9061149424ce50e0aef05f93db1859a","user":{"login":"phlogistonjohn","id":33039589,"node_id":"MDQ6VXNlcjMzMDM5NTg5","avatar_url":"https://avatars0.githubusercontent.com/u/33039589?v=4","gravatar_id":"","url":"https://api.github.com/users/phlogistonjohn","html_url":"https://github.com/phlogistonjohn","followers_url":"https://api.github.com/users/phlogistonjohn/followers","following_url":"https://api.github.com/users/phlogistonjohn/following{/other_user}","gists_url":"https://api.github.com/users/phlogistonjohn/gists{/gist_id}","starred_url":"https://api.github.com/users/phlogistonjohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phlogistonjohn/subscriptions","organizations_url":"https://api.github.com/users/phlogistonjohn/orgs","repos_url":"https://api.github.com/users/phlogistonjohn/repos","events_url":"https://api.github.com/users/phlogistonjohn/events{/privacy}","received_events_url":"https://api.github.com/users/phlogistonjohn/received_events","type":"User","site_admin":false},"repo":{"id":109308279,"node_id":"MDEwOlJlcG9zaXRvcnkxMDkzMDgyNzk=","name":"heketi","full_name":"phlogistonjohn/heketi","private":false,"owner":{"login":"phlogistonjohn","id":33039589,"node_id":"MDQ6VXNlcjMzMDM5NTg5","avatar_url":"https://avatars0.githubusercontent.com/u/33039589?v=4","gravatar_id":"","url":"https://api.github.com/users/phlogistonjohn","html_url":"https://github.com/phlogistonjohn","followers_url":"https://api.github.com/users/phlogistonjohn/followers","following_url":"https://api.github.com/users/phlogistonjohn/following{/other_user}","gists_url":"https://api.github.com/users/phlogistonjohn/gists{/gist_id}","starred_url":"https://api.github.com/users/phlogistonjohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phlogistonjohn/subscriptions","organizations_url":"https://api.github.com/users/phlogistonjohn/orgs","repos_url":"https://api.github.com/users/phlogistonjohn/repos","events_url":"https://api.github.com/users/phlogistonjohn/events{/privacy}","received_events_url":"https://api.github.com/users/phlogistonjohn/received_events","type":"User","site_admin":false},"html_url":"https://github.com/phlogistonjohn/heketi","description":"RESTful based volume management framework for GlusterFS","fork":true,"url":"https://api.github.com/repos/phlogistonjohn/heketi","forks_url":"https://api.github.com/repos/phlogistonjohn/heketi/forks","keys_url":"https://api.github.com/repos/phlogistonjohn/heketi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phlogistonjohn/heketi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phlogistonjohn/heketi/teams","hooks_url":"https://api.github.com/repos/phlogistonjohn/heketi/hooks","issue_events_url":"https://api.github.com/repos/phlogistonjohn/heketi/issues/events{/number}","events_url":"https://api.github.com/repos/phlogistonjohn/heketi/events","assignees_url":"https://api.github.com/repos/phlogistonjohn/heketi/assignees{/user}","branches_url":"https://api.github.com/repos/phlogistonjohn/heketi/branches{/branch}","tags_url":"https://api.github.com/repos/phlogistonjohn/heketi/tags","blobs_url":"https://api.github.com/repos/phlogistonjohn/heketi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phlogistonjohn/heketi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phlogistonjohn/heketi/git/refs{/sha}","trees_url":"https://api.github.com/repos/phlogistonjohn/heketi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phlogistonjohn/heketi/statuses/{sha}","languages_url":"https://api.github.com/repos/phlogistonjohn/heketi/languages","stargazers_url":"https://api.github.com/repos/phlogistonjohn/heketi/stargazers","contributors_url":"https://api.github.com/repos/phlogistonjohn/heketi/contributors","subscribers_url":"https://api.github.com/repos/phlogistonjohn/heketi/subscribers","subscription_url":"https://api.github.com/repos/phlogistonjohn/heketi/subscription","commits_url":"https://api.github.com/repos/phlogistonjohn/heketi/commits{/sha}","git_commits_url":"https://api.github.com/repos/phlogistonjohn/heketi/git/commits{/sha}","comments_url":"https://api.github.com/repos/phlogistonjohn/heketi/comments{/number}","issue_comment_url":"https://api.github.com/repos/phlogistonjohn/heketi/issues/comments{/number}","contents_url":"https://api.github.com/repos/phlogistonjohn/heketi/contents/{+path}","compare_url":"https://api.github.com/repos/phlogistonjohn/heketi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phlogistonjohn/heketi/merges","archive_url":"https://api.github.com/repos/phlogistonjohn/heketi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phlogistonjohn/heketi/downloads","issues_url":"https://api.github.com/repos/phlogistonjohn/heketi/issues{/number}","pulls_url":"https://api.github.com/repos/phlogistonjohn/heketi/pulls{/number}","milestones_url":"https://api.github.com/repos/phlogistonjohn/heketi/milestones{/number}","notifications_url":"https://api.github.com/repos/phlogistonjohn/heketi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phlogistonjohn/heketi/labels{/name}","releases_url":"https://api.github.com/repos/phlogistonjohn/heketi/releases{/id}","deployments_url":"https://api.github.com/repos/phlogistonjohn/heketi/deployments","created_at":"2017-11-02T19:14:50Z","updated_at":"2017-11-02T19:14:52Z","pushed_at":"2019-04-12T14:38:45Z","git_url":"git://github.com/phlogistonjohn/heketi.git","ssh_url":"git@github.com:phlogistonjohn/heketi.git","clone_url":"https://github.com/phlogistonjohn/heketi.git","svn_url":"https://github.com/phlogistonjohn/heketi","homepage":"","size":21820,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"heketi:master","ref":"master","sha":"a354187e751df5edc5ec6688108faa9cc463d7c3","user":{"login":"heketi","id":12890374,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODkwMzc0","avatar_url":"https://avatars0.githubusercontent.com/u/12890374?v=4","gravatar_id":"","url":"https://api.github.com/users/heketi","html_url":"https://github.com/heketi","followers_url":"https://api.github.com/users/heketi/followers","following_url":"https://api.github.com/users/heketi/following{/other_user}","gists_url":"https://api.github.com/users/heketi/gists{/gist_id}","starred_url":"https://api.github.com/users/heketi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heketi/subscriptions","organizations_url":"https://api.github.com/users/heketi/orgs","repos_url":"https://api.github.com/users/heketi/repos","events_url":"https://api.github.com/users/heketi/events{/privacy}","received_events_url":"https://api.github.com/users/heketi/received_events","type":"Organization","site_admin":false},"repo":{"id":37446835,"node_id":"MDEwOlJlcG9zaXRvcnkzNzQ0NjgzNQ==","name":"heketi","full_name":"heketi/heketi","private":false,"owner":{"login":"heketi","id":12890374,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODkwMzc0","avatar_url":"https://avatars0.githubusercontent.com/u/12890374?v=4","gravatar_id":"","url":"https://api.github.com/users/heketi","html_url":"https://github.com/heketi","followers_url":"https://api.github.com/users/heketi/followers","following_url":"https://api.github.com/users/heketi/following{/other_user}","gists_url":"https://api.github.com/users/heketi/gists{/gist_id}","starred_url":"https://api.github.com/users/heketi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heketi/subscriptions","organizations_url":"https://api.github.com/users/heketi/orgs","repos_url":"https://api.github.com/users/heketi/repos","events_url":"https://api.github.com/users/heketi/events{/privacy}","received_events_url":"https://api.github.com/users/heketi/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/heketi/heketi","description":"RESTful based volume management framework for GlusterFS","fork":false,"url":"https://api.github.com/repos/heketi/heketi","forks_url":"https://api.github.com/repos/heketi/heketi/forks","keys_url":"https://api.github.com/repos/heketi/heketi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heketi/heketi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heketi/heketi/teams","hooks_url":"https://api.github.com/repos/heketi/heketi/hooks","issue_events_url":"https://api.github.com/repos/heketi/heketi/issues/events{/number}","events_url":"https://api.github.com/repos/heketi/heketi/events","assignees_url":"https://api.github.com/repos/heketi/heketi/assignees{/user}","branches_url":"https://api.github.com/repos/heketi/heketi/branches{/branch}","tags_url":"https://api.github.com/repos/heketi/heketi/tags","blobs_url":"https://api.github.com/repos/heketi/heketi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heketi/heketi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heketi/heketi/git/refs{/sha}","trees_url":"https://api.github.com/repos/heketi/heketi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heketi/heketi/statuses/{sha}","languages_url":"https://api.github.com/repos/heketi/heketi/languages","stargazers_url":"https://api.github.com/repos/heketi/heketi/stargazers","contributors_url":"https://api.github.com/repos/heketi/heketi/contributors","subscribers_url":"https://api.github.com/repos/heketi/heketi/subscribers","subscription_url":"https://api.github.com/repos/heketi/heketi/subscription","commits_url":"https://api.github.com/repos/heketi/heketi/commits{/sha}","git_commits_url":"https://api.github.com/repos/heketi/heketi/git/commits{/sha}","comments_url":"https://api.github.com/repos/heketi/heketi/comments{/number}","issue_comment_url":"https://api.github.com/repos/heketi/heketi/issues/comments{/number}","contents_url":"https://api.github.com/repos/heketi/heketi/contents/{+path}","compare_url":"https://api.github.com/repos/heketi/heketi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heketi/heketi/merges","archive_url":"https://api.github.com/repos/heketi/heketi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heketi/heketi/downloads","issues_url":"https://api.github.com/repos/heketi/heketi/issues{/number}","pulls_url":"https://api.github.com/repos/heketi/heketi/pulls{/number}","milestones_url":"https://api.github.com/repos/heketi/heketi/milestones{/number}","notifications_url":"https://api.github.com/repos/heketi/heketi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heketi/heketi/labels{/name}","releases_url":"https://api.github.com/repos/heketi/heketi/releases{/id}","deployments_url":"https://api.github.com/repos/heketi/heketi/deployments","created_at":"2015-06-15T06:10:11Z","updated_at":"2019-04-12T14:15:39Z","pushed_at":"2019-04-12T14:38:47Z","git_url":"git://github.com/heketi/heketi.git","ssh_url":"git@github.com:heketi/heketi.git","clone_url":"https://github.com/heketi/heketi.git","svn_url":"https://github.com/heketi/heketi","homepage":"","size":21538,"stargazers_count":807,"watchers_count":807,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":282,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":177,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":282,"open_issues":177,"watchers":807,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/heketi/heketi/pulls/1570"},"html":{"href":"https://github.com/heketi/heketi/pull/1570"},"issue":{"href":"https://api.github.com/repos/heketi/heketi/issues/1570"},"comments":{"href":"https://api.github.com/repos/heketi/heketi/issues/1570/comments"},"review_comments":{"href":"https://api.github.com/repos/heketi/heketi/pulls/1570/comments"},"review_comment":{"href":"https://api.github.com/repos/heketi/heketi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/heketi/heketi/pulls/1570/commits"},"statuses":{"href":"https://api.github.com/repos/heketi/heketi/statuses/312695f9c9061149424ce50e0aef05f93db1859a"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"raghavendra-talur"}}