{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/196084351","pull_request_review_id":129569899,"id":196084351,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NjA4NDM1MQ==","diff_hunk":"@@ -0,0 +1,66 @@\n+from __future__ import absolute_import, print_function\n+from corehq.form_processor.interfaces import dbaccessors\n+from casexml.apps.case.models import CommCareCase\n+import random\n+from corehq.util.log import with_progress_bar\n+from corehq.apps.couch_sql_migration.diff import filter_case_diffs\n+from corehq.apps.tzmigration.timezonemigration import json_diff\n+from pillowtop.reindexer.change_providers.couch import CouchViewChangeProvider\n+from corehq.form_processor.backends.couch.update_strategy import CouchCaseUpdateStrategy\n+\n+\n+def check_domain(domain, num_cases=1000, randomization=100):\n+    form_db = dbaccessors.FormAccessors(domain)\n+\n+    case_iterator = CouchViewChangeProvider(\n+        couch_db=CommCareCase.get_db(),\n+        view_name='by_domain_doc_type_date/view',\n+        view_kwargs={\n+            'startkey': [domain, 'CommCareCase'],\n+            'endkey': [domain, 'CommCareCase', {}],\n+            'include_docs': False,\n+        }\n+    ).iter_all_changes()\n+\n+    for i in with_progress_bar(range(0, num_cases), oneline=False):\n+        skips = random.randint(1, randomization)\n+        for _ in range(0, skips):\n+            case = case_iterator.next()","path":"corehq/apps/couch_sql_migration/management/domain_check.py","position":28,"original_position":28,"commit_id":"71402c0414e17734ed8955495c112aa2dc340990","original_commit_id":"71402c0414e17734ed8955495c112aa2dc340990","user":{"login":"jmtroth0","id":13040327,"node_id":"MDQ6VXNlcjEzMDQwMzI3","avatar_url":"https://avatars0.githubusercontent.com/u/13040327?v=4","gravatar_id":"","url":"https://api.github.com/users/jmtroth0","html_url":"https://github.com/jmtroth0","followers_url":"https://api.github.com/users/jmtroth0/followers","following_url":"https://api.github.com/users/jmtroth0/following{/other_user}","gists_url":"https://api.github.com/users/jmtroth0/gists{/gist_id}","starred_url":"https://api.github.com/users/jmtroth0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmtroth0/subscriptions","organizations_url":"https://api.github.com/users/jmtroth0/orgs","repos_url":"https://api.github.com/users/jmtroth0/repos","events_url":"https://api.github.com/users/jmtroth0/events{/privacy}","received_events_url":"https://api.github.com/users/jmtroth0/received_events","type":"User","site_admin":false},"body":"yep, but i wasn't expecting this to be bug proof. I can make sure it never hits the end by knowing the number of available forms and setting the params accordingly","created_at":"2018-06-18T13:50:37Z","updated_at":"2018-06-18T13:50:37Z","html_url":"https://github.com/dimagi/commcare-hq/pull/20931#discussion_r196084351","pull_request_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/20931","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/196084351"},"html":{"href":"https://github.com/dimagi/commcare-hq/pull/20931#discussion_r196084351"},"pull_request":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/20931"}},"in_reply_to_id":195849178},"pull_request":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/20931","id":195270142,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MjcwMTQy","html_url":"https://github.com/dimagi/commcare-hq/pull/20931","diff_url":"https://github.com/dimagi/commcare-hq/pull/20931.diff","patch_url":"https://github.com/dimagi/commcare-hq/pull/20931.patch","issue_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/20931","number":20931,"state":"closed","locked":false,"title":"checking in domain check script for future use","user":{"login":"jmtroth0","id":13040327,"node_id":"MDQ6VXNlcjEzMDQwMzI3","avatar_url":"https://avatars0.githubusercontent.com/u/13040327?v=4","gravatar_id":"","url":"https://api.github.com/users/jmtroth0","html_url":"https://github.com/jmtroth0","followers_url":"https://api.github.com/users/jmtroth0/followers","following_url":"https://api.github.com/users/jmtroth0/following{/other_user}","gists_url":"https://api.github.com/users/jmtroth0/gists{/gist_id}","starred_url":"https://api.github.com/users/jmtroth0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmtroth0/subscriptions","organizations_url":"https://api.github.com/users/jmtroth0/orgs","repos_url":"https://api.github.com/users/jmtroth0/repos","events_url":"https://api.github.com/users/jmtroth0/events{/privacy}","received_events_url":"https://api.github.com/users/jmtroth0/received_events","type":"User","site_admin":false},"body":"this was the messy script i ran to validate the rec migration. i figured it might be useful at some point (at least to me) so it seemed reasonable to check in. \r\n\r\n@snopoke @millerdev @emord ","created_at":"2018-06-15T20:01:59Z","updated_at":"2018-06-18T13:50:37Z","closed_at":"2018-06-18T07:23:37Z","merged_at":"2018-06-18T07:23:37Z","merge_commit_sha":"2da1db6639b183f415a2886ad6d7ee5e9018b912","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":724787015,"node_id":"MDU6TGFiZWw3MjQ3ODcwMTU=","url":"https://api.github.com/repos/dimagi/commcare-hq/labels/product/invisible","name":"product/invisible","color":"cfd2d6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/20931/commits","review_comments_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/20931/comments","review_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/20931/comments","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/71402c0414e17734ed8955495c112aa2dc340990","head":{"label":"dimagi:jr/forms-and-cases-validity-check","ref":"jr/forms-and-cases-validity-check","sha":"71402c0414e17734ed8955495c112aa2dc340990","user":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":247278,"node_id":"MDEwOlJlcG9zaXRvcnkyNDcyNzg=","name":"commcare-hq","full_name":"dimagi/commcare-hq","owner":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-hq","description":"A server-side tool to help manage community health workers, written in Django","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq","forks_url":"https://api.github.com/repos/dimagi/commcare-hq/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/commcare-hq/deployments","created_at":"2009-07-09T17:00:07Z","updated_at":"2018-06-18T11:38:40Z","pushed_at":"2018-06-18T12:47:51Z","git_url":"git://github.com/dimagi/commcare-hq.git","ssh_url":"git@github.com:dimagi/commcare-hq.git","clone_url":"https://github.com/dimagi/commcare-hq.git","svn_url":"https://github.com/dimagi/commcare-hq","homepage":"https://www.commcarehq.org","size":442961,"stargazers_count":93,"watchers_count":93,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":106,"mirror_url":null,"archived":false,"open_issues_count":82,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":106,"open_issues":82,"watchers":93,"default_branch":"master"}},"base":{"label":"dimagi:master","ref":"master","sha":"5bc0585135bce368869d4845beb850f4a96fdbc4","user":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":247278,"node_id":"MDEwOlJlcG9zaXRvcnkyNDcyNzg=","name":"commcare-hq","full_name":"dimagi/commcare-hq","owner":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-hq","description":"A server-side tool to help manage community health workers, written in Django","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq","forks_url":"https://api.github.com/repos/dimagi/commcare-hq/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/commcare-hq/deployments","created_at":"2009-07-09T17:00:07Z","updated_at":"2018-06-18T11:38:40Z","pushed_at":"2018-06-18T12:47:51Z","git_url":"git://github.com/dimagi/commcare-hq.git","ssh_url":"git@github.com:dimagi/commcare-hq.git","clone_url":"https://github.com/dimagi/commcare-hq.git","svn_url":"https://github.com/dimagi/commcare-hq","homepage":"https://www.commcarehq.org","size":442961,"stargazers_count":93,"watchers_count":93,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":106,"mirror_url":null,"archived":false,"open_issues_count":82,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":106,"open_issues":82,"watchers":93,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/20931"},"html":{"href":"https://github.com/dimagi/commcare-hq/pull/20931"},"issue":{"href":"https://api.github.com/repos/dimagi/commcare-hq/issues/20931"},"comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq/issues/20931/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/20931/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/20931/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/commcare-hq/statuses/71402c0414e17734ed8955495c112aa2dc340990"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jmtroth0"}}