{"action":"created","comment":{"url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/pulls/comments/84271124","pull_request_review_id":5057897,"id":84271124,"diff_hunk":"@@ -0,0 +1,39 @@\n+import json\n+import logging\n+import os\n+from frozendict import frozendict\n+\n+from nightlies_watcher.directories import PROJECT_DIRECTORY, DATA_DIRECTORY\n+\n+logger = logging.getLogger(__name__)\n+\n+_configs = {}\n+\n+DEFAULT_LOCATION = os.path.join(PROJECT_DIRECTORY, 'config.json')\n+DEFAULT_CONFIG_LOCATION = os.path.join(DATA_DIRECTORY, 'config.default.json')\n+\n+\n+def get_config(config_path=None):\n+    config_path = config_path or DEFAULT_LOCATION\n+\n+    try:\n+        return _configs[config_path]\n+    except KeyError:\n+        config = _get_config_from_file_or_default_one(config_path)\n+        _configs[config_path] = config\n+        return config\n+\n+\n+def _get_config_from_file_or_default_one(config_path):\n+    logger.debug('Loading config file at \"{}\"'.format(config_path))\n+\n+    try:\n+        return _load_config(config_path)\n+    except FileNotFoundError:\n+        logger.warn('\"{}\" not found. Loading default config at: {}'.format(config_path, DEFAULT_CONFIG_LOCATION))","path":"nightlies_watcher/config.py","position":33,"original_position":33,"commit_id":"c609165c05c6b10694d20c3aa366f4629bf7f1db","original_commit_id":"c609165c05c6b10694d20c3aa366f4629bf7f1db","user":{"login":"rail","id":42865,"avatar_url":"https://avatars.githubusercontent.com/u/42865?v=3","gravatar_id":"","url":"https://api.github.com/users/rail","html_url":"https://github.com/rail","followers_url":"https://api.github.com/users/rail/followers","following_url":"https://api.github.com/users/rail/following{/other_user}","gists_url":"https://api.github.com/users/rail/gists{/gist_id}","starred_url":"https://api.github.com/users/rail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rail/subscriptions","organizations_url":"https://api.github.com/users/rail/orgs","repos_url":"https://api.github.com/users/rail/repos","events_url":"https://api.github.com/users/rail/events{/privacy}","received_events_url":"https://api.github.com/users/rail/received_events","type":"User","site_admin":false},"body":"I'm not sure if using the default config file is useful. I'd rather bail here instead of (almost silently) falling back to default values.","created_at":"2016-10-20T12:31:29Z","updated_at":"2016-10-20T12:53:33Z","html_url":"https://github.com/JohanLorenzo/nightlies-watcher/pull/2#discussion_r84271124","pull_request_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/pulls/comments/84271124"},"html":{"href":"https://github.com/JohanLorenzo/nightlies-watcher/pull/2#discussion_r84271124"},"pull_request":{"href":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/pulls/2","id":89590158,"html_url":"https://github.com/JohanLorenzo/nightlies-watcher/pull/2","diff_url":"https://github.com/JohanLorenzo/nightlies-watcher/pull/2.diff","patch_url":"https://github.com/JohanLorenzo/nightlies-watcher/pull/2.patch","issue_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/issues/2","number":2,"state":"open","locked":false,"title":"Use pulse instead of index polling","user":{"login":"JohanLorenzo","id":5907366,"avatar_url":"https://avatars.githubusercontent.com/u/5907366?v=3","gravatar_id":"","url":"https://api.github.com/users/JohanLorenzo","html_url":"https://github.com/JohanLorenzo","followers_url":"https://api.github.com/users/JohanLorenzo/followers","following_url":"https://api.github.com/users/JohanLorenzo/following{/other_user}","gists_url":"https://api.github.com/users/JohanLorenzo/gists{/gist_id}","starred_url":"https://api.github.com/users/JohanLorenzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohanLorenzo/subscriptions","organizations_url":"https://api.github.com/users/JohanLorenzo/orgs","repos_url":"https://api.github.com/users/JohanLorenzo/repos","events_url":"https://api.github.com/users/JohanLorenzo/events{/privacy}","received_events_url":"https://api.github.com/users/JohanLorenzo/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-17T09:39:19Z","updated_at":"2016-10-20T12:53:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"72683cc2f656be2387b4fef9356b27f4bfe1a236","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/pulls/2/commits","review_comments_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/pulls/2/comments","review_comment_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/issues/2/comments","statuses_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/statuses/c609165c05c6b10694d20c3aa366f4629bf7f1db","head":{"label":"JohanLorenzo:use-pulse","ref":"use-pulse","sha":"c609165c05c6b10694d20c3aa366f4629bf7f1db","user":{"login":"JohanLorenzo","id":5907366,"avatar_url":"https://avatars.githubusercontent.com/u/5907366?v=3","gravatar_id":"","url":"https://api.github.com/users/JohanLorenzo","html_url":"https://github.com/JohanLorenzo","followers_url":"https://api.github.com/users/JohanLorenzo/followers","following_url":"https://api.github.com/users/JohanLorenzo/following{/other_user}","gists_url":"https://api.github.com/users/JohanLorenzo/gists{/gist_id}","starred_url":"https://api.github.com/users/JohanLorenzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohanLorenzo/subscriptions","organizations_url":"https://api.github.com/users/JohanLorenzo/orgs","repos_url":"https://api.github.com/users/JohanLorenzo/repos","events_url":"https://api.github.com/users/JohanLorenzo/events{/privacy}","received_events_url":"https://api.github.com/users/JohanLorenzo/received_events","type":"User","site_admin":false},"repo":{"id":70486144,"name":"nightlies-watcher","full_name":"JohanLorenzo/nightlies-watcher","owner":{"login":"JohanLorenzo","id":5907366,"avatar_url":"https://avatars.githubusercontent.com/u/5907366?v=3","gravatar_id":"","url":"https://api.github.com/users/JohanLorenzo","html_url":"https://github.com/JohanLorenzo","followers_url":"https://api.github.com/users/JohanLorenzo/followers","following_url":"https://api.github.com/users/JohanLorenzo/following{/other_user}","gists_url":"https://api.github.com/users/JohanLorenzo/gists{/gist_id}","starred_url":"https://api.github.com/users/JohanLorenzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohanLorenzo/subscriptions","organizations_url":"https://api.github.com/users/JohanLorenzo/orgs","repos_url":"https://api.github.com/users/JohanLorenzo/repos","events_url":"https://api.github.com/users/JohanLorenzo/events{/privacy}","received_events_url":"https://api.github.com/users/JohanLorenzo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JohanLorenzo/nightlies-watcher","description":"Taskcluster watcher bot which verifies if new a Fennec aurora is available and schedules publishing tasks","fork":false,"url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher","forks_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/forks","keys_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/teams","hooks_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/hooks","issue_events_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/issues/events{/number}","events_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/events","assignees_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/assignees{/user}","branches_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/branches{/branch}","tags_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/tags","blobs_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/git/refs{/sha}","trees_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/statuses/{sha}","languages_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/languages","stargazers_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/stargazers","contributors_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/contributors","subscribers_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/subscribers","subscription_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/subscription","commits_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/commits{/sha}","git_commits_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/git/commits{/sha}","comments_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/comments{/number}","issue_comment_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/issues/comments{/number}","contents_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/contents/{+path}","compare_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/merges","archive_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/downloads","issues_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/issues{/number}","pulls_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/pulls{/number}","milestones_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/milestones{/number}","notifications_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/labels{/name}","releases_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/releases{/id}","deployments_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/deployments","created_at":"2016-10-10T12:36:44Z","updated_at":"2016-10-10T16:06:42Z","pushed_at":"2016-10-19T16:24:18Z","git_url":"git://github.com/JohanLorenzo/nightlies-watcher.git","ssh_url":"git@github.com:JohanLorenzo/nightlies-watcher.git","clone_url":"https://github.com/JohanLorenzo/nightlies-watcher.git","svn_url":"https://github.com/JohanLorenzo/nightlies-watcher","homepage":null,"size":55,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"JohanLorenzo:master","ref":"master","sha":"616df23f4666e567864e5103a656db0275078e68","user":{"login":"JohanLorenzo","id":5907366,"avatar_url":"https://avatars.githubusercontent.com/u/5907366?v=3","gravatar_id":"","url":"https://api.github.com/users/JohanLorenzo","html_url":"https://github.com/JohanLorenzo","followers_url":"https://api.github.com/users/JohanLorenzo/followers","following_url":"https://api.github.com/users/JohanLorenzo/following{/other_user}","gists_url":"https://api.github.com/users/JohanLorenzo/gists{/gist_id}","starred_url":"https://api.github.com/users/JohanLorenzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohanLorenzo/subscriptions","organizations_url":"https://api.github.com/users/JohanLorenzo/orgs","repos_url":"https://api.github.com/users/JohanLorenzo/repos","events_url":"https://api.github.com/users/JohanLorenzo/events{/privacy}","received_events_url":"https://api.github.com/users/JohanLorenzo/received_events","type":"User","site_admin":false},"repo":{"id":70486144,"name":"nightlies-watcher","full_name":"JohanLorenzo/nightlies-watcher","owner":{"login":"JohanLorenzo","id":5907366,"avatar_url":"https://avatars.githubusercontent.com/u/5907366?v=3","gravatar_id":"","url":"https://api.github.com/users/JohanLorenzo","html_url":"https://github.com/JohanLorenzo","followers_url":"https://api.github.com/users/JohanLorenzo/followers","following_url":"https://api.github.com/users/JohanLorenzo/following{/other_user}","gists_url":"https://api.github.com/users/JohanLorenzo/gists{/gist_id}","starred_url":"https://api.github.com/users/JohanLorenzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohanLorenzo/subscriptions","organizations_url":"https://api.github.com/users/JohanLorenzo/orgs","repos_url":"https://api.github.com/users/JohanLorenzo/repos","events_url":"https://api.github.com/users/JohanLorenzo/events{/privacy}","received_events_url":"https://api.github.com/users/JohanLorenzo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JohanLorenzo/nightlies-watcher","description":"Taskcluster watcher bot which verifies if new a Fennec aurora is available and schedules publishing tasks","fork":false,"url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher","forks_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/forks","keys_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/teams","hooks_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/hooks","issue_events_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/issues/events{/number}","events_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/events","assignees_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/assignees{/user}","branches_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/branches{/branch}","tags_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/tags","blobs_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/git/refs{/sha}","trees_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/statuses/{sha}","languages_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/languages","stargazers_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/stargazers","contributors_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/contributors","subscribers_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/subscribers","subscription_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/subscription","commits_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/commits{/sha}","git_commits_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/git/commits{/sha}","comments_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/comments{/number}","issue_comment_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/issues/comments{/number}","contents_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/contents/{+path}","compare_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/merges","archive_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/downloads","issues_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/issues{/number}","pulls_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/pulls{/number}","milestones_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/milestones{/number}","notifications_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/labels{/name}","releases_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/releases{/id}","deployments_url":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/deployments","created_at":"2016-10-10T12:36:44Z","updated_at":"2016-10-10T16:06:42Z","pushed_at":"2016-10-19T16:24:18Z","git_url":"git://github.com/JohanLorenzo/nightlies-watcher.git","ssh_url":"git@github.com:JohanLorenzo/nightlies-watcher.git","clone_url":"https://github.com/JohanLorenzo/nightlies-watcher.git","svn_url":"https://github.com/JohanLorenzo/nightlies-watcher","homepage":null,"size":55,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/pulls/2"},"html":{"href":"https://github.com/JohanLorenzo/nightlies-watcher/pull/2"},"issue":{"href":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/issues/2"},"comments":{"href":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/JohanLorenzo/nightlies-watcher/statuses/c609165c05c6b10694d20c3aa366f4629bf7f1db"}}}}
{"actor":{"display_login":"rail"}}