{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/74229854","id":74229854,"diff_hunk":"@@ -22,4 +22,6 @@ class EventStream < ApplicationRecord\n   belongs_to :container_replicator\n   belongs_to :container_group\n   belongs_to :container_node\n+\n+  belongs_to :middleware_server, :foreign_key => :middleware_server_id","path":"app/models/event_stream.rb","position":5,"original_position":5,"commit_id":"8c277b7929ed598b4d5e0a959aa3ce29d6d1173e","original_commit_id":"8c277b7929ed598b4d5e0a959aa3ce29d6d1173e","user":{"login":"lucasponce","id":1662329,"avatar_url":"https://avatars.githubusercontent.com/u/1662329?v=3","gravatar_id":"","url":"https://api.github.com/users/lucasponce","html_url":"https://github.com/lucasponce","followers_url":"https://api.github.com/users/lucasponce/followers","following_url":"https://api.github.com/users/lucasponce/following{/other_user}","gists_url":"https://api.github.com/users/lucasponce/gists{/gist_id}","starred_url":"https://api.github.com/users/lucasponce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucasponce/subscriptions","organizations_url":"https://api.github.com/users/lucasponce/orgs","repos_url":"https://api.github.com/users/lucasponce/repos","events_url":"https://api.github.com/users/lucasponce/events{/privacy}","received_events_url":"https://api.github.com/users/lucasponce/received_events","type":"User","site_admin":false},"body":"I've remembered it. Yes it is needed as the fk comes from the event_streams table which was updated in a previous work with the middleware_server_id column as a foreign key.\r\n","created_at":"2016-08-10T11:52:39Z","updated_at":"2016-08-10T11:52:39Z","html_url":"https://github.com/ManageIQ/manageiq/pull/9553#discussion_r74229854","pull_request_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/9553","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/74229854"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/9553#discussion_r74229854"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/9553"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/9553","id":75846236,"html_url":"https://github.com/ManageIQ/manageiq/pull/9553","diff_url":"https://github.com/ManageIQ/manageiq/pull/9553.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/9553.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/9553","number":9553,"state":"open","locked":false,"title":"Link MiQ Alerts with Hawkular Events","user":{"login":"lucasponce","id":1662329,"avatar_url":"https://avatars.githubusercontent.com/u/1662329?v=3","gravatar_id":"","url":"https://api.github.com/users/lucasponce","html_url":"https://github.com/lucasponce","followers_url":"https://api.github.com/users/lucasponce/followers","following_url":"https://api.github.com/users/lucasponce/following{/other_user}","gists_url":"https://api.github.com/users/lucasponce/gists{/gist_id}","starred_url":"https://api.github.com/users/lucasponce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucasponce/subscriptions","organizations_url":"https://api.github.com/users/lucasponce/orgs","repos_url":"https://api.github.com/users/lucasponce/repos","events_url":"https://api.github.com/users/lucasponce/events{/privacy}","received_events_url":"https://api.github.com/users/lucasponce/received_events","type":"User","site_admin":false},"body":"This PR depends on #9441, #9460 and #9511.\r\nThis work completes an end-to-end flow to add alerting support into Middleware provider.\r\nOnce that the MiQ Alers are synced on the Middleware provider side, the provider starts to evaluate the conditions and emit specific provider events.\r\nThe last part is to link these provider events into MiQ Alerts subsystem as a way to evaluate the defined MiQ Alert.\r\nThis approach is different to other code inside MiQ as we are introducing a new use case:\r\n- A scenario to detect a bad conditions is defined on MiQ side in the way of an alert (MiQ Alert).\r\n- This scenario is synced on the provider, as the provider is responsible to compute and detect these conditions (so, in the opposite of other MiQ alerting over metrics, MiQ here is not computing when a situation is happening, it delegates into the provider).\r\n- The Middleware events provided are implicit, so from an user perspective he is declaring just a MiQ Alert, these specific Middleware Events are part of the internal implementation.","created_at":"2016-06-30T16:01:52Z","updated_at":"2016-08-10T11:52:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5bcd2b9326358315d88f4aae57279fda67fe4aee","assignee":{"login":"abonas","id":6277245,"avatar_url":"https://avatars.githubusercontent.com/u/6277245?v=3","gravatar_id":"","url":"https://api.github.com/users/abonas","html_url":"https://github.com/abonas","followers_url":"https://api.github.com/users/abonas/followers","following_url":"https://api.github.com/users/abonas/following{/other_user}","gists_url":"https://api.github.com/users/abonas/gists{/gist_id}","starred_url":"https://api.github.com/users/abonas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abonas/subscriptions","organizations_url":"https://api.github.com/users/abonas/orgs","repos_url":"https://api.github.com/users/abonas/repos","events_url":"https://api.github.com/users/abonas/events{/privacy}","received_events_url":"https://api.github.com/users/abonas/received_events","type":"User","site_admin":false},"assignees":[{"login":"abonas","id":6277245,"avatar_url":"https://avatars.githubusercontent.com/u/6277245?v=3","gravatar_id":"","url":"https://api.github.com/users/abonas","html_url":"https://github.com/abonas","followers_url":"https://api.github.com/users/abonas/followers","following_url":"https://api.github.com/users/abonas/following{/other_user}","gists_url":"https://api.github.com/users/abonas/gists{/gist_id}","starred_url":"https://api.github.com/users/abonas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abonas/subscriptions","organizations_url":"https://api.github.com/users/abonas/orgs","repos_url":"https://api.github.com/users/abonas/repos","events_url":"https://api.github.com/users/abonas/events{/privacy}","received_events_url":"https://api.github.com/users/abonas/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/9553/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/9553/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/9553/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/8c277b7929ed598b4d5e0a959aa3ce29d6d1173e","head":{"label":"lucasponce:hawkular-alerts-link-miq-alerts-with-hawkular-events","ref":"hawkular-alerts-link-miq-alerts-with-hawkular-events","sha":"8c277b7929ed598b4d5e0a959aa3ce29d6d1173e","user":{"login":"lucasponce","id":1662329,"avatar_url":"https://avatars.githubusercontent.com/u/1662329?v=3","gravatar_id":"","url":"https://api.github.com/users/lucasponce","html_url":"https://github.com/lucasponce","followers_url":"https://api.github.com/users/lucasponce/followers","following_url":"https://api.github.com/users/lucasponce/following{/other_user}","gists_url":"https://api.github.com/users/lucasponce/gists{/gist_id}","starred_url":"https://api.github.com/users/lucasponce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucasponce/subscriptions","organizations_url":"https://api.github.com/users/lucasponce/orgs","repos_url":"https://api.github.com/users/lucasponce/repos","events_url":"https://api.github.com/users/lucasponce/events{/privacy}","received_events_url":"https://api.github.com/users/lucasponce/received_events","type":"User","site_admin":false},"repo":{"id":52009210,"name":"manageiq","full_name":"lucasponce/manageiq","owner":{"login":"lucasponce","id":1662329,"avatar_url":"https://avatars.githubusercontent.com/u/1662329?v=3","gravatar_id":"","url":"https://api.github.com/users/lucasponce","html_url":"https://github.com/lucasponce","followers_url":"https://api.github.com/users/lucasponce/followers","following_url":"https://api.github.com/users/lucasponce/following{/other_user}","gists_url":"https://api.github.com/users/lucasponce/gists{/gist_id}","starred_url":"https://api.github.com/users/lucasponce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucasponce/subscriptions","organizations_url":"https://api.github.com/users/lucasponce/orgs","repos_url":"https://api.github.com/users/lucasponce/repos","events_url":"https://api.github.com/users/lucasponce/events{/privacy}","received_events_url":"https://api.github.com/users/lucasponce/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lucasponce/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/lucasponce/manageiq","forks_url":"https://api.github.com/repos/lucasponce/manageiq/forks","keys_url":"https://api.github.com/repos/lucasponce/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lucasponce/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lucasponce/manageiq/teams","hooks_url":"https://api.github.com/repos/lucasponce/manageiq/hooks","issue_events_url":"https://api.github.com/repos/lucasponce/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/lucasponce/manageiq/events","assignees_url":"https://api.github.com/repos/lucasponce/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/lucasponce/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/lucasponce/manageiq/tags","blobs_url":"https://api.github.com/repos/lucasponce/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lucasponce/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lucasponce/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/lucasponce/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lucasponce/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/lucasponce/manageiq/languages","stargazers_url":"https://api.github.com/repos/lucasponce/manageiq/stargazers","contributors_url":"https://api.github.com/repos/lucasponce/manageiq/contributors","subscribers_url":"https://api.github.com/repos/lucasponce/manageiq/subscribers","subscription_url":"https://api.github.com/repos/lucasponce/manageiq/subscription","commits_url":"https://api.github.com/repos/lucasponce/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/lucasponce/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/lucasponce/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/lucasponce/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/lucasponce/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/lucasponce/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lucasponce/manageiq/merges","archive_url":"https://api.github.com/repos/lucasponce/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lucasponce/manageiq/downloads","issues_url":"https://api.github.com/repos/lucasponce/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/lucasponce/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/lucasponce/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/lucasponce/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lucasponce/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/lucasponce/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/lucasponce/manageiq/deployments","created_at":"2016-02-18T13:31:38Z","updated_at":"2016-02-18T13:31:56Z","pushed_at":"2016-08-10T09:14:25Z","git_url":"git://github.com/lucasponce/manageiq.git","ssh_url":"git@github.com:lucasponce/manageiq.git","clone_url":"https://github.com/lucasponce/manageiq.git","svn_url":"https://github.com/lucasponce/manageiq","homepage":"manageiq.org","size":147891,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"ManageIQ:master","ref":"master","sha":"7a1d893781651b8975c2efa961a38d5fa0a08362","user":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"repo":{"id":20789757,"name":"manageiq","full_name":"ManageIQ/manageiq","owner":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ManageIQ/manageiq","description":"ManageIQ Open-Source Management Platform","fork":false,"url":"https://api.github.com/repos/ManageIQ/manageiq","forks_url":"https://api.github.com/repos/ManageIQ/manageiq/forks","keys_url":"https://api.github.com/repos/ManageIQ/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManageIQ/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManageIQ/manageiq/teams","hooks_url":"https://api.github.com/repos/ManageIQ/manageiq/hooks","issue_events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/ManageIQ/manageiq/events","assignees_url":"https://api.github.com/repos/ManageIQ/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/ManageIQ/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/ManageIQ/manageiq/tags","blobs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManageIQ/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManageIQ/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/ManageIQ/manageiq/languages","stargazers_url":"https://api.github.com/repos/ManageIQ/manageiq/stargazers","contributors_url":"https://api.github.com/repos/ManageIQ/manageiq/contributors","subscribers_url":"https://api.github.com/repos/ManageIQ/manageiq/subscribers","subscription_url":"https://api.github.com/repos/ManageIQ/manageiq/subscription","commits_url":"https://api.github.com/repos/ManageIQ/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManageIQ/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManageIQ/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/ManageIQ/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManageIQ/manageiq/merges","archive_url":"https://api.github.com/repos/ManageIQ/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManageIQ/manageiq/downloads","issues_url":"https://api.github.com/repos/ManageIQ/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/ManageIQ/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/ManageIQ/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/ManageIQ/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/ManageIQ/manageiq/deployments","created_at":"2014-06-13T02:31:26Z","updated_at":"2016-08-10T08:52:05Z","pushed_at":"2016-08-10T11:50:01Z","git_url":"git://github.com/ManageIQ/manageiq.git","ssh_url":"git@github.com:ManageIQ/manageiq.git","clone_url":"https://github.com/ManageIQ/manageiq.git","svn_url":"https://github.com/ManageIQ/manageiq","homepage":"manageiq.org","size":192418,"stargazers_count":299,"watchers_count":299,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":333,"mirror_url":null,"open_issues_count":761,"forks":333,"open_issues":761,"watchers":299,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/9553"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/9553"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/9553"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/9553/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/9553/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/9553/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/8c277b7929ed598b4d5e0a959aa3ce29d6d1173e"}}}}
{"actor":{"display_login":"lucasponce"}}