{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin-web-console/pulls/comments/80732578","pull_request_review_id":1759111,"id":80732578,"diff_hunk":"@@ -0,0 +1,185 @@\n+'use strict';\n+\n+angular.module(\"openshiftConsole\")\n+  .factory(\"QuotaService\", function(APIService,\n+                                    $filter,\n+                                    $q,\n+                                    DataService) {\n+\n+    var isBestEffort = $filter('isBestEffortPod');\n+    var isTerminating = $filter('isTerminatingPod');\n+    var isNil = $filter('isNil');\n+\n+    var filterQuotasForPod = function(pod, quotas) {\n+      var bestEffortPod = isBestEffort(pod);\n+      var terminatingPod = isTerminating(pod);\n+      return _.filter(quotas, function(quota){\n+        // A quota matches a pod if all scopes match the pod\n+        // Break out early if we find any scope that does not match\n+        return !_.some(quota.spec.quota ? quota.spec.quota.scopes : quota.spec.scopes, function(scope) {\n+          var matches = true;\n+          switch(scope) {\n+            case \"Terminating\":\n+              matches = terminatingPod;\n+              break;\n+            case \"NotTerminating\":\n+              matches = !terminatingPod;\n+              break;\n+            case \"BestEffort\":\n+              matches = bestEffortPod;\n+              break;\n+            case \"NotBestEffort\":\n+              matches = !bestEffortPod;\n+              break;\n+          }\n+          return !matches;\n+        });\n+      });\n+    };\n+\n+    var filterQuotasForResource = function(resource, quotas) {\n+      if (resource.kind === 'Pod') {\n+        return filterQuotasForPod(resource, quotas);\n+      }\n+      // We plan on having other resources that scopes will affect\n+      return quotas;\n+    };\n+\n+    var humanizeQuotaResource = $filter('humanizeQuotaResource');\n+    var humanizeKind = $filter('humanizeKind');\n+\n+    var getResourceLimitWarnings = function(resource, quota){","path":"app/scripts/services/quota.js","position":51,"original_position":51,"commit_id":"4b094495c9a733f32a7aec91b187c865aee5832b","original_commit_id":"4b094495c9a733f32a7aec91b187c865aee5832b","user":{"login":"spadgett","id":1167259,"avatar_url":"https://avatars.githubusercontent.com/u/1167259?v=3","gravatar_id":"","url":"https://api.github.com/users/spadgett","html_url":"https://github.com/spadgett","followers_url":"https://api.github.com/users/spadgett/followers","following_url":"https://api.github.com/users/spadgett/following{/other_user}","gists_url":"https://api.github.com/users/spadgett/gists{/gist_id}","starred_url":"https://api.github.com/users/spadgett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spadgett/subscriptions","organizations_url":"https://api.github.com/users/spadgett/orgs","repos_url":"https://api.github.com/users/spadgett/repos","events_url":"https://api.github.com/users/spadgett/events{/privacy}","received_events_url":"https://api.github.com/users/spadgett/received_events","type":"User","site_admin":false},"body":"`getResourceLimitAlerts`? Since some of these are errors and we return an alerts array.","created_at":"2016-09-27T16:16:52Z","updated_at":"2016-09-27T16:17:14Z","html_url":"https://github.com/openshift/origin-web-console/pull/602#discussion_r80732578","pull_request_url":"https://api.github.com/repos/openshift/origin-web-console/pulls/602","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/comments/80732578"},"html":{"href":"https://github.com/openshift/origin-web-console/pull/602#discussion_r80732578"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/602"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin-web-console/pulls/602","id":86952265,"html_url":"https://github.com/openshift/origin-web-console/pull/602","diff_url":"https://github.com/openshift/origin-web-console/pull/602.diff","patch_url":"https://github.com/openshift/origin-web-console/pull/602.patch","issue_url":"https://api.github.com/repos/openshift/origin-web-console/issues/602","number":602,"state":"open","locked":false,"title":"Check basic quota problems before new-app from image or deploy image","user":{"login":"jwforres","id":1467629,"avatar_url":"https://avatars.githubusercontent.com/u/1467629?v=3","gravatar_id":"","url":"https://api.github.com/users/jwforres","html_url":"https://github.com/jwforres","followers_url":"https://api.github.com/users/jwforres/followers","following_url":"https://api.github.com/users/jwforres/following{/other_user}","gists_url":"https://api.github.com/users/jwforres/gists{/gist_id}","starred_url":"https://api.github.com/users/jwforres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwforres/subscriptions","organizations_url":"https://api.github.com/users/jwforres/orgs","repos_url":"https://api.github.com/users/jwforres/repos","events_url":"https://api.github.com/users/jwforres/events{/privacy}","received_events_url":"https://api.github.com/users/jwforres/received_events","type":"User","site_admin":false},"body":"Partially implements https://trello.com/c/mfeqgKvL","created_at":"2016-09-27T15:22:12Z","updated_at":"2016-09-27T16:30:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c3e02065de56308b008a7cb86e5055ae39f67716","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin-web-console/pulls/602/commits","review_comments_url":"https://api.github.com/repos/openshift/origin-web-console/pulls/602/comments","review_comment_url":"https://api.github.com/repos/openshift/origin-web-console/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin-web-console/issues/602/comments","statuses_url":"https://api.github.com/repos/openshift/origin-web-console/statuses/4b094495c9a733f32a7aec91b187c865aee5832b","head":{"label":"jwforres:quota_warnings","ref":"quota_warnings","sha":"4b094495c9a733f32a7aec91b187c865aee5832b","user":{"login":"jwforres","id":1467629,"avatar_url":"https://avatars.githubusercontent.com/u/1467629?v=3","gravatar_id":"","url":"https://api.github.com/users/jwforres","html_url":"https://github.com/jwforres","followers_url":"https://api.github.com/users/jwforres/followers","following_url":"https://api.github.com/users/jwforres/following{/other_user}","gists_url":"https://api.github.com/users/jwforres/gists{/gist_id}","starred_url":"https://api.github.com/users/jwforres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwforres/subscriptions","organizations_url":"https://api.github.com/users/jwforres/orgs","repos_url":"https://api.github.com/users/jwforres/repos","events_url":"https://api.github.com/users/jwforres/events{/privacy}","received_events_url":"https://api.github.com/users/jwforres/received_events","type":"User","site_admin":false},"repo":{"id":58489461,"name":"origin-web-console","full_name":"jwforres/origin-web-console","owner":{"login":"jwforres","id":1467629,"avatar_url":"https://avatars.githubusercontent.com/u/1467629?v=3","gravatar_id":"","url":"https://api.github.com/users/jwforres","html_url":"https://github.com/jwforres","followers_url":"https://api.github.com/users/jwforres/followers","following_url":"https://api.github.com/users/jwforres/following{/other_user}","gists_url":"https://api.github.com/users/jwforres/gists{/gist_id}","starred_url":"https://api.github.com/users/jwforres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwforres/subscriptions","organizations_url":"https://api.github.com/users/jwforres/orgs","repos_url":"https://api.github.com/users/jwforres/repos","events_url":"https://api.github.com/users/jwforres/events{/privacy}","received_events_url":"https://api.github.com/users/jwforres/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jwforres/origin-web-console","description":"","fork":true,"url":"https://api.github.com/repos/jwforres/origin-web-console","forks_url":"https://api.github.com/repos/jwforres/origin-web-console/forks","keys_url":"https://api.github.com/repos/jwforres/origin-web-console/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jwforres/origin-web-console/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jwforres/origin-web-console/teams","hooks_url":"https://api.github.com/repos/jwforres/origin-web-console/hooks","issue_events_url":"https://api.github.com/repos/jwforres/origin-web-console/issues/events{/number}","events_url":"https://api.github.com/repos/jwforres/origin-web-console/events","assignees_url":"https://api.github.com/repos/jwforres/origin-web-console/assignees{/user}","branches_url":"https://api.github.com/repos/jwforres/origin-web-console/branches{/branch}","tags_url":"https://api.github.com/repos/jwforres/origin-web-console/tags","blobs_url":"https://api.github.com/repos/jwforres/origin-web-console/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jwforres/origin-web-console/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jwforres/origin-web-console/git/refs{/sha}","trees_url":"https://api.github.com/repos/jwforres/origin-web-console/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jwforres/origin-web-console/statuses/{sha}","languages_url":"https://api.github.com/repos/jwforres/origin-web-console/languages","stargazers_url":"https://api.github.com/repos/jwforres/origin-web-console/stargazers","contributors_url":"https://api.github.com/repos/jwforres/origin-web-console/contributors","subscribers_url":"https://api.github.com/repos/jwforres/origin-web-console/subscribers","subscription_url":"https://api.github.com/repos/jwforres/origin-web-console/subscription","commits_url":"https://api.github.com/repos/jwforres/origin-web-console/commits{/sha}","git_commits_url":"https://api.github.com/repos/jwforres/origin-web-console/git/commits{/sha}","comments_url":"https://api.github.com/repos/jwforres/origin-web-console/comments{/number}","issue_comment_url":"https://api.github.com/repos/jwforres/origin-web-console/issues/comments{/number}","contents_url":"https://api.github.com/repos/jwforres/origin-web-console/contents/{+path}","compare_url":"https://api.github.com/repos/jwforres/origin-web-console/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jwforres/origin-web-console/merges","archive_url":"https://api.github.com/repos/jwforres/origin-web-console/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jwforres/origin-web-console/downloads","issues_url":"https://api.github.com/repos/jwforres/origin-web-console/issues{/number}","pulls_url":"https://api.github.com/repos/jwforres/origin-web-console/pulls{/number}","milestones_url":"https://api.github.com/repos/jwforres/origin-web-console/milestones{/number}","notifications_url":"https://api.github.com/repos/jwforres/origin-web-console/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jwforres/origin-web-console/labels{/name}","releases_url":"https://api.github.com/repos/jwforres/origin-web-console/releases{/id}","deployments_url":"https://api.github.com/repos/jwforres/origin-web-console/deployments","created_at":"2016-05-10T19:52:39Z","updated_at":"2016-05-10T19:52:41Z","pushed_at":"2016-09-27T15:22:08Z","git_url":"git://github.com/jwforres/origin-web-console.git","ssh_url":"git@github.com:jwforres/origin-web-console.git","clone_url":"https://github.com/jwforres/origin-web-console.git","svn_url":"https://github.com/jwforres/origin-web-console","homepage":null,"size":14350,"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":"openshift:master","ref":"master","sha":"e8e3ecdc1dbe23297674577da7180d48b0c6a3c2","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":58488264,"name":"origin-web-console","full_name":"openshift/origin-web-console","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin-web-console","description":"","fork":false,"url":"https://api.github.com/repos/openshift/origin-web-console","forks_url":"https://api.github.com/repos/openshift/origin-web-console/forks","keys_url":"https://api.github.com/repos/openshift/origin-web-console/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin-web-console/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin-web-console/teams","hooks_url":"https://api.github.com/repos/openshift/origin-web-console/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin-web-console/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin-web-console/events","assignees_url":"https://api.github.com/repos/openshift/origin-web-console/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin-web-console/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin-web-console/tags","blobs_url":"https://api.github.com/repos/openshift/origin-web-console/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin-web-console/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin-web-console/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin-web-console/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin-web-console/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin-web-console/languages","stargazers_url":"https://api.github.com/repos/openshift/origin-web-console/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin-web-console/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin-web-console/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin-web-console/subscription","commits_url":"https://api.github.com/repos/openshift/origin-web-console/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin-web-console/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin-web-console/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin-web-console/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin-web-console/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin-web-console/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin-web-console/merges","archive_url":"https://api.github.com/repos/openshift/origin-web-console/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin-web-console/downloads","issues_url":"https://api.github.com/repos/openshift/origin-web-console/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin-web-console/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin-web-console/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin-web-console/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin-web-console/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin-web-console/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/origin-web-console/deployments","created_at":"2016-05-10T19:31:50Z","updated_at":"2016-09-22T04:30:15Z","pushed_at":"2016-09-27T16:23:19Z","git_url":"git://github.com/openshift/origin-web-console.git","ssh_url":"git@github.com:openshift/origin-web-console.git","clone_url":"https://github.com/openshift/origin-web-console.git","svn_url":"https://github.com/openshift/origin-web-console","homepage":null,"size":15781,"stargazers_count":19,"watchers_count":19,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":68,"forks":47,"open_issues":68,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/602"},"html":{"href":"https://github.com/openshift/origin-web-console/pull/602"},"issue":{"href":"https://api.github.com/repos/openshift/origin-web-console/issues/602"},"comments":{"href":"https://api.github.com/repos/openshift/origin-web-console/issues/602/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/602/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/602/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin-web-console/statuses/4b094495c9a733f32a7aec91b187c865aee5832b"}}}}
{"actor":{"display_login":"spadgett"}}