{"action":"created","comment":{"url":"https://api.github.com/repos/fedora-infra/pkgdb2/pulls/comments/25793605","id":25793605,"diff_hunk":"@@ -293,12 +302,96 @@ def send_email(fromAddress, toAddress, subject, message):\n     msg.add_header('To', ','.join(toAddress))\n     msg.add_header('From', fromAddress)\n     msg.add_header('Subject', subject)\n+    if ccAddress is not None:\n+        msg.add_header('Cc', ','.join(ccAddress))\n     msg.set_payload(message)\n     smtp = smtplib.SMTP('bastion')\n     smtp.sendmail(fromAddress, toAddress, msg.as_string())\n     smtp.quit()\n \n \n+def notify_users(errors):\n+    ''' Browse the list of errors and when we can retrieve the email\n+    address, use it to notify the user about the issue.\n+    '''\n+    tmpl_email = \"\"\"Greetings.\n+\n+You are receiving this email because there's a problem with your\n+bugzilla.redhat.com account.\n+\n+If you recently changed the email address associated with your\n+Fedora account in the Fedora Account System, it is now out of sync\n+with your bugzilla.redhat.com account. This leads to problems\n+with Fedora packages you own or are CC'ed on bug reports for.\n+\n+Please take one of the following actions:\n+\n+a) login to your old bugzilla.redhat.com account and change the email\n+address to match your current email in the Fedora account system.\n+https://bugzilla.redhat.com login, click preferences, account\n+information and enter new email address.\n+\n+b) Create a new account in bugzilla.redhat.com to match your\n+email listed in your Fedora account system account.\n+https://bugzilla.redhat.com/ click 'new account' and enter email\n+address.\n+\n+c) Change your Fedora Account System email to match your existing\n+bugzilla.redhat.com account.\n+https://admin.fedoraproject.org/accounts login, click on 'my account',\n+then 'edit' and change your email address.\n+\n+If you have questions or concerns, please let us know.\n+\n+Your prompt attention in this matter is appreciated.\n+\n+The Fedora admins.\n+\"\"\"\n+    data = None\n+    if os.path.exists(DATA_CACHE):\n+        try:\n+            with open(DATA_CACHE) as stream:\n+                data = json.load(stream)\n+        except Exception as err:\n+            print 'Could not read the json file', err","path":"utility/pkgdb-sync-bugzilla","position":102,"original_position":102,"commit_id":"658f108b063bf94fb67a1553438491a731dbcb02","original_commit_id":"658f108b063bf94fb67a1553438491a731dbcb02","user":{"login":"ralphbean","id":331338,"avatar_url":"https://avatars.githubusercontent.com/u/331338?v=3","gravatar_id":"","url":"https://api.github.com/users/ralphbean","html_url":"https://github.com/ralphbean","followers_url":"https://api.github.com/users/ralphbean/followers","following_url":"https://api.github.com/users/ralphbean/following{/other_user}","gists_url":"https://api.github.com/users/ralphbean/gists{/gist_id}","starred_url":"https://api.github.com/users/ralphbean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralphbean/subscriptions","organizations_url":"https://api.github.com/users/ralphbean/orgs","repos_url":"https://api.github.com/users/ralphbean/repos","events_url":"https://api.github.com/users/ralphbean/events{/privacy}","received_events_url":"https://api.github.com/users/ralphbean/received_events","type":"User","site_admin":false},"body":"Perhaps include the value of ``DATA_CACHE`` in this error message to help debugging years down the road?","created_at":"2015-03-04T17:25:39Z","updated_at":"2015-03-04T17:25:39Z","html_url":"https://github.com/fedora-infra/pkgdb2/pull/169#discussion_r25793605","pull_request_url":"https://api.github.com/repos/fedora-infra/pkgdb2/pulls/169","_links":{"self":{"href":"https://api.github.com/repos/fedora-infra/pkgdb2/pulls/comments/25793605"},"html":{"href":"https://github.com/fedora-infra/pkgdb2/pull/169#discussion_r25793605"},"pull_request":{"href":"https://api.github.com/repos/fedora-infra/pkgdb2/pulls/169"}}},"pull_request":{"url":"https://api.github.com/repos/fedora-infra/pkgdb2/pulls/169","id":30382623,"html_url":"https://github.com/fedora-infra/pkgdb2/pull/169","diff_url":"https://github.com/fedora-infra/pkgdb2/pull/169.diff","patch_url":"https://github.com/fedora-infra/pkgdb2/pull/169.patch","issue_url":"https://api.github.com/repos/fedora-infra/pkgdb2/issues/169","number":169,"state":"open","locked":false,"title":"Warn users about invalid FAS email / bugzilla account mapping","user":{"login":"pypingou","id":1240038,"avatar_url":"https://avatars.githubusercontent.com/u/1240038?v=3","gravatar_id":"","url":"https://api.github.com/users/pypingou","html_url":"https://github.com/pypingou","followers_url":"https://api.github.com/users/pypingou/followers","following_url":"https://api.github.com/users/pypingou/following{/other_user}","gists_url":"https://api.github.com/users/pypingou/gists{/gist_id}","starred_url":"https://api.github.com/users/pypingou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypingou/subscriptions","organizations_url":"https://api.github.com/users/pypingou/orgs","repos_url":"https://api.github.com/users/pypingou/repos","events_url":"https://api.github.com/users/pypingou/events{/privacy}","received_events_url":"https://api.github.com/users/pypingou/received_events","type":"User","site_admin":false},"body":"Currently admins are getting an email every 10 minutes informing them about invalid mappings. Then, we email the users so that they can act on it.\r\n\r\nWith this change, users will be automatically notified.\r\n\r\nSometime, it takes a really long time for users to react, recently we have seen more than a week. So while we do not want to spam users as much as we do for admins (every 10 minutes), we still want to pressure them into fixing it by sending them a hourly reminder.","created_at":"2015-03-03T15:26:05Z","updated_at":"2015-03-04T17:25:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5f1debdeba3556f5f9d2a56fec2489271c4d570","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fedora-infra/pkgdb2/pulls/169/commits","review_comments_url":"https://api.github.com/repos/fedora-infra/pkgdb2/pulls/169/comments","review_comment_url":"https://api.github.com/repos/fedora-infra/pkgdb2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fedora-infra/pkgdb2/issues/169/comments","statuses_url":"https://api.github.com/repos/fedora-infra/pkgdb2/statuses/658f108b063bf94fb67a1553438491a731dbcb02","head":{"label":"fedora-infra:pkgdb_sync_bz","ref":"pkgdb_sync_bz","sha":"658f108b063bf94fb67a1553438491a731dbcb02","user":{"login":"fedora-infra","id":3316637,"avatar_url":"https://avatars.githubusercontent.com/u/3316637?v=3","gravatar_id":"","url":"https://api.github.com/users/fedora-infra","html_url":"https://github.com/fedora-infra","followers_url":"https://api.github.com/users/fedora-infra/followers","following_url":"https://api.github.com/users/fedora-infra/following{/other_user}","gists_url":"https://api.github.com/users/fedora-infra/gists{/gist_id}","starred_url":"https://api.github.com/users/fedora-infra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedora-infra/subscriptions","organizations_url":"https://api.github.com/users/fedora-infra/orgs","repos_url":"https://api.github.com/users/fedora-infra/repos","events_url":"https://api.github.com/users/fedora-infra/events{/privacy}","received_events_url":"https://api.github.com/users/fedora-infra/received_events","type":"Organization","site_admin":false},"repo":{"id":9082212,"name":"pkgdb2","full_name":"fedora-infra/pkgdb2","owner":{"login":"fedora-infra","id":3316637,"avatar_url":"https://avatars.githubusercontent.com/u/3316637?v=3","gravatar_id":"","url":"https://api.github.com/users/fedora-infra","html_url":"https://github.com/fedora-infra","followers_url":"https://api.github.com/users/fedora-infra/followers","following_url":"https://api.github.com/users/fedora-infra/following{/other_user}","gists_url":"https://api.github.com/users/fedora-infra/gists{/gist_id}","starred_url":"https://api.github.com/users/fedora-infra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedora-infra/subscriptions","organizations_url":"https://api.github.com/users/fedora-infra/orgs","repos_url":"https://api.github.com/users/fedora-infra/repos","events_url":"https://api.github.com/users/fedora-infra/events{/privacy}","received_events_url":"https://api.github.com/users/fedora-infra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedora-infra/pkgdb2","description":"Updated version of the Package Database","fork":false,"url":"https://api.github.com/repos/fedora-infra/pkgdb2","forks_url":"https://api.github.com/repos/fedora-infra/pkgdb2/forks","keys_url":"https://api.github.com/repos/fedora-infra/pkgdb2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedora-infra/pkgdb2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedora-infra/pkgdb2/teams","hooks_url":"https://api.github.com/repos/fedora-infra/pkgdb2/hooks","issue_events_url":"https://api.github.com/repos/fedora-infra/pkgdb2/issues/events{/number}","events_url":"https://api.github.com/repos/fedora-infra/pkgdb2/events","assignees_url":"https://api.github.com/repos/fedora-infra/pkgdb2/assignees{/user}","branches_url":"https://api.github.com/repos/fedora-infra/pkgdb2/branches{/branch}","tags_url":"https://api.github.com/repos/fedora-infra/pkgdb2/tags","blobs_url":"https://api.github.com/repos/fedora-infra/pkgdb2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedora-infra/pkgdb2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedora-infra/pkgdb2/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedora-infra/pkgdb2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedora-infra/pkgdb2/statuses/{sha}","languages_url":"https://api.github.com/repos/fedora-infra/pkgdb2/languages","stargazers_url":"https://api.github.com/repos/fedora-infra/pkgdb2/stargazers","contributors_url":"https://api.github.com/repos/fedora-infra/pkgdb2/contributors","subscribers_url":"https://api.github.com/repos/fedora-infra/pkgdb2/subscribers","subscription_url":"https://api.github.com/repos/fedora-infra/pkgdb2/subscription","commits_url":"https://api.github.com/repos/fedora-infra/pkgdb2/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedora-infra/pkgdb2/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedora-infra/pkgdb2/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedora-infra/pkgdb2/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedora-infra/pkgdb2/contents/{+path}","compare_url":"https://api.github.com/repos/fedora-infra/pkgdb2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedora-infra/pkgdb2/merges","archive_url":"https://api.github.com/repos/fedora-infra/pkgdb2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedora-infra/pkgdb2/downloads","issues_url":"https://api.github.com/repos/fedora-infra/pkgdb2/issues{/number}","pulls_url":"https://api.github.com/repos/fedora-infra/pkgdb2/pulls{/number}","milestones_url":"https://api.github.com/repos/fedora-infra/pkgdb2/milestones{/number}","notifications_url":"https://api.github.com/repos/fedora-infra/pkgdb2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedora-infra/pkgdb2/labels{/name}","releases_url":"https://api.github.com/repos/fedora-infra/pkgdb2/releases{/id}","created_at":"2013-03-28T17:17:21Z","updated_at":"2015-02-26T17:57:02Z","pushed_at":"2015-03-03T16:44:41Z","git_url":"git://github.com/fedora-infra/pkgdb2.git","ssh_url":"git@github.com:fedora-infra/pkgdb2.git","clone_url":"https://github.com/fedora-infra/pkgdb2.git","svn_url":"https://github.com/fedora-infra/pkgdb2","homepage":"https://admin.fedoraproject.org/pkgdb/","size":7684,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":6,"forks":13,"open_issues":6,"watchers":9,"default_branch":"master"}},"base":{"label":"fedora-infra:master","ref":"master","sha":"39475506cc030fe467f7a7a067ab51891d1c0260","user":{"login":"fedora-infra","id":3316637,"avatar_url":"https://avatars.githubusercontent.com/u/3316637?v=3","gravatar_id":"","url":"https://api.github.com/users/fedora-infra","html_url":"https://github.com/fedora-infra","followers_url":"https://api.github.com/users/fedora-infra/followers","following_url":"https://api.github.com/users/fedora-infra/following{/other_user}","gists_url":"https://api.github.com/users/fedora-infra/gists{/gist_id}","starred_url":"https://api.github.com/users/fedora-infra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedora-infra/subscriptions","organizations_url":"https://api.github.com/users/fedora-infra/orgs","repos_url":"https://api.github.com/users/fedora-infra/repos","events_url":"https://api.github.com/users/fedora-infra/events{/privacy}","received_events_url":"https://api.github.com/users/fedora-infra/received_events","type":"Organization","site_admin":false},"repo":{"id":9082212,"name":"pkgdb2","full_name":"fedora-infra/pkgdb2","owner":{"login":"fedora-infra","id":3316637,"avatar_url":"https://avatars.githubusercontent.com/u/3316637?v=3","gravatar_id":"","url":"https://api.github.com/users/fedora-infra","html_url":"https://github.com/fedora-infra","followers_url":"https://api.github.com/users/fedora-infra/followers","following_url":"https://api.github.com/users/fedora-infra/following{/other_user}","gists_url":"https://api.github.com/users/fedora-infra/gists{/gist_id}","starred_url":"https://api.github.com/users/fedora-infra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedora-infra/subscriptions","organizations_url":"https://api.github.com/users/fedora-infra/orgs","repos_url":"https://api.github.com/users/fedora-infra/repos","events_url":"https://api.github.com/users/fedora-infra/events{/privacy}","received_events_url":"https://api.github.com/users/fedora-infra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedora-infra/pkgdb2","description":"Updated version of the Package Database","fork":false,"url":"https://api.github.com/repos/fedora-infra/pkgdb2","forks_url":"https://api.github.com/repos/fedora-infra/pkgdb2/forks","keys_url":"https://api.github.com/repos/fedora-infra/pkgdb2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedora-infra/pkgdb2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedora-infra/pkgdb2/teams","hooks_url":"https://api.github.com/repos/fedora-infra/pkgdb2/hooks","issue_events_url":"https://api.github.com/repos/fedora-infra/pkgdb2/issues/events{/number}","events_url":"https://api.github.com/repos/fedora-infra/pkgdb2/events","assignees_url":"https://api.github.com/repos/fedora-infra/pkgdb2/assignees{/user}","branches_url":"https://api.github.com/repos/fedora-infra/pkgdb2/branches{/branch}","tags_url":"https://api.github.com/repos/fedora-infra/pkgdb2/tags","blobs_url":"https://api.github.com/repos/fedora-infra/pkgdb2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedora-infra/pkgdb2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedora-infra/pkgdb2/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedora-infra/pkgdb2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedora-infra/pkgdb2/statuses/{sha}","languages_url":"https://api.github.com/repos/fedora-infra/pkgdb2/languages","stargazers_url":"https://api.github.com/repos/fedora-infra/pkgdb2/stargazers","contributors_url":"https://api.github.com/repos/fedora-infra/pkgdb2/contributors","subscribers_url":"https://api.github.com/repos/fedora-infra/pkgdb2/subscribers","subscription_url":"https://api.github.com/repos/fedora-infra/pkgdb2/subscription","commits_url":"https://api.github.com/repos/fedora-infra/pkgdb2/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedora-infra/pkgdb2/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedora-infra/pkgdb2/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedora-infra/pkgdb2/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedora-infra/pkgdb2/contents/{+path}","compare_url":"https://api.github.com/repos/fedora-infra/pkgdb2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedora-infra/pkgdb2/merges","archive_url":"https://api.github.com/repos/fedora-infra/pkgdb2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedora-infra/pkgdb2/downloads","issues_url":"https://api.github.com/repos/fedora-infra/pkgdb2/issues{/number}","pulls_url":"https://api.github.com/repos/fedora-infra/pkgdb2/pulls{/number}","milestones_url":"https://api.github.com/repos/fedora-infra/pkgdb2/milestones{/number}","notifications_url":"https://api.github.com/repos/fedora-infra/pkgdb2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedora-infra/pkgdb2/labels{/name}","releases_url":"https://api.github.com/repos/fedora-infra/pkgdb2/releases{/id}","created_at":"2013-03-28T17:17:21Z","updated_at":"2015-02-26T17:57:02Z","pushed_at":"2015-03-03T16:44:41Z","git_url":"git://github.com/fedora-infra/pkgdb2.git","ssh_url":"git@github.com:fedora-infra/pkgdb2.git","clone_url":"https://github.com/fedora-infra/pkgdb2.git","svn_url":"https://github.com/fedora-infra/pkgdb2","homepage":"https://admin.fedoraproject.org/pkgdb/","size":7684,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":6,"forks":13,"open_issues":6,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fedora-infra/pkgdb2/pulls/169"},"html":{"href":"https://github.com/fedora-infra/pkgdb2/pull/169"},"issue":{"href":"https://api.github.com/repos/fedora-infra/pkgdb2/issues/169"},"comments":{"href":"https://api.github.com/repos/fedora-infra/pkgdb2/issues/169/comments"},"review_comments":{"href":"https://api.github.com/repos/fedora-infra/pkgdb2/pulls/169/comments"},"review_comment":{"href":"https://api.github.com/repos/fedora-infra/pkgdb2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fedora-infra/pkgdb2/pulls/169/commits"},"statuses":{"href":"https://api.github.com/repos/fedora-infra/pkgdb2/statuses/658f108b063bf94fb67a1553438491a731dbcb02"}}}}