{"action":"created","comment":{"url":"https://api.github.com/repos/Igalia/snabb/pulls/comments/138924628","pull_request_review_id":62786642,"id":138924628,"diff_hunk":"@@ -410,6 +410,54 @@ function purge_alarms (args)\n    return count\n end\n \n+local function alarm_key_matches (k1, k2)\n+   if k1.resource and k1.resource ~= k2.resource then\n+     return false\n+   elseif k1.alarm_type_id and k1.alarm_type_id ~= k2.alarm_type_id then\n+     return false\n+   elseif k1.alarm_type_qualifier and\n+          k1.alarm_type_qualifier ~= k2.alarm_type_qualifier then\n+     return false\n+   end\n+   return true\n+end\n+\n+local function compress_alarm (alarm)\n+   assert(alarm.status_change)\n+   local latest_status_change = alarm.status_change[#alarm.status_change]\n+   alarm.status_change = {latest_status_change}\n+end\n+\n+-- This operation requests the server to compress entries in the\n+-- alarm list by removing all but the latest state change for all\n+-- alarms.  Conditions in the input are logically ANDed.  If no\n+-- input condition is given, all alarms are compressed.\n+function compress_alarms (key)\n+   local function parse_key (key)\n+      local t = {}\n+      for each in key:gmatch('([^/]+)') do\n+         table.insert(t, each)\n+      end\n+      return {\n+         resource = t[1],","path":"src/lib/yang/alarms.lua","position":33,"original_position":33,"commit_id":"0a5b4d928fe9c3c0354f5c2a70e0508a5b58fc5a","original_commit_id":"0a5b4d928fe9c3c0354f5c2a70e0508a5b58fc5a","user":{"login":"wingo","id":1745903,"avatar_url":"https://avatars1.githubusercontent.com/u/1745903?v=4","gravatar_id":"","url":"https://api.github.com/users/wingo","html_url":"https://github.com/wingo","followers_url":"https://api.github.com/users/wingo/followers","following_url":"https://api.github.com/users/wingo/following{/other_user}","gists_url":"https://api.github.com/users/wingo/gists{/gist_id}","starred_url":"https://api.github.com/users/wingo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wingo/subscriptions","organizations_url":"https://api.github.com/users/wingo/orgs","repos_url":"https://api.github.com/users/wingo/repos","events_url":"https://api.github.com/users/wingo/events{/privacy}","received_events_url":"https://api.github.com/users/wingo/received_events","type":"User","site_admin":false},"body":"Could we separate out arguments resource and alarm type id (plus optional qualifier)?  I thought we did that before.","created_at":"2017-09-14T15:17:47Z","updated_at":"2017-09-14T15:41:30Z","html_url":"https://github.com/Igalia/snabb/pull/942#discussion_r138924628","pull_request_url":"https://api.github.com/repos/Igalia/snabb/pulls/942","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Igalia/snabb/pulls/comments/138924628"},"html":{"href":"https://github.com/Igalia/snabb/pull/942#discussion_r138924628"},"pull_request":{"href":"https://api.github.com/repos/Igalia/snabb/pulls/942"}}},"pull_request":{"url":"https://api.github.com/repos/Igalia/snabb/pulls/942","id":141101933,"html_url":"https://github.com/Igalia/snabb/pull/942","diff_url":"https://github.com/Igalia/snabb/pull/942.diff","patch_url":"https://github.com/Igalia/snabb/pull/942.patch","issue_url":"https://api.github.com/repos/Igalia/snabb/issues/942","number":942,"state":"open","locked":false,"title":"Implement compress alarms","user":{"login":"dpino","id":11567,"avatar_url":"https://avatars1.githubusercontent.com/u/11567?v=4","gravatar_id":"","url":"https://api.github.com/users/dpino","html_url":"https://github.com/dpino","followers_url":"https://api.github.com/users/dpino/followers","following_url":"https://api.github.com/users/dpino/following{/other_user}","gists_url":"https://api.github.com/users/dpino/gists{/gist_id}","starred_url":"https://api.github.com/users/dpino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpino/subscriptions","organizations_url":"https://api.github.com/users/dpino/orgs","repos_url":"https://api.github.com/users/dpino/repos","events_url":"https://api.github.com/users/dpino/events{/privacy}","received_events_url":"https://api.github.com/users/dpino/received_events","type":"User","site_admin":false},"body":"Compress alarms removes all status-changes, except the last one, in all the alarm that match a filtering expression.","created_at":"2017-09-14T15:13:05Z","updated_at":"2017-09-14T15:41:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f38fd953a67ad92a73572acdeaba96e9865a7d1","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Igalia/snabb/pulls/942/commits","review_comments_url":"https://api.github.com/repos/Igalia/snabb/pulls/942/comments","review_comment_url":"https://api.github.com/repos/Igalia/snabb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Igalia/snabb/issues/942/comments","statuses_url":"https://api.github.com/repos/Igalia/snabb/statuses/0a5b4d928fe9c3c0354f5c2a70e0508a5b58fc5a","head":{"label":"dpino:alarm-compress-alarms","ref":"alarm-compress-alarms","sha":"0a5b4d928fe9c3c0354f5c2a70e0508a5b58fc5a","user":{"login":"dpino","id":11567,"avatar_url":"https://avatars1.githubusercontent.com/u/11567?v=4","gravatar_id":"","url":"https://api.github.com/users/dpino","html_url":"https://github.com/dpino","followers_url":"https://api.github.com/users/dpino/followers","following_url":"https://api.github.com/users/dpino/following{/other_user}","gists_url":"https://api.github.com/users/dpino/gists{/gist_id}","starred_url":"https://api.github.com/users/dpino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpino/subscriptions","organizations_url":"https://api.github.com/users/dpino/orgs","repos_url":"https://api.github.com/users/dpino/repos","events_url":"https://api.github.com/users/dpino/events{/privacy}","received_events_url":"https://api.github.com/users/dpino/received_events","type":"User","site_admin":false},"repo":{"id":24632602,"name":"snabb","full_name":"dpino/snabb","owner":{"login":"dpino","id":11567,"avatar_url":"https://avatars1.githubusercontent.com/u/11567?v=4","gravatar_id":"","url":"https://api.github.com/users/dpino","html_url":"https://github.com/dpino","followers_url":"https://api.github.com/users/dpino/followers","following_url":"https://api.github.com/users/dpino/following{/other_user}","gists_url":"https://api.github.com/users/dpino/gists{/gist_id}","starred_url":"https://api.github.com/users/dpino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpino/subscriptions","organizations_url":"https://api.github.com/users/dpino/orgs","repos_url":"https://api.github.com/users/dpino/repos","events_url":"https://api.github.com/users/dpino/events{/privacy}","received_events_url":"https://api.github.com/users/dpino/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dpino/snabb","description":"Snabb Switch: Fast open source packet processing","fork":true,"url":"https://api.github.com/repos/dpino/snabb","forks_url":"https://api.github.com/repos/dpino/snabb/forks","keys_url":"https://api.github.com/repos/dpino/snabb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dpino/snabb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dpino/snabb/teams","hooks_url":"https://api.github.com/repos/dpino/snabb/hooks","issue_events_url":"https://api.github.com/repos/dpino/snabb/issues/events{/number}","events_url":"https://api.github.com/repos/dpino/snabb/events","assignees_url":"https://api.github.com/repos/dpino/snabb/assignees{/user}","branches_url":"https://api.github.com/repos/dpino/snabb/branches{/branch}","tags_url":"https://api.github.com/repos/dpino/snabb/tags","blobs_url":"https://api.github.com/repos/dpino/snabb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dpino/snabb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dpino/snabb/git/refs{/sha}","trees_url":"https://api.github.com/repos/dpino/snabb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dpino/snabb/statuses/{sha}","languages_url":"https://api.github.com/repos/dpino/snabb/languages","stargazers_url":"https://api.github.com/repos/dpino/snabb/stargazers","contributors_url":"https://api.github.com/repos/dpino/snabb/contributors","subscribers_url":"https://api.github.com/repos/dpino/snabb/subscribers","subscription_url":"https://api.github.com/repos/dpino/snabb/subscription","commits_url":"https://api.github.com/repos/dpino/snabb/commits{/sha}","git_commits_url":"https://api.github.com/repos/dpino/snabb/git/commits{/sha}","comments_url":"https://api.github.com/repos/dpino/snabb/comments{/number}","issue_comment_url":"https://api.github.com/repos/dpino/snabb/issues/comments{/number}","contents_url":"https://api.github.com/repos/dpino/snabb/contents/{+path}","compare_url":"https://api.github.com/repos/dpino/snabb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dpino/snabb/merges","archive_url":"https://api.github.com/repos/dpino/snabb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dpino/snabb/downloads","issues_url":"https://api.github.com/repos/dpino/snabb/issues{/number}","pulls_url":"https://api.github.com/repos/dpino/snabb/pulls{/number}","milestones_url":"https://api.github.com/repos/dpino/snabb/milestones{/number}","notifications_url":"https://api.github.com/repos/dpino/snabb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dpino/snabb/labels{/name}","releases_url":"https://api.github.com/repos/dpino/snabb/releases{/id}","deployments_url":"https://api.github.com/repos/dpino/snabb/deployments","created_at":"2014-09-30T09:33:54Z","updated_at":"2016-12-18T01:46:26Z","pushed_at":"2017-09-14T15:11:19Z","git_url":"git://github.com/dpino/snabb.git","ssh_url":"git@github.com:dpino/snabb.git","clone_url":"https://github.com/dpino/snabb.git","svn_url":"https://github.com/dpino/snabb","homepage":"","size":19668,"stargazers_count":0,"watchers_count":0,"language":"Lua","has_issues":false,"has_projects":true,"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":"Igalia:lwaftr","ref":"lwaftr","sha":"57dab91e6697f383fcfc0d6883fd4efb9f4b4416","user":{"login":"Igalia","id":1576566,"avatar_url":"https://avatars3.githubusercontent.com/u/1576566?v=4","gravatar_id":"","url":"https://api.github.com/users/Igalia","html_url":"https://github.com/Igalia","followers_url":"https://api.github.com/users/Igalia/followers","following_url":"https://api.github.com/users/Igalia/following{/other_user}","gists_url":"https://api.github.com/users/Igalia/gists{/gist_id}","starred_url":"https://api.github.com/users/Igalia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Igalia/subscriptions","organizations_url":"https://api.github.com/users/Igalia/orgs","repos_url":"https://api.github.com/users/Igalia/repos","events_url":"https://api.github.com/users/Igalia/events{/privacy}","received_events_url":"https://api.github.com/users/Igalia/received_events","type":"Organization","site_admin":false},"repo":{"id":34452469,"name":"snabb","full_name":"Igalia/snabb","owner":{"login":"Igalia","id":1576566,"avatar_url":"https://avatars3.githubusercontent.com/u/1576566?v=4","gravatar_id":"","url":"https://api.github.com/users/Igalia","html_url":"https://github.com/Igalia","followers_url":"https://api.github.com/users/Igalia/followers","following_url":"https://api.github.com/users/Igalia/following{/other_user}","gists_url":"https://api.github.com/users/Igalia/gists{/gist_id}","starred_url":"https://api.github.com/users/Igalia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Igalia/subscriptions","organizations_url":"https://api.github.com/users/Igalia/orgs","repos_url":"https://api.github.com/users/Igalia/repos","events_url":"https://api.github.com/users/Igalia/events{/privacy}","received_events_url":"https://api.github.com/users/Igalia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Igalia/snabb","description":"Snabb Switch: Fast open source packet processing","fork":true,"url":"https://api.github.com/repos/Igalia/snabb","forks_url":"https://api.github.com/repos/Igalia/snabb/forks","keys_url":"https://api.github.com/repos/Igalia/snabb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Igalia/snabb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Igalia/snabb/teams","hooks_url":"https://api.github.com/repos/Igalia/snabb/hooks","issue_events_url":"https://api.github.com/repos/Igalia/snabb/issues/events{/number}","events_url":"https://api.github.com/repos/Igalia/snabb/events","assignees_url":"https://api.github.com/repos/Igalia/snabb/assignees{/user}","branches_url":"https://api.github.com/repos/Igalia/snabb/branches{/branch}","tags_url":"https://api.github.com/repos/Igalia/snabb/tags","blobs_url":"https://api.github.com/repos/Igalia/snabb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Igalia/snabb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Igalia/snabb/git/refs{/sha}","trees_url":"https://api.github.com/repos/Igalia/snabb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Igalia/snabb/statuses/{sha}","languages_url":"https://api.github.com/repos/Igalia/snabb/languages","stargazers_url":"https://api.github.com/repos/Igalia/snabb/stargazers","contributors_url":"https://api.github.com/repos/Igalia/snabb/contributors","subscribers_url":"https://api.github.com/repos/Igalia/snabb/subscribers","subscription_url":"https://api.github.com/repos/Igalia/snabb/subscription","commits_url":"https://api.github.com/repos/Igalia/snabb/commits{/sha}","git_commits_url":"https://api.github.com/repos/Igalia/snabb/git/commits{/sha}","comments_url":"https://api.github.com/repos/Igalia/snabb/comments{/number}","issue_comment_url":"https://api.github.com/repos/Igalia/snabb/issues/comments{/number}","contents_url":"https://api.github.com/repos/Igalia/snabb/contents/{+path}","compare_url":"https://api.github.com/repos/Igalia/snabb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Igalia/snabb/merges","archive_url":"https://api.github.com/repos/Igalia/snabb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Igalia/snabb/downloads","issues_url":"https://api.github.com/repos/Igalia/snabb/issues{/number}","pulls_url":"https://api.github.com/repos/Igalia/snabb/pulls{/number}","milestones_url":"https://api.github.com/repos/Igalia/snabb/milestones{/number}","notifications_url":"https://api.github.com/repos/Igalia/snabb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Igalia/snabb/labels{/name}","releases_url":"https://api.github.com/repos/Igalia/snabb/releases{/id}","deployments_url":"https://api.github.com/repos/Igalia/snabb/deployments","created_at":"2015-04-23T11:35:43Z","updated_at":"2017-04-25T14:56:59Z","pushed_at":"2017-09-14T15:15:34Z","git_url":"git://github.com/Igalia/snabb.git","ssh_url":"git@github.com:Igalia/snabb.git","clone_url":"https://github.com/Igalia/snabb.git","svn_url":"https://github.com/Igalia/snabb","homepage":"","size":19204,"stargazers_count":12,"watchers_count":12,"language":"Lua","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":47,"forks":3,"open_issues":47,"watchers":12,"default_branch":"lwaftr"}},"_links":{"self":{"href":"https://api.github.com/repos/Igalia/snabb/pulls/942"},"html":{"href":"https://github.com/Igalia/snabb/pull/942"},"issue":{"href":"https://api.github.com/repos/Igalia/snabb/issues/942"},"comments":{"href":"https://api.github.com/repos/Igalia/snabb/issues/942/comments"},"review_comments":{"href":"https://api.github.com/repos/Igalia/snabb/pulls/942/comments"},"review_comment":{"href":"https://api.github.com/repos/Igalia/snabb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Igalia/snabb/pulls/942/commits"},"statuses":{"href":"https://api.github.com/repos/Igalia/snabb/statuses/0a5b4d928fe9c3c0354f5c2a70e0508a5b58fc5a"}},"author_association":"OWNER"}}
{"actor":{"display_login":"wingo"}}