{"action":"created","comment":{"url":"https://api.github.com/repos/release-engineering/kojiji/pulls/comments/205680936","pull_request_review_id":140999996,"id":205680936,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTY4MDkzNg==","diff_hunk":"@@ -0,0 +1,76 @@\n+package com.redhat.red.build.koji;\n+\n+import com.redhat.red.build.koji.model.xmlrpc.KojiArchiveInfo;\n+import com.redhat.red.build.koji.model.xmlrpc.KojiArchiveQuery;\n+import com.redhat.red.build.koji.model.xmlrpc.KojiMultiCallValueObj;\n+import com.redhat.red.build.koji.model.xmlrpc.KojiSessionInfo;\n+import com.redhat.red.build.koji.model.xmlrpc.messages.MultiCallRequest;\n+import com.redhat.red.build.koji.model.xmlrpc.messages.MultiCallResponse;\n+import org.commonjava.rwx.core.Registry;\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+import static com.redhat.red.build.koji.model.xmlrpc.messages.Constants.LIST_ARCHIVES;\n+import static com.redhat.red.build.koji.model.xmlrpc.messages.MultiCallRequest.getBuilder;\n+\n+/**\n+ * This class provides advanced helper methods, e.g., using multicall to batch query operations.\n+ */\n+public class KojiClientHelper\n+{\n+    private final KojiClient client;\n+\n+    private final Registry registry = Registry.getInstance();\n+\n+    public KojiClientHelper( KojiClient client )\n+    {\n+        this.client = client;\n+    }\n+\n+    /**\n+     * This method sends a list of KojiArchiveQuery queries, and get back the responses for those queries.\n+     * The responses are in a List and have the same order corresponding to the query objects,\n+     * i.e., if the requests contains [req-1, req-2, ...], the responses are [resp-1, resp-2, ...].\n+     *\n+     * If any query gets no result, its response would be an empty List.\n+     *\n+     * @param queries a list of KojiArchiveQuery queries\n+     * @param session\n+     * @return a list of response objects. Each response object is a List of KojiArchiveInfo instance.\n+     * @throws KojiClientException\n+     */\n+    public List<List<KojiArchiveInfo>> listArchives( List<KojiArchiveQuery> queries, KojiSessionInfo session )\n+                    throws KojiClientException\n+    {\n+        List<Object> args = new ArrayList<>();\n+        for ( KojiArchiveQuery query : queries )\n+        {\n+            args.add( registry.renderTo( query ) );\n+        }\n+\n+        MultiCallRequest.Builder builder = getBuilder();\n+        args.forEach(( arg ) -> builder.addCallObj( LIST_ARCHIVES, arg ) );\n+\n+        List<List<KojiArchiveInfo>> ret = new ArrayList<>();\n+\n+        MultiCallResponse multiCallResponse = client.multiCall( builder.build(), session );\n+        List<KojiMultiCallValueObj> multiCallValueObjs = multiCallResponse.getValueObjs();\n+\n+        multiCallValueObjs.forEach( v -> {\n+            Object data = v.getData();\n+            if ( data instanceof List )","path":"src/main/java/com/redhat/red/build/koji/KojiClientHelper.java","position":62,"original_position":62,"commit_id":"c4a6c8017f5341f4496dc5be21cfb71902c4985f","original_commit_id":"c4a6c8017f5341f4496dc5be21cfb71902c4985f","user":{"login":"dwalluck","id":5445917,"node_id":"MDQ6VXNlcjU0NDU5MTc=","avatar_url":"https://avatars1.githubusercontent.com/u/5445917?v=4","gravatar_id":"","url":"https://api.github.com/users/dwalluck","html_url":"https://github.com/dwalluck","followers_url":"https://api.github.com/users/dwalluck/followers","following_url":"https://api.github.com/users/dwalluck/following{/other_user}","gists_url":"https://api.github.com/users/dwalluck/gists{/gist_id}","starred_url":"https://api.github.com/users/dwalluck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwalluck/subscriptions","organizations_url":"https://api.github.com/users/dwalluck/orgs","repos_url":"https://api.github.com/users/dwalluck/repos","events_url":"https://api.github.com/users/dwalluck/events{/privacy}","received_events_url":"https://api.github.com/users/dwalluck/received_events","type":"User","site_admin":false},"body":"It's possible that this returns false if a fault occurs, and then the returned list will have the wrong offsets. Unfortunately, the only way to handle it now without additional code is to either throw an `Exception` when this occurs, or add some empty placeholder object, so at least then the client could verify  its validity. The same issue occurs elsewhere in the code.","created_at":"2018-07-27T06:42:41Z","updated_at":"2018-07-27T06:42:41Z","html_url":"https://github.com/release-engineering/kojiji/pull/105#discussion_r205680936","pull_request_url":"https://api.github.com/repos/release-engineering/kojiji/pulls/105","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/release-engineering/kojiji/pulls/comments/205680936"},"html":{"href":"https://github.com/release-engineering/kojiji/pull/105#discussion_r205680936"},"pull_request":{"href":"https://api.github.com/repos/release-engineering/kojiji/pulls/105"}}},"pull_request":{"url":"https://api.github.com/repos/release-engineering/kojiji/pulls/105","id":204334436,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0MzM0NDM2","html_url":"https://github.com/release-engineering/kojiji/pull/105","diff_url":"https://github.com/release-engineering/kojiji/pull/105.diff","patch_url":"https://github.com/release-engineering/kojiji/pull/105.patch","issue_url":"https://api.github.com/repos/release-engineering/kojiji/issues/105","number":105,"state":"open","locked":false,"title":"Add multicall listArchives to send a list of queries in a batch","user":{"login":"ruhan1","id":6487802,"node_id":"MDQ6VXNlcjY0ODc4MDI=","avatar_url":"https://avatars0.githubusercontent.com/u/6487802?v=4","gravatar_id":"","url":"https://api.github.com/users/ruhan1","html_url":"https://github.com/ruhan1","followers_url":"https://api.github.com/users/ruhan1/followers","following_url":"https://api.github.com/users/ruhan1/following{/other_user}","gists_url":"https://api.github.com/users/ruhan1/gists{/gist_id}","starred_url":"https://api.github.com/users/ruhan1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruhan1/subscriptions","organizations_url":"https://api.github.com/users/ruhan1/orgs","repos_url":"https://api.github.com/users/ruhan1/repos","events_url":"https://api.github.com/users/ruhan1/events{/privacy}","received_events_url":"https://api.github.com/users/ruhan1/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-27T05:41:18Z","updated_at":"2018-07-27T06:42:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a230a21cd6c6cc7f72fdeb92d7d6f75ae5e32fe","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/release-engineering/kojiji/pulls/105/commits","review_comments_url":"https://api.github.com/repos/release-engineering/kojiji/pulls/105/comments","review_comment_url":"https://api.github.com/repos/release-engineering/kojiji/pulls/comments{/number}","comments_url":"https://api.github.com/repos/release-engineering/kojiji/issues/105/comments","statuses_url":"https://api.github.com/repos/release-engineering/kojiji/statuses/c4a6c8017f5341f4496dc5be21cfb71902c4985f","head":{"label":"ruhan1:master-multicall-list","ref":"master-multicall-list","sha":"c4a6c8017f5341f4496dc5be21cfb71902c4985f","user":{"login":"ruhan1","id":6487802,"node_id":"MDQ6VXNlcjY0ODc4MDI=","avatar_url":"https://avatars0.githubusercontent.com/u/6487802?v=4","gravatar_id":"","url":"https://api.github.com/users/ruhan1","html_url":"https://github.com/ruhan1","followers_url":"https://api.github.com/users/ruhan1/followers","following_url":"https://api.github.com/users/ruhan1/following{/other_user}","gists_url":"https://api.github.com/users/ruhan1/gists{/gist_id}","starred_url":"https://api.github.com/users/ruhan1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruhan1/subscriptions","organizations_url":"https://api.github.com/users/ruhan1/orgs","repos_url":"https://api.github.com/users/ruhan1/repos","events_url":"https://api.github.com/users/ruhan1/events{/privacy}","received_events_url":"https://api.github.com/users/ruhan1/received_events","type":"User","site_admin":false},"repo":{"id":69532293,"node_id":"MDEwOlJlcG9zaXRvcnk2OTUzMjI5Mw==","name":"kojiji","full_name":"ruhan1/kojiji","owner":{"login":"ruhan1","id":6487802,"node_id":"MDQ6VXNlcjY0ODc4MDI=","avatar_url":"https://avatars0.githubusercontent.com/u/6487802?v=4","gravatar_id":"","url":"https://api.github.com/users/ruhan1","html_url":"https://github.com/ruhan1","followers_url":"https://api.github.com/users/ruhan1/followers","following_url":"https://api.github.com/users/ruhan1/following{/other_user}","gists_url":"https://api.github.com/users/ruhan1/gists{/gist_id}","starred_url":"https://api.github.com/users/ruhan1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruhan1/subscriptions","organizations_url":"https://api.github.com/users/ruhan1/orgs","repos_url":"https://api.github.com/users/ruhan1/repos","events_url":"https://api.github.com/users/ruhan1/events{/privacy}","received_events_url":"https://api.github.com/users/ruhan1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ruhan1/kojiji","description":"Koji Java Interface","fork":true,"url":"https://api.github.com/repos/ruhan1/kojiji","forks_url":"https://api.github.com/repos/ruhan1/kojiji/forks","keys_url":"https://api.github.com/repos/ruhan1/kojiji/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruhan1/kojiji/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruhan1/kojiji/teams","hooks_url":"https://api.github.com/repos/ruhan1/kojiji/hooks","issue_events_url":"https://api.github.com/repos/ruhan1/kojiji/issues/events{/number}","events_url":"https://api.github.com/repos/ruhan1/kojiji/events","assignees_url":"https://api.github.com/repos/ruhan1/kojiji/assignees{/user}","branches_url":"https://api.github.com/repos/ruhan1/kojiji/branches{/branch}","tags_url":"https://api.github.com/repos/ruhan1/kojiji/tags","blobs_url":"https://api.github.com/repos/ruhan1/kojiji/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruhan1/kojiji/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruhan1/kojiji/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruhan1/kojiji/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruhan1/kojiji/statuses/{sha}","languages_url":"https://api.github.com/repos/ruhan1/kojiji/languages","stargazers_url":"https://api.github.com/repos/ruhan1/kojiji/stargazers","contributors_url":"https://api.github.com/repos/ruhan1/kojiji/contributors","subscribers_url":"https://api.github.com/repos/ruhan1/kojiji/subscribers","subscription_url":"https://api.github.com/repos/ruhan1/kojiji/subscription","commits_url":"https://api.github.com/repos/ruhan1/kojiji/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruhan1/kojiji/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruhan1/kojiji/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruhan1/kojiji/issues/comments{/number}","contents_url":"https://api.github.com/repos/ruhan1/kojiji/contents/{+path}","compare_url":"https://api.github.com/repos/ruhan1/kojiji/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruhan1/kojiji/merges","archive_url":"https://api.github.com/repos/ruhan1/kojiji/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruhan1/kojiji/downloads","issues_url":"https://api.github.com/repos/ruhan1/kojiji/issues{/number}","pulls_url":"https://api.github.com/repos/ruhan1/kojiji/pulls{/number}","milestones_url":"https://api.github.com/repos/ruhan1/kojiji/milestones{/number}","notifications_url":"https://api.github.com/repos/ruhan1/kojiji/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruhan1/kojiji/labels{/name}","releases_url":"https://api.github.com/repos/ruhan1/kojiji/releases{/id}","deployments_url":"https://api.github.com/repos/ruhan1/kojiji/deployments","created_at":"2016-09-29T04:59:59Z","updated_at":"2018-05-23T00:47:18Z","pushed_at":"2018-07-27T05:52:08Z","git_url":"git://github.com/ruhan1/kojiji.git","ssh_url":"git@github.com:ruhan1/kojiji.git","clone_url":"https://github.com/ruhan1/kojiji.git","svn_url":"https://github.com/ruhan1/kojiji","homepage":null,"size":1997,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"release-engineering:master","ref":"master","sha":"7466c15192edc12b742f17c37255886bfc88285a","user":{"login":"release-engineering","id":9591189,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk1OTExODk=","avatar_url":"https://avatars3.githubusercontent.com/u/9591189?v=4","gravatar_id":"","url":"https://api.github.com/users/release-engineering","html_url":"https://github.com/release-engineering","followers_url":"https://api.github.com/users/release-engineering/followers","following_url":"https://api.github.com/users/release-engineering/following{/other_user}","gists_url":"https://api.github.com/users/release-engineering/gists{/gist_id}","starred_url":"https://api.github.com/users/release-engineering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/release-engineering/subscriptions","organizations_url":"https://api.github.com/users/release-engineering/orgs","repos_url":"https://api.github.com/users/release-engineering/repos","events_url":"https://api.github.com/users/release-engineering/events{/privacy}","received_events_url":"https://api.github.com/users/release-engineering/received_events","type":"Organization","site_admin":false},"repo":{"id":49527329,"node_id":"MDEwOlJlcG9zaXRvcnk0OTUyNzMyOQ==","name":"kojiji","full_name":"release-engineering/kojiji","owner":{"login":"release-engineering","id":9591189,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk1OTExODk=","avatar_url":"https://avatars3.githubusercontent.com/u/9591189?v=4","gravatar_id":"","url":"https://api.github.com/users/release-engineering","html_url":"https://github.com/release-engineering","followers_url":"https://api.github.com/users/release-engineering/followers","following_url":"https://api.github.com/users/release-engineering/following{/other_user}","gists_url":"https://api.github.com/users/release-engineering/gists{/gist_id}","starred_url":"https://api.github.com/users/release-engineering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/release-engineering/subscriptions","organizations_url":"https://api.github.com/users/release-engineering/orgs","repos_url":"https://api.github.com/users/release-engineering/repos","events_url":"https://api.github.com/users/release-engineering/events{/privacy}","received_events_url":"https://api.github.com/users/release-engineering/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/release-engineering/kojiji","description":"Koji Java Interface","fork":false,"url":"https://api.github.com/repos/release-engineering/kojiji","forks_url":"https://api.github.com/repos/release-engineering/kojiji/forks","keys_url":"https://api.github.com/repos/release-engineering/kojiji/keys{/key_id}","collaborators_url":"https://api.github.com/repos/release-engineering/kojiji/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/release-engineering/kojiji/teams","hooks_url":"https://api.github.com/repos/release-engineering/kojiji/hooks","issue_events_url":"https://api.github.com/repos/release-engineering/kojiji/issues/events{/number}","events_url":"https://api.github.com/repos/release-engineering/kojiji/events","assignees_url":"https://api.github.com/repos/release-engineering/kojiji/assignees{/user}","branches_url":"https://api.github.com/repos/release-engineering/kojiji/branches{/branch}","tags_url":"https://api.github.com/repos/release-engineering/kojiji/tags","blobs_url":"https://api.github.com/repos/release-engineering/kojiji/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/release-engineering/kojiji/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/release-engineering/kojiji/git/refs{/sha}","trees_url":"https://api.github.com/repos/release-engineering/kojiji/git/trees{/sha}","statuses_url":"https://api.github.com/repos/release-engineering/kojiji/statuses/{sha}","languages_url":"https://api.github.com/repos/release-engineering/kojiji/languages","stargazers_url":"https://api.github.com/repos/release-engineering/kojiji/stargazers","contributors_url":"https://api.github.com/repos/release-engineering/kojiji/contributors","subscribers_url":"https://api.github.com/repos/release-engineering/kojiji/subscribers","subscription_url":"https://api.github.com/repos/release-engineering/kojiji/subscription","commits_url":"https://api.github.com/repos/release-engineering/kojiji/commits{/sha}","git_commits_url":"https://api.github.com/repos/release-engineering/kojiji/git/commits{/sha}","comments_url":"https://api.github.com/repos/release-engineering/kojiji/comments{/number}","issue_comment_url":"https://api.github.com/repos/release-engineering/kojiji/issues/comments{/number}","contents_url":"https://api.github.com/repos/release-engineering/kojiji/contents/{+path}","compare_url":"https://api.github.com/repos/release-engineering/kojiji/compare/{base}...{head}","merges_url":"https://api.github.com/repos/release-engineering/kojiji/merges","archive_url":"https://api.github.com/repos/release-engineering/kojiji/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/release-engineering/kojiji/downloads","issues_url":"https://api.github.com/repos/release-engineering/kojiji/issues{/number}","pulls_url":"https://api.github.com/repos/release-engineering/kojiji/pulls{/number}","milestones_url":"https://api.github.com/repos/release-engineering/kojiji/milestones{/number}","notifications_url":"https://api.github.com/repos/release-engineering/kojiji/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/release-engineering/kojiji/labels{/name}","releases_url":"https://api.github.com/repos/release-engineering/kojiji/releases{/id}","deployments_url":"https://api.github.com/repos/release-engineering/kojiji/deployments","created_at":"2016-01-12T20:35:43Z","updated_at":"2018-07-24T12:58:12Z","pushed_at":"2018-07-27T05:52:09Z","git_url":"git://github.com/release-engineering/kojiji.git","ssh_url":"git@github.com:release-engineering/kojiji.git","clone_url":"https://github.com/release-engineering/kojiji.git","svn_url":"https://github.com/release-engineering/kojiji","homepage":null,"size":2023,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":15,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/release-engineering/kojiji/pulls/105"},"html":{"href":"https://github.com/release-engineering/kojiji/pull/105"},"issue":{"href":"https://api.github.com/repos/release-engineering/kojiji/issues/105"},"comments":{"href":"https://api.github.com/repos/release-engineering/kojiji/issues/105/comments"},"review_comments":{"href":"https://api.github.com/repos/release-engineering/kojiji/pulls/105/comments"},"review_comment":{"href":"https://api.github.com/repos/release-engineering/kojiji/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/release-engineering/kojiji/pulls/105/commits"},"statuses":{"href":"https://api.github.com/repos/release-engineering/kojiji/statuses/c4a6c8017f5341f4496dc5be21cfb71902c4985f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dwalluck"}}