{"action":"created","comment":{"url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/pulls/comments/72056134","id":72056134,"diff_hunk":"@@ -129,3 +135,53 @@ cancel_replication(RepId, #user_ctx{name = Name, roles = Roles}) ->\n             {error, not_found}\n         end\n      end.\n+\n+\n+-spec stream_terminal_docs_info(binary(), user_doc_cb(), any()) -> any().\n+stream_terminal_docs_info(Db, Cb, UserAcc) ->\n+    DDoc = <<\"_replicator\">>,\n+    View = <<\"terminal_states\">>,\n+    QueryCb = fun handle_replicator_doc_query/2,\n+    Args = #mrargs{view_type = map, reduce = false},\n+    Acc = {Db, Cb, UserAcc},\n+    try fabric:query_view(Db, DDoc, View, QueryCb, Acc, Args) of\n+    {ok, {Db, Cb, UserAcc1}} ->\n+        UserAcc1;\n+    {not_found, missing} ->\n+        UserAcc","path":"src/couch_replicator.erl","position":40,"original_position":40,"commit_id":"c953af91921fe76c96a4cd0cb63b9a822a0ade38","original_commit_id":"c953af91921fe76c96a4cd0cb63b9a822a0ade38","user":{"login":"rnewson","id":47223,"avatar_url":"https://avatars.githubusercontent.com/u/47223?v=3","gravatar_id":"","url":"https://api.github.com/users/rnewson","html_url":"https://github.com/rnewson","followers_url":"https://api.github.com/users/rnewson/followers","following_url":"https://api.github.com/users/rnewson/following{/other_user}","gists_url":"https://api.github.com/users/rnewson/gists{/gist_id}","starred_url":"https://api.github.com/users/rnewson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnewson/subscriptions","organizations_url":"https://api.github.com/users/rnewson/orgs","repos_url":"https://api.github.com/users/rnewson/repos","events_url":"https://api.github.com/users/rnewson/events{/privacy}","received_events_url":"https://api.github.com/users/rnewson/received_events","type":"User","site_admin":false},"body":"why would we want to swallow this error?","created_at":"2016-07-25T12:42:01Z","updated_at":"2016-07-25T12:42:01Z","html_url":"https://github.com/cloudant/couchdb-couch-replicator/pull/57#discussion_r72056134","pull_request_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/pulls/57","_links":{"self":{"href":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/pulls/comments/72056134"},"html":{"href":"https://github.com/cloudant/couchdb-couch-replicator/pull/57#discussion_r72056134"},"pull_request":{"href":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/pulls/57"}}},"pull_request":{"url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/pulls/57","id":77919954,"html_url":"https://github.com/cloudant/couchdb-couch-replicator/pull/57","diff_url":"https://github.com/cloudant/couchdb-couch-replicator/pull/57.diff","patch_url":"https://github.com/cloudant/couchdb-couch-replicator/pull/57.patch","issue_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/issues/57","number":57,"state":"open","locked":false,"title":"Add docs/0 function to doc processor & streaming document info APIs to replicator","user":{"login":"nickva","id":211822,"avatar_url":"https://avatars.githubusercontent.com/u/211822?v=3","gravatar_id":"","url":"https://api.github.com/users/nickva","html_url":"https://github.com/nickva","followers_url":"https://api.github.com/users/nickva/followers","following_url":"https://api.github.com/users/nickva/following{/other_user}","gists_url":"https://api.github.com/users/nickva/gists{/gist_id}","starred_url":"https://api.github.com/users/nickva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickva/subscriptions","organizations_url":"https://api.github.com/users/nickva/orgs","repos_url":"https://api.github.com/users/nickva/repos","events_url":"https://api.github.com/users/nickva/events{/privacy}","received_events_url":"https://api.github.com/users/nickva/received_events","type":"User","site_admin":false},"body":"`docs/0` function as well as API functions from `replicator` modules are used to introspect the state of replication documents.  \r\n\r\n`docs/0` produces local (from current node) result showing active (i.e. non-complete and non-failed) documents.\r\n\r\n`stream_active_docs_info` and `stream_terminal_docs_info` produce cluster wide stream of ejson objects with info about replication documents. These results are cluster wide. They are have instead of chttpd or Cloudant specific plugin because they involved internal details of how replicator arranges its views / databases /ets tables.\r\n\r\nThis pr also updates the default replicator db view to include reason for failure. In all likelihood if user sees a failed document, the next thing they'd do is query it so see why it failed. So just include it in the view.\r\n","created_at":"2016-07-19T05:34:54Z","updated_at":"2016-07-25T12:42:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6acac81f331372c6fc1dbab28362786fca5b29b8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/pulls/57/commits","review_comments_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/pulls/57/comments","review_comment_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/issues/57/comments","statuses_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/statuses/c953af91921fe76c96a4cd0cb63b9a822a0ade38","head":{"label":"cloudant:63012-scheduler-docs-endpoint","ref":"63012-scheduler-docs-endpoint","sha":"c953af91921fe76c96a4cd0cb63b9a822a0ade38","user":{"login":"cloudant","id":44642,"avatar_url":"https://avatars.githubusercontent.com/u/44642?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudant","html_url":"https://github.com/cloudant","followers_url":"https://api.github.com/users/cloudant/followers","following_url":"https://api.github.com/users/cloudant/following{/other_user}","gists_url":"https://api.github.com/users/cloudant/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudant/subscriptions","organizations_url":"https://api.github.com/users/cloudant/orgs","repos_url":"https://api.github.com/users/cloudant/repos","events_url":"https://api.github.com/users/cloudant/events{/privacy}","received_events_url":"https://api.github.com/users/cloudant/received_events","type":"Organization","site_admin":false},"repo":{"id":38246096,"name":"couchdb-couch-replicator","full_name":"cloudant/couchdb-couch-replicator","owner":{"login":"cloudant","id":44642,"avatar_url":"https://avatars.githubusercontent.com/u/44642?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudant","html_url":"https://github.com/cloudant","followers_url":"https://api.github.com/users/cloudant/followers","following_url":"https://api.github.com/users/cloudant/following{/other_user}","gists_url":"https://api.github.com/users/cloudant/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudant/subscriptions","organizations_url":"https://api.github.com/users/cloudant/orgs","repos_url":"https://api.github.com/users/cloudant/repos","events_url":"https://api.github.com/users/cloudant/events{/privacy}","received_events_url":"https://api.github.com/users/cloudant/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudant/couchdb-couch-replicator","description":"Mirror of Apache CouchDB","fork":true,"url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator","forks_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/forks","keys_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/teams","hooks_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/hooks","issue_events_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/issues/events{/number}","events_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/events","assignees_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/assignees{/user}","branches_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/branches{/branch}","tags_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/tags","blobs_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/languages","stargazers_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/stargazers","contributors_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/contributors","subscribers_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/subscribers","subscription_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/subscription","commits_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/contents/{+path}","compare_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/merges","archive_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/downloads","issues_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/issues{/number}","pulls_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/labels{/name}","releases_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/releases{/id}","deployments_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/deployments","created_at":"2015-06-29T12:19:20Z","updated_at":"2016-05-13T14:06:45Z","pushed_at":"2016-07-22T20:31:08Z","git_url":"git://github.com/cloudant/couchdb-couch-replicator.git","ssh_url":"git@github.com:cloudant/couchdb-couch-replicator.git","clone_url":"https://github.com/cloudant/couchdb-couch-replicator.git","svn_url":"https://github.com/cloudant/couchdb-couch-replicator","homepage":null,"size":4935,"stargazers_count":0,"watchers_count":0,"language":"Erlang","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"cloudant:63012-scheduler","ref":"63012-scheduler","sha":"d22b0562fc4f18cf3f132b470bff86b8deb1f692","user":{"login":"cloudant","id":44642,"avatar_url":"https://avatars.githubusercontent.com/u/44642?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudant","html_url":"https://github.com/cloudant","followers_url":"https://api.github.com/users/cloudant/followers","following_url":"https://api.github.com/users/cloudant/following{/other_user}","gists_url":"https://api.github.com/users/cloudant/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudant/subscriptions","organizations_url":"https://api.github.com/users/cloudant/orgs","repos_url":"https://api.github.com/users/cloudant/repos","events_url":"https://api.github.com/users/cloudant/events{/privacy}","received_events_url":"https://api.github.com/users/cloudant/received_events","type":"Organization","site_admin":false},"repo":{"id":38246096,"name":"couchdb-couch-replicator","full_name":"cloudant/couchdb-couch-replicator","owner":{"login":"cloudant","id":44642,"avatar_url":"https://avatars.githubusercontent.com/u/44642?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudant","html_url":"https://github.com/cloudant","followers_url":"https://api.github.com/users/cloudant/followers","following_url":"https://api.github.com/users/cloudant/following{/other_user}","gists_url":"https://api.github.com/users/cloudant/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudant/subscriptions","organizations_url":"https://api.github.com/users/cloudant/orgs","repos_url":"https://api.github.com/users/cloudant/repos","events_url":"https://api.github.com/users/cloudant/events{/privacy}","received_events_url":"https://api.github.com/users/cloudant/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudant/couchdb-couch-replicator","description":"Mirror of Apache CouchDB","fork":true,"url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator","forks_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/forks","keys_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/teams","hooks_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/hooks","issue_events_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/issues/events{/number}","events_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/events","assignees_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/assignees{/user}","branches_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/branches{/branch}","tags_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/tags","blobs_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/languages","stargazers_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/stargazers","contributors_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/contributors","subscribers_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/subscribers","subscription_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/subscription","commits_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/contents/{+path}","compare_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/merges","archive_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/downloads","issues_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/issues{/number}","pulls_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/labels{/name}","releases_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/releases{/id}","deployments_url":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/deployments","created_at":"2015-06-29T12:19:20Z","updated_at":"2016-05-13T14:06:45Z","pushed_at":"2016-07-22T20:31:08Z","git_url":"git://github.com/cloudant/couchdb-couch-replicator.git","ssh_url":"git@github.com:cloudant/couchdb-couch-replicator.git","clone_url":"https://github.com/cloudant/couchdb-couch-replicator.git","svn_url":"https://github.com/cloudant/couchdb-couch-replicator","homepage":null,"size":4935,"stargazers_count":0,"watchers_count":0,"language":"Erlang","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/pulls/57"},"html":{"href":"https://github.com/cloudant/couchdb-couch-replicator/pull/57"},"issue":{"href":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/issues/57"},"comments":{"href":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/issues/57/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/pulls/57/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/pulls/57/commits"},"statuses":{"href":"https://api.github.com/repos/cloudant/couchdb-couch-replicator/statuses/c953af91921fe76c96a4cd0cb63b9a822a0ade38"}}}}
{"actor":{"display_login":"rnewson"}}