{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/balrog/pulls/comments/80783867","pull_request_review_id":1815318,"id":80783867,"diff_hunk":"@@ -84,13 +85,57 @@ def cleanup_releases_history(trans, dryrun=True):\n \n     print \"Total Deleted: %d\" % total_deleted\n \n+\n+def extract_active_data(URL, loc=\"dump.sql\"):\n+    \"\"\"\n+    Function was added in to enhance testing in Balrog's stage environment.\n+\n+    :param URL: Database. eg : mysql://balrogadmin:balrogadmin@balrogdb/balrog\n+    :param loc: location where sqldump file must be created\n+    :return: Stores sqldump data in  the specified location, if not specified stores in current directory in file dump.sql\n+            If  file already exists it will override that file and not append it.\n+    \"\"\"\n+    url = make_url(URL)\n+    user = url.username\n+    password = url.password\n+    host = url.host\n+    database = url.database\n+\n+    popen('mysqldump -h %s -u %s -p%s --single-transaction %s rules rules_history rules_scheduled_changes \\\n+           rules_scheduled_changes_history permissions permissions_history migrate_version  > %s' % (host, user, password, database, loc,))\n+\n+    popen('mysqldump -h %s -u %s -p%s --single-transaction %s releases \\\n+           --where=\"exists (select * from rules where releases.name = rules.mapping  )\" \\\n+           >> %s' % (host, user, password, database, loc,))\n+\n+    popen('mysqldump -h %s -u %s -p%s --single-transaction %s releases \\\n+           --where=\"exists (select * from rules where releases.name = rules.whitelist  )\" \\\n+               >> %s ' % (host, user, password, database, loc,))\n+\n+    popen('mysqldump -h %s -u %s -p%s --single-transaction %s releases \\\n+          --where=\"exists (select * from rules_scheduled_changes where releases.name = rules_scheduled_changes.base_mapping  )\"\\\n+            >> %s' % (host, user, password, database, loc,))\n+\n+    popen('mysqldump -h %s -u %s -p%s --single-transaction %s releases \\\n+          --where=\"exists (select * from rules_scheduled_changes where releases.name = rules_scheduled_changes.base_whitelist )\"\\\n+                >> %s' % (host, user, password, database, loc,))","path":"scripts/manage-db.py","position":null,"original_position":47,"commit_id":"24e63bb04c7af8ba83bb8d4ebdaccf3306b3d941","original_commit_id":"bf6d7599faecf88b125915871f931ad11ef91d4d","user":{"login":"NinadBhat","id":11566055,"avatar_url":"https://avatars.githubusercontent.com/u/11566055?v=3","gravatar_id":"","url":"https://api.github.com/users/NinadBhat","html_url":"https://github.com/NinadBhat","followers_url":"https://api.github.com/users/NinadBhat/followers","following_url":"https://api.github.com/users/NinadBhat/following{/other_user}","gists_url":"https://api.github.com/users/NinadBhat/gists{/gist_id}","starred_url":"https://api.github.com/users/NinadBhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NinadBhat/subscriptions","organizations_url":"https://api.github.com/users/NinadBhat/orgs","repos_url":"https://api.github.com/users/NinadBhat/repos","events_url":"https://api.github.com/users/NinadBhat/events{/privacy}","received_events_url":"https://api.github.com/users/NinadBhat/received_events","type":"User","site_admin":false},"body":"@mozbhearsum  done","created_at":"2016-09-27T20:14:19Z","updated_at":"2016-09-27T20:14:19Z","html_url":"https://github.com/mozilla/balrog/pull/132#discussion_r80783867","pull_request_url":"https://api.github.com/repos/mozilla/balrog/pulls/132","_links":{"self":{"href":"https://api.github.com/repos/mozilla/balrog/pulls/comments/80783867"},"html":{"href":"https://github.com/mozilla/balrog/pull/132#discussion_r80783867"},"pull_request":{"href":"https://api.github.com/repos/mozilla/balrog/pulls/132"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/balrog/pulls/132","id":86937992,"html_url":"https://github.com/mozilla/balrog/pull/132","diff_url":"https://github.com/mozilla/balrog/pull/132.diff","patch_url":"https://github.com/mozilla/balrog/pull/132.patch","issue_url":"https://api.github.com/repos/mozilla/balrog/issues/132","number":132,"state":"open","locked":false,"title":"Bug 1284481 active data","user":{"login":"NinadBhat","id":11566055,"avatar_url":"https://avatars.githubusercontent.com/u/11566055?v=3","gravatar_id":"","url":"https://api.github.com/users/NinadBhat","html_url":"https://github.com/NinadBhat","followers_url":"https://api.github.com/users/NinadBhat/followers","following_url":"https://api.github.com/users/NinadBhat/following{/other_user}","gists_url":"https://api.github.com/users/NinadBhat/gists{/gist_id}","starred_url":"https://api.github.com/users/NinadBhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NinadBhat/subscriptions","organizations_url":"https://api.github.com/users/NinadBhat/orgs","repos_url":"https://api.github.com/users/NinadBhat/repos","events_url":"https://api.github.com/users/NinadBhat/events{/privacy}","received_events_url":"https://api.github.com/users/NinadBhat/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-27T14:11:35Z","updated_at":"2016-09-27T20:14:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d319f579b7896f7b60da2537e504bcfd496419cb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/balrog/pulls/132/commits","review_comments_url":"https://api.github.com/repos/mozilla/balrog/pulls/132/comments","review_comment_url":"https://api.github.com/repos/mozilla/balrog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/balrog/issues/132/comments","statuses_url":"https://api.github.com/repos/mozilla/balrog/statuses/24e63bb04c7af8ba83bb8d4ebdaccf3306b3d941","head":{"label":"NinadBhat:Bug-1284481-active-data","ref":"Bug-1284481-active-data","sha":"24e63bb04c7af8ba83bb8d4ebdaccf3306b3d941","user":{"login":"NinadBhat","id":11566055,"avatar_url":"https://avatars.githubusercontent.com/u/11566055?v=3","gravatar_id":"","url":"https://api.github.com/users/NinadBhat","html_url":"https://github.com/NinadBhat","followers_url":"https://api.github.com/users/NinadBhat/followers","following_url":"https://api.github.com/users/NinadBhat/following{/other_user}","gists_url":"https://api.github.com/users/NinadBhat/gists{/gist_id}","starred_url":"https://api.github.com/users/NinadBhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NinadBhat/subscriptions","organizations_url":"https://api.github.com/users/NinadBhat/orgs","repos_url":"https://api.github.com/users/NinadBhat/repos","events_url":"https://api.github.com/users/NinadBhat/events{/privacy}","received_events_url":"https://api.github.com/users/NinadBhat/received_events","type":"User","site_admin":false},"repo":{"id":68037645,"name":"balrog","full_name":"NinadBhat/balrog","owner":{"login":"NinadBhat","id":11566055,"avatar_url":"https://avatars.githubusercontent.com/u/11566055?v=3","gravatar_id":"","url":"https://api.github.com/users/NinadBhat","html_url":"https://github.com/NinadBhat","followers_url":"https://api.github.com/users/NinadBhat/followers","following_url":"https://api.github.com/users/NinadBhat/following{/other_user}","gists_url":"https://api.github.com/users/NinadBhat/gists{/gist_id}","starred_url":"https://api.github.com/users/NinadBhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NinadBhat/subscriptions","organizations_url":"https://api.github.com/users/NinadBhat/orgs","repos_url":"https://api.github.com/users/NinadBhat/repos","events_url":"https://api.github.com/users/NinadBhat/events{/privacy}","received_events_url":"https://api.github.com/users/NinadBhat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NinadBhat/balrog","description":"Next generation update service for Mozilla products","fork":true,"url":"https://api.github.com/repos/NinadBhat/balrog","forks_url":"https://api.github.com/repos/NinadBhat/balrog/forks","keys_url":"https://api.github.com/repos/NinadBhat/balrog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NinadBhat/balrog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NinadBhat/balrog/teams","hooks_url":"https://api.github.com/repos/NinadBhat/balrog/hooks","issue_events_url":"https://api.github.com/repos/NinadBhat/balrog/issues/events{/number}","events_url":"https://api.github.com/repos/NinadBhat/balrog/events","assignees_url":"https://api.github.com/repos/NinadBhat/balrog/assignees{/user}","branches_url":"https://api.github.com/repos/NinadBhat/balrog/branches{/branch}","tags_url":"https://api.github.com/repos/NinadBhat/balrog/tags","blobs_url":"https://api.github.com/repos/NinadBhat/balrog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NinadBhat/balrog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NinadBhat/balrog/git/refs{/sha}","trees_url":"https://api.github.com/repos/NinadBhat/balrog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NinadBhat/balrog/statuses/{sha}","languages_url":"https://api.github.com/repos/NinadBhat/balrog/languages","stargazers_url":"https://api.github.com/repos/NinadBhat/balrog/stargazers","contributors_url":"https://api.github.com/repos/NinadBhat/balrog/contributors","subscribers_url":"https://api.github.com/repos/NinadBhat/balrog/subscribers","subscription_url":"https://api.github.com/repos/NinadBhat/balrog/subscription","commits_url":"https://api.github.com/repos/NinadBhat/balrog/commits{/sha}","git_commits_url":"https://api.github.com/repos/NinadBhat/balrog/git/commits{/sha}","comments_url":"https://api.github.com/repos/NinadBhat/balrog/comments{/number}","issue_comment_url":"https://api.github.com/repos/NinadBhat/balrog/issues/comments{/number}","contents_url":"https://api.github.com/repos/NinadBhat/balrog/contents/{+path}","compare_url":"https://api.github.com/repos/NinadBhat/balrog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NinadBhat/balrog/merges","archive_url":"https://api.github.com/repos/NinadBhat/balrog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NinadBhat/balrog/downloads","issues_url":"https://api.github.com/repos/NinadBhat/balrog/issues{/number}","pulls_url":"https://api.github.com/repos/NinadBhat/balrog/pulls{/number}","milestones_url":"https://api.github.com/repos/NinadBhat/balrog/milestones{/number}","notifications_url":"https://api.github.com/repos/NinadBhat/balrog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NinadBhat/balrog/labels{/name}","releases_url":"https://api.github.com/repos/NinadBhat/balrog/releases{/id}","deployments_url":"https://api.github.com/repos/NinadBhat/balrog/deployments","created_at":"2016-09-12T18:49:16Z","updated_at":"2016-09-12T18:49:19Z","pushed_at":"2016-09-27T20:13:22Z","git_url":"git://github.com/NinadBhat/balrog.git","ssh_url":"git@github.com:NinadBhat/balrog.git","clone_url":"https://github.com/NinadBhat/balrog.git","svn_url":"https://github.com/NinadBhat/balrog","homepage":"","size":48013,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"14af6f2105b07c283a8d8ff44aa916f0a6d367b1","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":2570444,"name":"balrog","full_name":"mozilla/balrog","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/balrog","description":"Next generation update service for Mozilla products","fork":false,"url":"https://api.github.com/repos/mozilla/balrog","forks_url":"https://api.github.com/repos/mozilla/balrog/forks","keys_url":"https://api.github.com/repos/mozilla/balrog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/balrog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/balrog/teams","hooks_url":"https://api.github.com/repos/mozilla/balrog/hooks","issue_events_url":"https://api.github.com/repos/mozilla/balrog/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/balrog/events","assignees_url":"https://api.github.com/repos/mozilla/balrog/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/balrog/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/balrog/tags","blobs_url":"https://api.github.com/repos/mozilla/balrog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/balrog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/balrog/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/balrog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/balrog/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/balrog/languages","stargazers_url":"https://api.github.com/repos/mozilla/balrog/stargazers","contributors_url":"https://api.github.com/repos/mozilla/balrog/contributors","subscribers_url":"https://api.github.com/repos/mozilla/balrog/subscribers","subscription_url":"https://api.github.com/repos/mozilla/balrog/subscription","commits_url":"https://api.github.com/repos/mozilla/balrog/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/balrog/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/balrog/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/balrog/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/balrog/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/balrog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/balrog/merges","archive_url":"https://api.github.com/repos/mozilla/balrog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/balrog/downloads","issues_url":"https://api.github.com/repos/mozilla/balrog/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/balrog/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/balrog/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/balrog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/balrog/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/balrog/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/balrog/deployments","created_at":"2011-10-13T15:51:47Z","updated_at":"2016-09-12T21:14:38Z","pushed_at":"2016-09-27T20:13:22Z","git_url":"git://github.com/mozilla/balrog.git","ssh_url":"git@github.com:mozilla/balrog.git","clone_url":"https://github.com/mozilla/balrog.git","svn_url":"https://github.com/mozilla/balrog","homepage":"","size":48580,"stargazers_count":22,"watchers_count":22,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":2,"forks":40,"open_issues":2,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/balrog/pulls/132"},"html":{"href":"https://github.com/mozilla/balrog/pull/132"},"issue":{"href":"https://api.github.com/repos/mozilla/balrog/issues/132"},"comments":{"href":"https://api.github.com/repos/mozilla/balrog/issues/132/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/balrog/pulls/132/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/balrog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/balrog/pulls/132/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/balrog/statuses/24e63bb04c7af8ba83bb8d4ebdaccf3306b3d941"}}}}
{"actor":{"display_login":"NinadBhat"}}