{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/64906828","id":64906828,"diff_hunk":"@@ -0,0 +1,426 @@\n+from furl import furl\n+import json\n+import re\n+import requests\n+\n+from modularodm import Q\n+\n+from framework.auth.core import get_user\n+from framework.auth.signals import user_confirmed\n+from framework.celery_tasks import app\n+from framework.celery_tasks.handlers import queued_task\n+from framework.exceptions import HTTPError\n+\n+from website import settings\n+from website.notifications.utils import to_subscription_key\n+\n+from website.mailing_list.exceptions import UnsubscribeHookException\n+from website.mailing_list.model import MailingListEventLog\n+from website.project.signals import contributor_added, contributor_removed, node_deleted\n+\n+ANGLE_BRACKETS_REGEX = re.compile(r'<(.*?)>')\n+\n+MAILGUN_BASE_LISTS_URL = '{}/lists'.format(settings.MAILGUN_API_URL)\n+\n+###############################################################################\n+# Decorator\n+###############################################################################\n+\n+def require_mailgun(func):\n+    \"\"\" Execute MailGun API calls iff API key is set \"\"\"\n+    def wrapper(*args, **kwargs):\n+        if settings.MAILGUN_API_KEY:\n+            return func(*args, **kwargs)\n+        return None\n+    return wrapper\n+\n+###############################################################################\n+# List Management Functions\n+###############################################################################\n+\n+@require_mailgun\n+def get_info(node_id):\n+    \"\"\" Returns information about the mailing list from Mailgun\n+    :param str node_id: ID of the node in question\n+    :returns dict info: mailing list info\n+    \"\"\"\n+    resp = requests.get(\n+        '{}/{}'.format(MAILGUN_BASE_LISTS_URL, address(node_id)),\n+        auth=('api', settings.MAILGUN_API_KEY),\n+    )\n+    if resp.status_code == 200:\n+        return json.loads(resp.text)\n+    elif resp.status_code == 404:\n+        return None\n+    raise HTTPError(resp.status_code, data={'message_long': resp.json() or ''})\n+\n+@require_mailgun\n+def get_members(node_id):\n+    \"\"\" Returns member list for mailing list from Mailgun\n+    :param str node_id: ID of the node in question\n+    :returns dict members: list of members\n+    \"\"\"\n+    resp = requests.get(\n+        '{}/{}/members'.format(MAILGUN_BASE_LISTS_URL, address(node_id)),\n+        auth=('api', settings.MAILGUN_API_KEY),\n+    )\n+    if resp.status_code == 200:\n+        return json.loads(resp.text)\n+    raise HTTPError(resp.status_code, data={'message_long': resp.json() or ''})\n+\n+@require_mailgun\n+def get_list(node_id):\n+    \"\"\" Returns information about the mailing list from Mailgun\n+    :param str node_id: ID of the node in question\n+    :returns: info, members: Two dictionaries about list and members\n+    \"\"\"\n+    info = get_info(node_id)\n+\n+    if not info:\n+        return None, None\n+\n+    members = get_members(node_id)\n+\n+    return info, members\n+\n+@require_mailgun\n+def create_list(node_id):\n+    \"\"\" Creates a new mailing list on Mailgun with all emails and subscriptions\n+    :param str node_id: ID of the node in question\n+    \"\"\"\n+    from website.models import Node  # avoid circular import\n+    node = Node.load(node_id)\n+    resp = requests.post(\n+        MAILGUN_BASE_LISTS_URL,\n+        auth=('api', settings.MAILGUN_API_KEY),\n+        data={\n+            'address': address(node_id),\n+            'name': list_title(node),\n+            'access_level': 'members'\n+        }\n+    )\n+    if resp.status_code != 200:\n+        raise HTTPError(resp.status_code, data={'message_long': resp.json() or ''})\n+\n+    members_list = jsonify_users_list(node.contributors, unsubs=get_unsubscribes(node), initial=True)\n+\n+    update_multiple_users_in_list(node_id, members_list)\n+\n+@require_mailgun\n+def delete_list(node_id):\n+    \"\"\" Deletes list on MailGun\n+    :param str node_id: ID of the node in question\n+    \"\"\"\n+    resp = requests.delete(\n+        '{}/{}'.format(MAILGUN_BASE_LISTS_URL, address(node_id)),\n+        auth=('api', settings.MAILGUN_API_KEY)\n+    )\n+    if resp.status_code not in [200, 404]:\n+        raise HTTPError(resp.status_code, data={'message_long': resp.json() or ''})\n+\n+@require_mailgun\n+def update_title(node_id):\n+    \"\"\" Updates the title of a mailing list to match the list's project\n+    :param str node_id: ID of the node in question\n+    \"\"\"\n+    from website.models import Node  # avoid circular import\n+    node = Node.load(node_id)\n+\n+    resp = requests.put(\n+        '{}/{}'.format(MAILGUN_BASE_LISTS_URL, address(node_id)),\n+        auth=('api', settings.MAILGUN_API_KEY),\n+        data={\n+            'name': list_title(node)\n+        }\n+    )\n+    if resp.status_code != 200:\n+        raise HTTPError(resp.status_code, data={'message_long': resp.json() or ''})\n+\n+@require_mailgun\n+def update_single_user_in_list(node_id, user_id, email=None, enabled=True, old_email=None):\n+    \"\"\" Adds/updates single member of a mailing list on Mailgun\n+    Called to add, subscribe, or unsubscribe a user.\n+\n+    :param str node: ID of node in question\n+    :param str user: ID of user to update\n+    :param str email: email address to add. If None, `user.username` assumed.\n+    :param bool enabled: Enable or disable user?\n+    :param str old_email: Previous email of this user in list, included when user changes primary email.\n+    \"\"\"\n+    from website.models import Node, User  # avoid circular import\n+    node = Node.load(node_id)\n+    user = User.load(user_id)\n+    email = email or user.username\n+\n+    if old_email:\n+        resp = requests.put(\n+            '{}/{}/members/{}'.format(MAILGUN_BASE_LISTS_URL, address(node_id), old_email),\n+            auth=('api', settings.MAILGUN_API_KEY),\n+            data={\n+                'subscribed': 'no',\n+                'vars': json.dumps({'_id': user_id, 'primary': False})\n+            }\n+        )\n+        if resp.status_code not in [200, 404]:\n+            raise HTTPError(resp.status_code, data={'message_long': resp.json() or ''})\n+\n+    resp = requests.post(\n+        '{}/{}/members'.format(MAILGUN_BASE_LISTS_URL, address(node._id)),\n+        auth=('api', settings.MAILGUN_API_KEY),\n+        data={\n+            'address': email,\n+            'subscribed': enabled and email == user.username and user not in get_unsubscribes(node),\n+            'vars': json.dumps({'_id': user._id, 'primary': email == user.username or bool(old_email)}),\n+            'upsert': True\n+        }\n+    )\n+    if resp.status_code != 200:\n+        raise HTTPError(resp.status_code, data={'message_long': resp.json() or ''})\n+\n+@require_mailgun\n+def remove_user_from_list(node_id, user_id):\n+    \"\"\" Removes single member of a mailing list on Mailgun\n+    Called when a contributor is removed from a Node.\n+\n+    :param str node_id: ID of node in question\n+    :param str user_id: ID of user to remove\n+    \"\"\"\n+    from website.models import User  # avoid circular import\n+    user = User.load(user_id)\n+\n+    for email in user.emails:\n+        resp = requests.delete(\n+            '{}/{}/members/{}'.format(MAILGUN_BASE_LISTS_URL, address(node_id), email),\n+            auth=('api', settings.MAILGUN_API_KEY)\n+        )\n+        if resp.status_code not in [200, 404]:\n+            raise HTTPError(resp.status_code, data={'message_long': resp.json() or ''})\n+\n+@require_mailgun\n+def update_multiple_users_in_list(node_id, members):\n+    \"\"\" Adds/updates members of a mailing list on Mailgun\n+\n+    :param str node_id: The id of the node in question\n+    :param list members: Paginated list of json-formatted user dicts to add/enable/update\n+    \"\"\"\n+    for page in members:\n+        resp = requests.post(\n+            '{}/{}/members.json'.format(MAILGUN_BASE_LISTS_URL, address(node_id)),\n+            auth=('api', settings.MAILGUN_API_KEY),\n+            data={\n+                'upsert': True,\n+                'members': json.dumps(page)\n+            }\n+        )\n+        if resp.status_code != 200:\n+            raise HTTPError(resp.status_code, data={'message_long': resp.json() or ''})\n+\n+@require_mailgun\n+def full_update(node_id):\n+    \"\"\" Matches remote list with internal representation\n+    :param str node_id: The node to update the mailing list for\n+    \"\"\"\n+    from website.models import Node, User  # avoid circular import\n+    node = Node.load(node_id)\n+\n+    info, members = get_list(node_id)\n+\n+    if node.is_deleted:\n+        delete_list(node_id)\n+    elif node.mailing_enabled:\n+        if 'list' in info.keys():\n+            info = info['list']\n+            remote_subscribes = [member['address'] for member in members['items'] if member['subscribed']].sort()\n+            local_subscribes = [user.username for user in get_recipients(node)].sort()\n+\n+            if info['name'] != list_title(node):\n+                # Update title if necessary\n+                update_title(node_id, node.title)\n+\n+            if remote_subscribes != local_subscribes:\n+                # Push local changes\n+                members_list = jsonify_users_list(node.contributors, unsubs=get_unsubscribes(node))\n+                update_multiple_users_in_list(node_id, members_list)\n+\n+            # Delete any noncontribs\n+            member_ids = set([member['vars']['_id'] for member in members['items'] if member.get('vars', {}).get('_id', False)])\n+            for u_id in member_ids:\n+                if u_id not in node.contributors:\n+                    user = User.load(u_id)\n+                    if user:\n+                        remove_user_from_list(node_id, u_id)\n+\n+        else:\n+            create_list(node_id)\n+    else:\n+        if 'list' in info.keys():\n+            delete_list(node_id)\n+\n+\n+###############################################################################\n+# Celery Queued tasks\n+###############################################################################\n+\n+@queued_task\n+@app.task(bind=True, max_retries=3, default_retry_delay=3 * 60)  # Retry after 3 minutes\n+def celery_create_list(*args, **kwargs):\n+    create_list(*args, **kwargs)\n+\n+@queued_task\n+@app.task(bind=True, max_retries=3, default_retry_delay=3 * 60)  # Retry after 3 minutes\n+def celery_delete_list(*args, **kwargs):\n+    delete_list(*args, **kwargs)\n+\n+@queued_task\n+@app.task(bind=True, max_retries=3, default_retry_delay=3 * 60)  # Retry after 3 minutes\n+def celery_update_title(*args, **kwargs):\n+    update_title(*args, **kwargs)\n+\n+@queued_task\n+@app.task(bind=True, max_retries=3, default_retry_delay=3 * 60)  # Retry after 3 minutes\n+def celery_update_single_user_in_list(*args, **kwargs):\n+    update_single_user_in_list(*args, **kwargs)\n+\n+@queued_task\n+@app.task(bind=True, max_retries=3, default_retry_delay=3 * 60)  # Retry after 3 minutes\n+def celery_remove_user_from_list(*args, **kwargs):\n+    remove_user_from_list(*args, **kwargs)\n+\n+@queued_task\n+@app.task(bind=True, max_retries=3, default_retry_delay=3 * 60)  # Retry after 3 minutes\n+def celery_update_multiple_users_in_list(*args, **kwargs):\n+    update_multiple_users_in_list(*args, **kwargs)\n+\n+@queued_task\n+@app.task(bind=True, max_retries=3, default_retry_delay=3 * 60)  # Retry after 3 minutes\n+def celery_full_update(*args, **kwargs):\n+    full_update(*args, **kwargs)\n+\n+\n+###############################################################################\n+# Signalled Functions\n+###############################################################################\n+\n+@contributor_added.connect\n+def subscribe_contributor_to_mailing_list(node, contributor, auth=None):\n+    if node.mailing_enabled and contributor.is_active:\n+        subscription = node.get_or_create_mailing_list_subscription()\n+        subscription.add_user_to_subscription(contributor, 'email_transactional', save=True)\n+        celery_update_single_user_in_list(node._id, contributor._id)\n+        node.mailing_updated = True\n+        node.save()\n+\n+@contributor_removed.connect\n+def unsubscribe_contributor_from_mailing_list(node, user, auth=None):\n+    if node.mailing_enabled:\n+        subscription = node.get_or_create_mailing_list_subscription()\n+    else:\n+        from website.models import NotificationSubscription  # avoid circular import\n+        subscription = NotificationSubscription.load(to_subscription_key(node._id, 'mailing_list_events'))\n+    if subscription:\n+        subscription.remove_user_from_subscription(user)\n+        node.mailing_updated = True\n+        node.save()\n+    celery_remove_user_from_list(node._id, user._id)\n+\n+\n+@user_confirmed.connect\n+def resubscribe_on_confirm(user):\n+    for node in user.contributed:\n+        subscribe_contributor_to_mailing_list(node, user)\n+\n+@node_deleted.connect\n+def remove_list_for_deleted_node(node):\n+    node.mailing_updated = True\n+    node.save()\n+    celery_delete_list(node._id)\n+\n+\n+###############################################################################\n+# Mailing List Helper Functions\n+###############################################################################\n+\n+def jsonify_users_list(users, unsubs=(), initial=False):\n+    \"\"\" Serializes and paginates list of users for Mailgun\n+\n+    :param list users: users to serialize\n+    :param list unsubs: unsubscribed users\n+    :param bool initial: whether or not to insert mailing_list_robot\n+    \"\"\"\n+    members_list = []\n+    if initial:\n+        members_list.append({'address': address('mailing_list_robot'), 'subscribed': True})  # Routing robot\n+\n+    for member in users:\n+        for email in member.emails:\n+            members_list.append({\n+                'address': email,\n+                'subscribed': member not in unsubs and email == member.username,\n+                'vars': {'_id': member._id, 'primary': email == member.username}\n+            })\n+\n+    # Mailgun allows 1000 user upserts per request\n+    return [members_list[i:i + 999] for i in range(0, len(members_list), 999)]\n+\n+def address(node_id):\n+    return '{}@{}'.format(node_id, furl(settings.DOMAIN).host)","path":"website/mailing_list/utils.py","position":366,"original_position":366,"commit_id":"522a1dc2638282ef783e900cf413bf4ae94411fb","original_commit_id":"522a1dc2638282ef783e900cf413bf4ae94411fb","user":{"login":"abought","id":2957073,"avatar_url":"https://avatars.githubusercontent.com/u/2957073?v=3","gravatar_id":"","url":"https://api.github.com/users/abought","html_url":"https://github.com/abought","followers_url":"https://api.github.com/users/abought/followers","following_url":"https://api.github.com/users/abought/following{/other_user}","gists_url":"https://api.github.com/users/abought/gists{/gist_id}","starred_url":"https://api.github.com/users/abought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abought/subscriptions","organizations_url":"https://api.github.com/users/abought/orgs","repos_url":"https://api.github.com/users/abought/repos","events_url":"https://api.github.com/users/abought/events{/privacy}","received_events_url":"https://api.github.com/users/abought/received_events","type":"User","site_admin":false},"body":"Per discussion: All mailgun configuration should go in the local settings file, so that changes made to the code do not override required mailgun configuration.","created_at":"2016-05-27T13:49:52Z","updated_at":"2016-05-27T13:49:52Z","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/5645#discussion_r64906828","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5645","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/64906828"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/5645#discussion_r64906828"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5645"}}},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5645","id":69708065,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/5645","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/5645.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/5645.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5645","number":5645,"state":"open","locked":false,"title":"[Feature][Update] (External) Project mailing lists [OSF-3975]","user":{"login":"mfraezz","id":5659262,"avatar_url":"https://avatars.githubusercontent.com/u/5659262?v=3","gravatar_id":"","url":"https://api.github.com/users/mfraezz","html_url":"https://github.com/mfraezz","followers_url":"https://api.github.com/users/mfraezz/followers","following_url":"https://api.github.com/users/mfraezz/following{/other_user}","gists_url":"https://api.github.com/users/mfraezz/gists{/gist_id}","starred_url":"https://api.github.com/users/mfraezz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfraezz/subscriptions","organizations_url":"https://api.github.com/users/mfraezz/orgs","repos_url":"https://api.github.com/users/mfraezz/repos","events_url":"https://api.github.com/users/mfraezz/events{/privacy}","received_events_url":"https://api.github.com/users/mfraezz/received_events","type":"User","site_admin":false},"body":"Updates #5033 , #3934\r\n\r\nPurpose\r\n=======\r\nAllow users to email `<node_guid>@osf.io` to email all subscribed contributors.\r\n\r\nChanges\r\n=======\r\n\r\n- [X] Models (`Node` updated, `MLEventLog` added, new subscription type)\r\n- [X] Mailing List logging implemented \r\n- [X] Script added (node.mailing_enabled, create_list migration)\r\n- [X] View functions / routes for ML configuration added\r\n- [X] Tests added\r\n- [X] ML Rejection template added\r\n- [x] ML template for sent mail added\r\n- [x] UI Updated to match wireframes\r\n- [x] Manually tested with ngrok\r\n- [x] Celery tasks to manage remote list added\r\n- [x] Cron job to sync lists weekly added\r\n- [x] Additional celery queue added for `mailing_list` tasks\r\n\r\nSide Effects\r\n=========\r\nNone\r\n\r\nNotes\r\n--------\r\n1 - Create Mailgun route to catch any email to `mailing_list_robot@osf\\.io` using MG UI, routed to `osf.io/api/v1/mailing_list/messages/`\r\n\r\n2 - If we want to allow users to unsubscribe via the email itself, need to:\r\n* Enable unsubscribe tracking in MG (in `Domains`)\r\n* Customize email template in MG to include `%mailing_list_unsubscribe_url%` (Also, probably **never** use MG for sending anything else)\r\n* Specify a webhook to route unsubscribe info to `osf.io/api/v1/mailing_lists/hooks/unsubscribe`\r\n\r\n3 - To migrate `mailing_enabled` for all existing nodes and create the mailing lists, run\r\n```\r\npython -m scripts.migrate_project_mailing_lists\r\n```\r\n* Optionally, append `dry` for a dry run. This will not create mailing lists on MG\r\n\r\n## Ticket\r\n[OSF-3975](https://openscience.atlassian.net/browse/OSF-3975)","created_at":"2016-05-11T17:07:37Z","updated_at":"2016-05-27T13:49:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"86cbb156e0b3e954a1bb55cbfe9e068ef4528ad1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5645/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5645/comments","review_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5645/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/522a1dc2638282ef783e900cf413bf4ae94411fb","head":{"label":"mfraezz:feature/external-mailing-lists","ref":"feature/external-mailing-lists","sha":"522a1dc2638282ef783e900cf413bf4ae94411fb","user":{"login":"mfraezz","id":5659262,"avatar_url":"https://avatars.githubusercontent.com/u/5659262?v=3","gravatar_id":"","url":"https://api.github.com/users/mfraezz","html_url":"https://github.com/mfraezz","followers_url":"https://api.github.com/users/mfraezz/followers","following_url":"https://api.github.com/users/mfraezz/following{/other_user}","gists_url":"https://api.github.com/users/mfraezz/gists{/gist_id}","starred_url":"https://api.github.com/users/mfraezz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfraezz/subscriptions","organizations_url":"https://api.github.com/users/mfraezz/orgs","repos_url":"https://api.github.com/users/mfraezz/repos","events_url":"https://api.github.com/users/mfraezz/events{/privacy}","received_events_url":"https://api.github.com/users/mfraezz/received_events","type":"User","site_admin":false},"repo":{"id":26929858,"name":"osf.io","full_name":"mfraezz/osf.io","owner":{"login":"mfraezz","id":5659262,"avatar_url":"https://avatars.githubusercontent.com/u/5659262?v=3","gravatar_id":"","url":"https://api.github.com/users/mfraezz","html_url":"https://github.com/mfraezz","followers_url":"https://api.github.com/users/mfraezz/followers","following_url":"https://api.github.com/users/mfraezz/following{/other_user}","gists_url":"https://api.github.com/users/mfraezz/gists{/gist_id}","starred_url":"https://api.github.com/users/mfraezz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfraezz/subscriptions","organizations_url":"https://api.github.com/users/mfraezz/orgs","repos_url":"https://api.github.com/users/mfraezz/repos","events_url":"https://api.github.com/users/mfraezz/events{/privacy}","received_events_url":"https://api.github.com/users/mfraezz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mfraezz/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/mfraezz/osf.io","forks_url":"https://api.github.com/repos/mfraezz/osf.io/forks","keys_url":"https://api.github.com/repos/mfraezz/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mfraezz/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mfraezz/osf.io/teams","hooks_url":"https://api.github.com/repos/mfraezz/osf.io/hooks","issue_events_url":"https://api.github.com/repos/mfraezz/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/mfraezz/osf.io/events","assignees_url":"https://api.github.com/repos/mfraezz/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/mfraezz/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/mfraezz/osf.io/tags","blobs_url":"https://api.github.com/repos/mfraezz/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mfraezz/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mfraezz/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/mfraezz/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mfraezz/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/mfraezz/osf.io/languages","stargazers_url":"https://api.github.com/repos/mfraezz/osf.io/stargazers","contributors_url":"https://api.github.com/repos/mfraezz/osf.io/contributors","subscribers_url":"https://api.github.com/repos/mfraezz/osf.io/subscribers","subscription_url":"https://api.github.com/repos/mfraezz/osf.io/subscription","commits_url":"https://api.github.com/repos/mfraezz/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/mfraezz/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/mfraezz/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/mfraezz/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/mfraezz/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/mfraezz/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mfraezz/osf.io/merges","archive_url":"https://api.github.com/repos/mfraezz/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mfraezz/osf.io/downloads","issues_url":"https://api.github.com/repos/mfraezz/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/mfraezz/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/mfraezz/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/mfraezz/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mfraezz/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/mfraezz/osf.io/releases{/id}","deployments_url":"https://api.github.com/repos/mfraezz/osf.io/deployments","created_at":"2014-11-20T20:12:10Z","updated_at":"2015-01-28T20:39:13Z","pushed_at":"2016-05-24T14:11:58Z","git_url":"git://github.com/mfraezz/osf.io.git","ssh_url":"git@github.com:mfraezz/osf.io.git","clone_url":"https://github.com/mfraezz/osf.io.git","svn_url":"https://github.com/mfraezz/osf.io","homepage":"http://osf.io","size":129748,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"CenterForOpenScience:develop","ref":"develop","sha":"c2653120c1832a90ccb705029b56e24b34f286bd","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"repo":{"id":10199599,"name":"osf.io","full_name":"CenterForOpenScience/osf.io","owner":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CenterForOpenScience/osf.io","description":"Facilitating Open Science","fork":false,"url":"https://api.github.com/repos/CenterForOpenScience/osf.io","forks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/forks","keys_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/teams","hooks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/hooks","issue_events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/events","assignees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/tags","blobs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/languages","stargazers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/stargazers","contributors_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contributors","subscribers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscribers","subscription_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscription","commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/merges","archive_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/downloads","issues_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/releases{/id}","deployments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/deployments","created_at":"2013-05-21T15:53:37Z","updated_at":"2016-05-23T17:42:46Z","pushed_at":"2016-05-27T13:40:01Z","git_url":"git://github.com/CenterForOpenScience/osf.io.git","ssh_url":"git@github.com:CenterForOpenScience/osf.io.git","clone_url":"https://github.com/CenterForOpenScience/osf.io.git","svn_url":"https://github.com/CenterForOpenScience/osf.io","homepage":"http://osf.io","size":280316,"stargazers_count":220,"watchers_count":220,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":185,"mirror_url":null,"open_issues_count":222,"forks":185,"open_issues":222,"watchers":220,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5645"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/5645"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5645"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5645/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5645/comments"},"review_comment":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5645/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/522a1dc2638282ef783e900cf413bf4ae94411fb"}}}}
{"actor":{"display_login":"abought"}}