{"action":"created","comment":{"url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/pulls/comments/23284428","id":23284428,"diff_hunk":"@@ -0,0 +1,123 @@\n+import datetime\n+\n+from pandas.tseries import offsets\n+\n+CRITICAL_IMPORTANCE = \"Critical\"\n+HIGH_IMPORTANCE = \"High\"\n+\n+IN_PROGRESS_STATUS = \"In Progress\"\n+\n+CUSTOMER_FOUND_TAG = \"customer-found\"\n+\n+\n+def business_days_ago(days):\n+    timedelta = datetime.datetime.now() - offsets.BDay(days)\n+    return timedelta.to_datetime()\n+\n+\n+class BugCriteria(object):\n+    def get_hint_text(self, bug, template):\n+        is_customer_found = CUSTOMER_FOUND_TAG in bug.tags\n+\n+        if getattr(self, 'threshold', None):\n+            threshold = self.threshold\n+        else:\n+            if bug.importance in [CRITICAL_IMPORTANCE, HIGH_IMPORTANCE]:\n+                threshold_template = bug.importance.lower()\n+            else:\n+                threshold_template = \"others\"\n+            if is_customer_found:\n+                threshold_template += \"_customer_found\"\n+            threshold_template += \"_threshold\"\n+            try:\n+                threshold = getattr(self, threshold_template)\n+            except AttributeError:\n+                if is_customer_found:\n+                    threshold = getattr(\n+                        self,\n+                        threshold_template.replace(\"_customer_found\", \"\")\n+                    )\n+\n+        hint_data = {\n+            \"importance\": bug.importance,\n+            \"with_customer_found\": \"with `customer-found` tag\" if is_customer_found else \"\",\n+            \"threshold\": threshold,\n+        }\n+        return template.format(**hint_data)\n+\n+\n+class NonTriaged(BugCriteria):\n+    \"\"\"\n+    Working out New bugs:","path":"launchpad_reporting/criterias.py","position":51,"original_position":51,"commit_id":"2b71d2902b923cc82b28d76b9214ac1a23dbd822","original_commit_id":"2b71d2902b923cc82b28d76b9214ac1a23dbd822","user":{"login":"vikt0rs","id":5230490,"avatar_url":"https://avatars.githubusercontent.com/u/5230490?v=3","gravatar_id":"","url":"https://api.github.com/users/vikt0rs","html_url":"https://github.com/vikt0rs","followers_url":"https://api.github.com/users/vikt0rs/followers","following_url":"https://api.github.com/users/vikt0rs/following{/other_user}","gists_url":"https://api.github.com/users/vikt0rs/gists{/gist_id}","starred_url":"https://api.github.com/users/vikt0rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vikt0rs/subscriptions","organizations_url":"https://api.github.com/users/vikt0rs/orgs","repos_url":"https://api.github.com/users/vikt0rs/repos","events_url":"https://api.github.com/users/vikt0rs/events{/privacy}","received_events_url":"https://api.github.com/users/vikt0rs/received_events","type":"User","site_admin":false},"body":"done","created_at":"2015-01-21T08:35:24Z","updated_at":"2015-01-21T08:35:24Z","html_url":"https://github.com/Mirantis/launchpad-reports-summary/pull/43#discussion_r23284428","pull_request_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/pulls/43","_links":{"self":{"href":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/pulls/comments/23284428"},"html":{"href":"https://github.com/Mirantis/launchpad-reports-summary/pull/43#discussion_r23284428"},"pull_request":{"href":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/pulls/43","id":27669216,"html_url":"https://github.com/Mirantis/launchpad-reports-summary/pull/43","diff_url":"https://github.com/Mirantis/launchpad-reports-summary/pull/43.diff","patch_url":"https://github.com/Mirantis/launchpad-reports-summary/pull/43.patch","issue_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/issues/43","number":43,"state":"open","locked":false,"title":"SLA reports implementation","user":{"login":"vikt0rs","id":5230490,"avatar_url":"https://avatars.githubusercontent.com/u/5230490?v=3","gravatar_id":"","url":"https://api.github.com/users/vikt0rs","html_url":"https://github.com/vikt0rs","followers_url":"https://api.github.com/users/vikt0rs/followers","following_url":"https://api.github.com/users/vikt0rs/following{/other_user}","gists_url":"https://api.github.com/users/vikt0rs/gists{/gist_id}","starred_url":"https://api.github.com/users/vikt0rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vikt0rs/subscriptions","organizations_url":"https://api.github.com/users/vikt0rs/orgs","repos_url":"https://api.github.com/users/vikt0rs/repos","events_url":"https://api.github.com/users/vikt0rs/events{/privacy}","received_events_url":"https://api.github.com/users/vikt0rs/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-20T11:03:58Z","updated_at":"2015-01-21T08:35:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac8e619ff3c8a3e1f52615fd83399dbbcf36bd9e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/pulls/43/commits","review_comments_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/pulls/43/comments","review_comment_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/issues/43/comments","statuses_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/statuses/2b71d2902b923cc82b28d76b9214ac1a23dbd822","head":{"label":"vikt0rs:read-config","ref":"read-config","sha":"2b71d2902b923cc82b28d76b9214ac1a23dbd822","user":{"login":"vikt0rs","id":5230490,"avatar_url":"https://avatars.githubusercontent.com/u/5230490?v=3","gravatar_id":"","url":"https://api.github.com/users/vikt0rs","html_url":"https://github.com/vikt0rs","followers_url":"https://api.github.com/users/vikt0rs/followers","following_url":"https://api.github.com/users/vikt0rs/following{/other_user}","gists_url":"https://api.github.com/users/vikt0rs/gists{/gist_id}","starred_url":"https://api.github.com/users/vikt0rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vikt0rs/subscriptions","organizations_url":"https://api.github.com/users/vikt0rs/orgs","repos_url":"https://api.github.com/users/vikt0rs/repos","events_url":"https://api.github.com/users/vikt0rs/events{/privacy}","received_events_url":"https://api.github.com/users/vikt0rs/received_events","type":"User","site_admin":false},"repo":{"id":27546255,"name":"launchpad-reports-summary","full_name":"vikt0rs/launchpad-reports-summary","owner":{"login":"vikt0rs","id":5230490,"avatar_url":"https://avatars.githubusercontent.com/u/5230490?v=3","gravatar_id":"","url":"https://api.github.com/users/vikt0rs","html_url":"https://github.com/vikt0rs","followers_url":"https://api.github.com/users/vikt0rs/followers","following_url":"https://api.github.com/users/vikt0rs/following{/other_user}","gists_url":"https://api.github.com/users/vikt0rs/gists{/gist_id}","starred_url":"https://api.github.com/users/vikt0rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vikt0rs/subscriptions","organizations_url":"https://api.github.com/users/vikt0rs/orgs","repos_url":"https://api.github.com/users/vikt0rs/repos","events_url":"https://api.github.com/users/vikt0rs/events{/privacy}","received_events_url":"https://api.github.com/users/vikt0rs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vikt0rs/launchpad-reports-summary","description":"","fork":true,"url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary","forks_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/forks","keys_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/teams","hooks_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/hooks","issue_events_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/issues/events{/number}","events_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/events","assignees_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/assignees{/user}","branches_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/branches{/branch}","tags_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/tags","blobs_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/git/refs{/sha}","trees_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/statuses/{sha}","languages_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/languages","stargazers_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/stargazers","contributors_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/contributors","subscribers_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/subscribers","subscription_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/subscription","commits_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/commits{/sha}","git_commits_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/git/commits{/sha}","comments_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/comments{/number}","issue_comment_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/issues/comments/{number}","contents_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/contents/{+path}","compare_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/merges","archive_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/downloads","issues_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/issues{/number}","pulls_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/pulls{/number}","milestones_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/milestones{/number}","notifications_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/labels{/name}","releases_url":"https://api.github.com/repos/vikt0rs/launchpad-reports-summary/releases{/id}","created_at":"2014-12-04T15:18:58Z","updated_at":"2014-12-04T15:18:58Z","pushed_at":"2015-01-20T11:02:59Z","git_url":"git://github.com/vikt0rs/launchpad-reports-summary.git","ssh_url":"git@github.com:vikt0rs/launchpad-reports-summary.git","clone_url":"https://github.com/vikt0rs/launchpad-reports-summary.git","svn_url":"https://github.com/vikt0rs/launchpad-reports-summary","homepage":"","size":5173,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"master"}},"base":{"label":"Mirantis:master","ref":"master","sha":"df5742e74a17bab507422e502420fcd6b3c9c3e8","user":{"login":"Mirantis","id":609319,"avatar_url":"https://avatars.githubusercontent.com/u/609319?v=3","gravatar_id":"","url":"https://api.github.com/users/Mirantis","html_url":"https://github.com/Mirantis","followers_url":"https://api.github.com/users/Mirantis/followers","following_url":"https://api.github.com/users/Mirantis/following{/other_user}","gists_url":"https://api.github.com/users/Mirantis/gists{/gist_id}","starred_url":"https://api.github.com/users/Mirantis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mirantis/subscriptions","organizations_url":"https://api.github.com/users/Mirantis/orgs","repos_url":"https://api.github.com/users/Mirantis/repos","events_url":"https://api.github.com/users/Mirantis/events{/privacy}","received_events_url":"https://api.github.com/users/Mirantis/received_events","type":"Organization","site_admin":false},"repo":{"id":22878239,"name":"launchpad-reports-summary","full_name":"Mirantis/launchpad-reports-summary","owner":{"login":"Mirantis","id":609319,"avatar_url":"https://avatars.githubusercontent.com/u/609319?v=3","gravatar_id":"","url":"https://api.github.com/users/Mirantis","html_url":"https://github.com/Mirantis","followers_url":"https://api.github.com/users/Mirantis/followers","following_url":"https://api.github.com/users/Mirantis/following{/other_user}","gists_url":"https://api.github.com/users/Mirantis/gists{/gist_id}","starred_url":"https://api.github.com/users/Mirantis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mirantis/subscriptions","organizations_url":"https://api.github.com/users/Mirantis/orgs","repos_url":"https://api.github.com/users/Mirantis/repos","events_url":"https://api.github.com/users/Mirantis/events{/privacy}","received_events_url":"https://api.github.com/users/Mirantis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Mirantis/launchpad-reports-summary","description":"status","fork":false,"url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary","forks_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/forks","keys_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/teams","hooks_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/hooks","issue_events_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/issues/events{/number}","events_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/events","assignees_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/assignees{/user}","branches_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/branches{/branch}","tags_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/tags","blobs_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/statuses/{sha}","languages_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/languages","stargazers_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/stargazers","contributors_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/contributors","subscribers_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/subscribers","subscription_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/subscription","commits_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/issues/comments/{number}","contents_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/contents/{+path}","compare_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/merges","archive_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/downloads","issues_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/issues{/number}","pulls_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/pulls{/number}","milestones_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/milestones{/number}","notifications_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/labels{/name}","releases_url":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/releases{/id}","created_at":"2014-08-12T13:29:05Z","updated_at":"2014-12-29T10:49:15Z","pushed_at":"2014-12-29T10:49:15Z","git_url":"git://github.com/Mirantis/launchpad-reports-summary.git","ssh_url":"git@github.com:Mirantis/launchpad-reports-summary.git","clone_url":"https://github.com/Mirantis/launchpad-reports-summary.git","svn_url":"https://github.com/Mirantis/launchpad-reports-summary","homepage":"","size":5647,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":3,"forks":7,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/pulls/43"},"html":{"href":"https://github.com/Mirantis/launchpad-reports-summary/pull/43"},"issue":{"href":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/issues/43"},"comments":{"href":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/Mirantis/launchpad-reports-summary/statuses/2b71d2902b923cc82b28d76b9214ac1a23dbd822"}}}}