payload: {"action":"created","comment":{"url":"https://api.github.com/repos/kiali/kiali-ui/pulls/comments/291048294","pull_request_review_id":246396778,"id":291048294,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI5MTA0ODI5NA==","diff_hunk":"@@ -54,18 +55,22 @@ export namespace ServiceListFilters {\n       title: 'Health',\n       isNumeric: false,\n       param: 'he',\n-      compare: (a: ServiceItemHealth, b: ServiceItemHealth) => {\n-        const statusForA = a.health.getGlobalStatus();\n-        const statusForB = b.health.getGlobalStatus();\n+      compare: (a: ServiceListItem, b: ServiceListItem) => {\n+        if (isServiceListItemHealth(a) && isServiceListItemHealth(b)) {\n+          const statusForA = a.health.getGlobalStatus();\n+          const statusForB = b.health.getGlobalStatus();\n+\n+          if (statusForA.priority === statusForB.priority) {\n+            // If both services have same health status, use error rate to determine order.\n+            const ratioA = getRequestErrorsStatus(a.health.requests.errorRatio).value;\n+            const ratioB = getRequestErrorsStatus(b.health.requests.errorRatio).value;\n+            return ratioA === ratioB ? a.name.localeCompare(b.name) : ratioB - ratioA;\n+          }\n \n-        if (statusForA.priority === statusForB.priority) {\n-          // If both services have same health status, use error rate to determine order.\n-          const ratioA = getRequestErrorsStatus(a.health.requests.errorRatio).value;\n-          const ratioB = getRequestErrorsStatus(b.health.requests.errorRatio).value;\n-          return ratioA === ratioB ? a.name.localeCompare(b.name) : ratioB - ratioA;\n+          return statusForB.priority - statusForA.priority;\n         }\n \n-        return statusForB.priority - statusForA.priority;\n+        return 0;","path":"src/pages/ServiceList/FiltersAndSorts.ts","position":44,"original_position":38,"commit_id":"1c4a23df01a9b5ec9dca78620505f40a9f3562fc","original_commit_id":"1f4243a86b254895cc8018d7c08c47ef30334244","user":{"login":"jotak","id":2153442,"node_id":"MDQ6VXNlcjIxNTM0NDI=","avatar_url":"https://avatars1.githubusercontent.com/u/2153442?v=4","gravatar_id":"","url":"https://api.github.com/users/jotak","html_url":"https://github.com/jotak","followers_url":"https://api.github.com/users/jotak/followers","following_url":"https://api.github.com/users/jotak/following{/other_user}","gists_url":"https://api.github.com/users/jotak/gists{/gist_id}","starred_url":"https://api.github.com/users/jotak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jotak/subscriptions","organizations_url":"https://api.github.com/users/jotak/orgs","repos_url":"https://api.github.com/users/jotak/repos","events_url":"https://api.github.com/users/jotak/events{/privacy}","received_events_url":"https://api.github.com/users/jotak/received_events","type":"User","site_admin":false},"body":"@cfcosta I can't be 100% sure but it was maybe some zealous defensive check, that we can get rid of.","created_at":"2019-06-06T07:18:14Z","updated_at":"2019-06-06T07:18:14Z","html_url":"https://github.com/kiali/kiali-ui/pull/1240#discussion_r291048294","pull_request_url":"https://api.github.com/repos/kiali/kiali-ui/pulls/1240","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kiali/kiali-ui/pulls/comments/291048294"},"html":{"href":"https://github.com/kiali/kiali-ui/pull/1240#discussion_r291048294"},"pull_request":{"href":"https://api.github.com/repos/kiali/kiali-ui/pulls/1240"}},"in_reply_to_id":290817634},"pull_request":{"url":"https://api.github.com/repos/kiali/kiali-ui/pulls/1240","id":285405954,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjg1NDA1OTU0","html_url":"https://github.com/kiali/kiali-ui/pull/1240","diff_url":"https://github.com/kiali/kiali-ui/pull/1240.diff","patch_url":"https://github.com/kiali/kiali-ui/pull/1240.patch","issue_url":"https://api.github.com/repos/kiali/kiali-ui/issues/1240","number":1240,"state":"open","locked":false,"title":"KIALI-2529 Add type hints to composite types","user":{"login":"cfcosta","id":14752,"node_id":"MDQ6VXNlcjE0NzUy","avatar_url":"https://avatars2.githubusercontent.com/u/14752?v=4","gravatar_id":"","url":"https://api.github.com/users/cfcosta","html_url":"https://github.com/cfcosta","followers_url":"https://api.github.com/users/cfcosta/followers","following_url":"https://api.github.com/users/cfcosta/following{/other_user}","gists_url":"https://api.github.com/users/cfcosta/gists{/gist_id}","starred_url":"https://api.github.com/users/cfcosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfcosta/subscriptions","organizations_url":"https://api.github.com/users/cfcosta/orgs","repos_url":"https://api.github.com/users/cfcosta/repos","events_url":"https://api.github.com/users/cfcosta/events{/privacy}","received_events_url":"https://api.github.com/users/cfcosta/received_events","type":"User","site_admin":false},"body":"Typescript has no way to know if the item has the health attribute or\r\nnot. Before, it just defaulted to any, but when we start using babel, it\r\nbecomes a compilation error.\r\n\r\nThis is one of those cases where the current implementation is incorrect\r\nand only worked because it downcasted it to `any`.","created_at":"2019-06-05T14:38:44Z","updated_at":"2019-06-06T07:18:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"352c274608acf4ef03e5bcf355d5afd2251a3f13","assignee":null,"assignees":[],"requested_reviewers":[{"login":"xeviknal","id":613814,"node_id":"MDQ6VXNlcjYxMzgxNA==","avatar_url":"https://avatars2.githubusercontent.com/u/613814?v=4","gravatar_id":"","url":"https://api.github.com/users/xeviknal","html_url":"https://github.com/xeviknal","followers_url":"https://api.github.com/users/xeviknal/followers","following_url":"https://api.github.com/users/xeviknal/following{/other_user}","gists_url":"https://api.github.com/users/xeviknal/gists{/gist_id}","starred_url":"https://api.github.com/users/xeviknal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xeviknal/subscriptions","organizations_url":"https://api.github.com/users/xeviknal/orgs","repos_url":"https://api.github.com/users/xeviknal/repos","events_url":"https://api.github.com/users/xeviknal/events{/privacy}","received_events_url":"https://api.github.com/users/xeviknal/received_events","type":"User","site_admin":false},{"login":"mtho11","id":1312165,"node_id":"MDQ6VXNlcjEzMTIxNjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1312165?v=4","gravatar_id":"","url":"https://api.github.com/users/mtho11","html_url":"https://github.com/mtho11","followers_url":"https://api.github.com/users/mtho11/followers","following_url":"https://api.github.com/users/mtho11/following{/other_user}","gists_url":"https://api.github.com/users/mtho11/gists{/gist_id}","starred_url":"https://api.github.com/users/mtho11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtho11/subscriptions","organizations_url":"https://api.github.com/users/mtho11/orgs","repos_url":"https://api.github.com/users/mtho11/repos","events_url":"https://api.github.com/users/mtho11/events{/privacy}","received_events_url":"https://api.github.com/users/mtho11/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kiali/kiali-ui/pulls/1240/commits","review_comments_url":"https://api.github.com/repos/kiali/kiali-ui/pulls/1240/comments","review_comment_url":"https://api.github.com/repos/kiali/kiali-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kiali/kiali-ui/issues/1240/comments","statuses_url":"https://api.github.com/repos/kiali/kiali-ui/statuses/1c4a23df01a9b5ec9dca78620505f40a9f3562fc","head":{"label":"cfcosta:kiali-2529-add-type-hints-to-composite-types","ref":"kiali-2529-add-type-hints-to-composite-types","sha":"1c4a23df01a9b5ec9dca78620505f40a9f3562fc","user":{"login":"cfcosta","id":14752,"node_id":"MDQ6VXNlcjE0NzUy","avatar_url":"https://avatars2.githubusercontent.com/u/14752?v=4","gravatar_id":"","url":"https://api.github.com/users/cfcosta","html_url":"https://github.com/cfcosta","followers_url":"https://api.github.com/users/cfcosta/followers","following_url":"https://api.github.com/users/cfcosta/following{/other_user}","gists_url":"https://api.github.com/users/cfcosta/gists{/gist_id}","starred_url":"https://api.github.com/users/cfcosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfcosta/subscriptions","organizations_url":"https://api.github.com/users/cfcosta/orgs","repos_url":"https://api.github.com/users/cfcosta/repos","events_url":"https://api.github.com/users/cfcosta/events{/privacy}","received_events_url":"https://api.github.com/users/cfcosta/received_events","type":"User","site_admin":false},"repo":{"id":123236394,"node_id":"MDEwOlJlcG9zaXRvcnkxMjMyMzYzOTQ=","name":"swsui","full_name":"cfcosta/swsui","private":false,"owner":{"login":"cfcosta","id":14752,"node_id":"MDQ6VXNlcjE0NzUy","avatar_url":"https://avatars2.githubusercontent.com/u/14752?v=4","gravatar_id":"","url":"https://api.github.com/users/cfcosta","html_url":"https://github.com/cfcosta","followers_url":"https://api.github.com/users/cfcosta/followers","following_url":"https://api.github.com/users/cfcosta/following{/other_user}","gists_url":"https://api.github.com/users/cfcosta/gists{/gist_id}","starred_url":"https://api.github.com/users/cfcosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfcosta/subscriptions","organizations_url":"https://api.github.com/users/cfcosta/orgs","repos_url":"https://api.github.com/users/cfcosta/repos","events_url":"https://api.github.com/users/cfcosta/events{/privacy}","received_events_url":"https://api.github.com/users/cfcosta/received_events","type":"User","site_admin":false},"html_url":"https://github.com/cfcosta/swsui","description":null,"fork":true,"url":"https://api.github.com/repos/cfcosta/swsui","forks_url":"https://api.github.com/repos/cfcosta/swsui/forks","keys_url":"https://api.github.com/repos/cfcosta/swsui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfcosta/swsui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfcosta/swsui/teams","hooks_url":"https://api.github.com/repos/cfcosta/swsui/hooks","issue_events_url":"https://api.github.com/repos/cfcosta/swsui/issues/events{/number}","events_url":"https://api.github.com/repos/cfcosta/swsui/events","assignees_url":"https://api.github.com/repos/cfcosta/swsui/assignees{/user}","branches_url":"https://api.github.com/repos/cfcosta/swsui/branches{/branch}","tags_url":"https://api.github.com/repos/cfcosta/swsui/tags","blobs_url":"https://api.github.com/repos/cfcosta/swsui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfcosta/swsui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfcosta/swsui/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfcosta/swsui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfcosta/swsui/statuses/{sha}","languages_url":"https://api.github.com/repos/cfcosta/swsui/languages","stargazers_url":"https://api.github.com/repos/cfcosta/swsui/stargazers","contributors_url":"https://api.github.com/repos/cfcosta/swsui/contributors","subscribers_url":"https://api.github.com/repos/cfcosta/swsui/subscribers","subscription_url":"https://api.github.com/repos/cfcosta/swsui/subscription","commits_url":"https://api.github.com/repos/cfcosta/swsui/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfcosta/swsui/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfcosta/swsui/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfcosta/swsui/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfcosta/swsui/contents/{+path}","compare_url":"https://api.github.com/repos/cfcosta/swsui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfcosta/swsui/merges","archive_url":"https://api.github.com/repos/cfcosta/swsui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfcosta/swsui/downloads","issues_url":"https://api.github.com/repos/cfcosta/swsui/issues{/number}","pulls_url":"https://api.github.com/repos/cfcosta/swsui/pulls{/number}","milestones_url":"https://api.github.com/repos/cfcosta/swsui/milestones{/number}","notifications_url":"https://api.github.com/repos/cfcosta/swsui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfcosta/swsui/labels{/name}","releases_url":"https://api.github.com/repos/cfcosta/swsui/releases{/id}","deployments_url":"https://api.github.com/repos/cfcosta/swsui/deployments","created_at":"2018-02-28T05:52:42Z","updated_at":"2018-12-13T01:13:56Z","pushed_at":"2019-06-06T07:07:53Z","git_url":"git://github.com/cfcosta/swsui.git","ssh_url":"git@github.com:cfcosta/swsui.git","clone_url":"https://github.com/cfcosta/swsui.git","svn_url":"https://github.com/cfcosta/swsui","homepage":null,"size":53873,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"kiali:master","ref":"master","sha":"4cfcea6865ca355966fa1605a75c3a2fae445e86","user":{"login":"kiali","id":36001875,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MDAxODc1","avatar_url":"https://avatars2.githubusercontent.com/u/36001875?v=4","gravatar_id":"","url":"https://api.github.com/users/kiali","html_url":"https://github.com/kiali","followers_url":"https://api.github.com/users/kiali/followers","following_url":"https://api.github.com/users/kiali/following{/other_user}","gists_url":"https://api.github.com/users/kiali/gists{/gist_id}","starred_url":"https://api.github.com/users/kiali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiali/subscriptions","organizations_url":"https://api.github.com/users/kiali/orgs","repos_url":"https://api.github.com/users/kiali/repos","events_url":"https://api.github.com/users/kiali/events{/privacy}","received_events_url":"https://api.github.com/users/kiali/received_events","type":"Organization","site_admin":false},"repo":{"id":120308264,"node_id":"MDEwOlJlcG9zaXRvcnkxMjAzMDgyNjQ=","name":"kiali-ui","full_name":"kiali/kiali-ui","private":false,"owner":{"login":"kiali","id":36001875,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MDAxODc1","avatar_url":"https://avatars2.githubusercontent.com/u/36001875?v=4","gravatar_id":"","url":"https://api.github.com/users/kiali","html_url":"https://github.com/kiali","followers_url":"https://api.github.com/users/kiali/followers","following_url":"https://api.github.com/users/kiali/following{/other_user}","gists_url":"https://api.github.com/users/kiali/gists{/gist_id}","starred_url":"https://api.github.com/users/kiali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiali/subscriptions","organizations_url":"https://api.github.com/users/kiali/orgs","repos_url":"https://api.github.com/users/kiali/repos","events_url":"https://api.github.com/users/kiali/events{/privacy}","received_events_url":"https://api.github.com/users/kiali/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/kiali/kiali-ui","description":"Frontend part of Kiali (use github.com/kiali/kiali to report issues)","fork":false,"url":"https://api.github.com/repos/kiali/kiali-ui","forks_url":"https://api.github.com/repos/kiali/kiali-ui/forks","keys_url":"https://api.github.com/repos/kiali/kiali-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kiali/kiali-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kiali/kiali-ui/teams","hooks_url":"https://api.github.com/repos/kiali/kiali-ui/hooks","issue_events_url":"https://api.github.com/repos/kiali/kiali-ui/issues/events{/number}","events_url":"https://api.github.com/repos/kiali/kiali-ui/events","assignees_url":"https://api.github.com/repos/kiali/kiali-ui/assignees{/user}","branches_url":"https://api.github.com/repos/kiali/kiali-ui/branches{/branch}","tags_url":"https://api.github.com/repos/kiali/kiali-ui/tags","blobs_url":"https://api.github.com/repos/kiali/kiali-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kiali/kiali-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kiali/kiali-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/kiali/kiali-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kiali/kiali-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/kiali/kiali-ui/languages","stargazers_url":"https://api.github.com/repos/kiali/kiali-ui/stargazers","contributors_url":"https://api.github.com/repos/kiali/kiali-ui/contributors","subscribers_url":"https://api.github.com/repos/kiali/kiali-ui/subscribers","subscription_url":"https://api.github.com/repos/kiali/kiali-ui/subscription","commits_url":"https://api.github.com/repos/kiali/kiali-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/kiali/kiali-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/kiali/kiali-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/kiali/kiali-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/kiali/kiali-ui/contents/{+path}","compare_url":"https://api.github.com/repos/kiali/kiali-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kiali/kiali-ui/merges","archive_url":"https://api.github.com/repos/kiali/kiali-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kiali/kiali-ui/downloads","issues_url":"https://api.github.com/repos/kiali/kiali-ui/issues{/number}","pulls_url":"https://api.github.com/repos/kiali/kiali-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/kiali/kiali-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/kiali/kiali-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kiali/kiali-ui/labels{/name}","releases_url":"https://api.github.com/repos/kiali/kiali-ui/releases{/id}","deployments_url":"https://api.github.com/repos/kiali/kiali-ui/deployments","created_at":"2018-02-05T13:27:15Z","updated_at":"2019-06-06T01:24:34Z","pushed_at":"2019-06-06T01:24:30Z","git_url":"git://github.com/kiali/kiali-ui.git","ssh_url":"git@github.com:kiali/kiali-ui.git","clone_url":"https://github.com/kiali/kiali-ui.git","svn_url":"https://github.com/kiali/kiali-ui","homepage":"https://www.kiali.io","size":8201,"stargazers_count":90,"watchers_count":90,"language":"TypeScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":49,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":13,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":49,"open_issues":13,"watchers":90,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kiali/kiali-ui/pulls/1240"},"html":{"href":"https://github.com/kiali/kiali-ui/pull/1240"},"issue":{"href":"https://api.github.com/repos/kiali/kiali-ui/issues/1240"},"comments":{"href":"https://api.github.com/repos/kiali/kiali-ui/issues/1240/comments"},"review_comments":{"href":"https://api.github.com/repos/kiali/kiali-ui/pulls/1240/comments"},"review_comment":{"href":"https://api.github.com/repos/kiali/kiali-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kiali/kiali-ui/pulls/1240/commits"},"statuses":{"href":"https://api.github.com/repos/kiali/kiali-ui/statuses/1c4a23df01a9b5ec9dca78620505f40a9f3562fc"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"jotak"}}