{"action":"opened","number":17475,"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17475","id":190133395,"html_url":"https://github.com/ManageIQ/manageiq/pull/17475","diff_url":"https://github.com/ManageIQ/manageiq/pull/17475.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/17475.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/17475","number":17475,"state":"open","locked":false,"title":"Convert ComplianceMixin to use has_one/virtual_delegate","user":{"login":"NickLaMuro","id":314014,"avatar_url":"https://avatars0.githubusercontent.com/u/314014?v=4","gravatar_id":"","url":"https://api.github.com/users/NickLaMuro","html_url":"https://github.com/NickLaMuro","followers_url":"https://api.github.com/users/NickLaMuro/followers","following_url":"https://api.github.com/users/NickLaMuro/following{/other_user}","gists_url":"https://api.github.com/users/NickLaMuro/gists{/gist_id}","starred_url":"https://api.github.com/users/NickLaMuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickLaMuro/subscriptions","organizations_url":"https://api.github.com/users/NickLaMuro/orgs","repos_url":"https://api.github.com/users/NickLaMuro/repos","events_url":"https://api.github.com/users/NickLaMuro/events{/privacy}","received_events_url":"https://api.github.com/users/NickLaMuro/received_events","type":"User","site_admin":false},"body":"Built off of:  https://github.com/ManageIQ/manageiq/pull/17473\n\nThis converts the functionality defined in the `virtual_has_one`, `virtual_columns`, and associated methods to a `has_one` and a pair of `virtual_delegates`.\n\nThis allows these columns to also be used in SQL, and removes some of the boilerplate code necessary for the methods that are defined.\n\nThis allows the changes in https://github.com/ManageIQ/manageiq/pull/17474 to then be used on the `Compute -> Infrastructure -> Host` page, among others, and circumvents needing all of the compliance records to be downloaded to get the `last_compliance_status` for those reports.\n\n\nLinks\n-----\n\n* For https://bugzilla.redhat.com/show_bug.cgi?id=1580569\n* Built off of https://github.com/ManageIQ/manageiq/pull/17473\n* Related https://github.com/ManageIQ/manageiq/pull/17474\n* Alternative to https://github.com/ManageIQ/manageiq/pull/17469 and https://github.com/ManageIQ/manageiq-ui-classic/pull/3984\n\n\nSteps for Testing/QA\n--------------------\n\nNeed to build up some seed data, but a before and after with all of these changes in place makes it so that when a large number of compliance reports exists for a small number of hosts (even when it is something like 20...), there isn't a `LEFT JOIN` bomb to build the report data (due to the `.includes`/`.references` calls in `Rbac`).","created_at":"2018-05-23T23:37:30Z","updated_at":"2018-05-23T23:37:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17475/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17475/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/17475/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/adfbfb55d5774adf8f87b2f507b8c2381c12754e","head":{"label":"NickLaMuro:compliance_mixin_last_compliance_to_virtual_delegate","ref":"compliance_mixin_last_compliance_to_virtual_delegate","sha":"adfbfb55d5774adf8f87b2f507b8c2381c12754e","user":{"login":"NickLaMuro","id":314014,"avatar_url":"https://avatars0.githubusercontent.com/u/314014?v=4","gravatar_id":"","url":"https://api.github.com/users/NickLaMuro","html_url":"https://github.com/NickLaMuro","followers_url":"https://api.github.com/users/NickLaMuro/followers","following_url":"https://api.github.com/users/NickLaMuro/following{/other_user}","gists_url":"https://api.github.com/users/NickLaMuro/gists{/gist_id}","starred_url":"https://api.github.com/users/NickLaMuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickLaMuro/subscriptions","organizations_url":"https://api.github.com/users/NickLaMuro/orgs","repos_url":"https://api.github.com/users/NickLaMuro/repos","events_url":"https://api.github.com/users/NickLaMuro/events{/privacy}","received_events_url":"https://api.github.com/users/NickLaMuro/received_events","type":"User","site_admin":false},"repo":{"id":60729101,"name":"manageiq","full_name":"NickLaMuro/manageiq","owner":{"login":"NickLaMuro","id":314014,"avatar_url":"https://avatars0.githubusercontent.com/u/314014?v=4","gravatar_id":"","url":"https://api.github.com/users/NickLaMuro","html_url":"https://github.com/NickLaMuro","followers_url":"https://api.github.com/users/NickLaMuro/followers","following_url":"https://api.github.com/users/NickLaMuro/following{/other_user}","gists_url":"https://api.github.com/users/NickLaMuro/gists{/gist_id}","starred_url":"https://api.github.com/users/NickLaMuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickLaMuro/subscriptions","organizations_url":"https://api.github.com/users/NickLaMuro/orgs","repos_url":"https://api.github.com/users/NickLaMuro/repos","events_url":"https://api.github.com/users/NickLaMuro/events{/privacy}","received_events_url":"https://api.github.com/users/NickLaMuro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NickLaMuro/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/NickLaMuro/manageiq","forks_url":"https://api.github.com/repos/NickLaMuro/manageiq/forks","keys_url":"https://api.github.com/repos/NickLaMuro/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NickLaMuro/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NickLaMuro/manageiq/teams","hooks_url":"https://api.github.com/repos/NickLaMuro/manageiq/hooks","issue_events_url":"https://api.github.com/repos/NickLaMuro/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/NickLaMuro/manageiq/events","assignees_url":"https://api.github.com/repos/NickLaMuro/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/NickLaMuro/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/NickLaMuro/manageiq/tags","blobs_url":"https://api.github.com/repos/NickLaMuro/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NickLaMuro/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NickLaMuro/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/NickLaMuro/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NickLaMuro/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/NickLaMuro/manageiq/languages","stargazers_url":"https://api.github.com/repos/NickLaMuro/manageiq/stargazers","contributors_url":"https://api.github.com/repos/NickLaMuro/manageiq/contributors","subscribers_url":"https://api.github.com/repos/NickLaMuro/manageiq/subscribers","subscription_url":"https://api.github.com/repos/NickLaMuro/manageiq/subscription","commits_url":"https://api.github.com/repos/NickLaMuro/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/NickLaMuro/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/NickLaMuro/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/NickLaMuro/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/NickLaMuro/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/NickLaMuro/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NickLaMuro/manageiq/merges","archive_url":"https://api.github.com/repos/NickLaMuro/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NickLaMuro/manageiq/downloads","issues_url":"https://api.github.com/repos/NickLaMuro/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/NickLaMuro/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/NickLaMuro/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/NickLaMuro/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NickLaMuro/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/NickLaMuro/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/NickLaMuro/manageiq/deployments","created_at":"2016-06-08T20:36:58Z","updated_at":"2018-05-23T19:46:24Z","pushed_at":"2018-05-23T23:31:20Z","git_url":"git://github.com/NickLaMuro/manageiq.git","ssh_url":"git@github.com:NickLaMuro/manageiq.git","clone_url":"https://github.com/NickLaMuro/manageiq.git","svn_url":"https://github.com/NickLaMuro/manageiq","homepage":"manageiq.org","size":245729,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ManageIQ:master","ref":"master","sha":"595a963676639f93245a03186c6bcb427108f502","user":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars0.githubusercontent.com/u/1125575?v=4","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://avatars0.githubusercontent.com/u/1125575?v=4","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":"2018-05-23T15:23:58Z","pushed_at":"2018-05-23T23:25:06Z","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":252794,"stargazers_count":657,"watchers_count":657,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":637,"mirror_url":null,"archived":false,"open_issues_count":602,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":637,"open_issues":602,"watchers":657,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17475"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/17475"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/17475"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/17475/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17475/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17475/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/adfbfb55d5774adf8f87b2f507b8c2381c12754e"}},"author_association":"MEMBER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":2,"additions":30,"deletions":28,"changed_files":2}}
{"actor":{"display_login":"NickLaMuro"}}