{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/9738","repository_url":"https://api.github.com/repos/ManageIQ/manageiq","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/9738/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/9738/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/9738/events","html_url":"https://github.com/ManageIQ/manageiq/pull/9738","id":164960871,"number":9738,"title":"[WIP] Extract class API::Initializer","user":{"login":"imtayadeway","id":1710874,"avatar_url":"https://avatars.githubusercontent.com/u/1710874?v=3","gravatar_id":"","url":"https://api.github.com/users/imtayadeway","html_url":"https://github.com/imtayadeway","followers_url":"https://api.github.com/users/imtayadeway/followers","following_url":"https://api.github.com/users/imtayadeway/following{/other_user}","gists_url":"https://api.github.com/users/imtayadeway/gists{/gist_id}","starred_url":"https://api.github.com/users/imtayadeway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imtayadeway/subscriptions","organizations_url":"https://api.github.com/users/imtayadeway/orgs","repos_url":"https://api.github.com/users/imtayadeway/repos","events_url":"https://api.github.com/users/imtayadeway/events{/privacy}","received_events_url":"https://api.github.com/users/imtayadeway/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/api","name":"api","color":"5319e7"},{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/refactoring","name":"refactoring","color":"fbca04"},{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/wip","name":"wip","color":"eeeeee"}],"state":"open","locked":false,"assignee":{"login":"abellotti","id":5797328,"avatar_url":"https://avatars.githubusercontent.com/u/5797328?v=3","gravatar_id":"","url":"https://api.github.com/users/abellotti","html_url":"https://github.com/abellotti","followers_url":"https://api.github.com/users/abellotti/followers","following_url":"https://api.github.com/users/abellotti/following{/other_user}","gists_url":"https://api.github.com/users/abellotti/gists{/gist_id}","starred_url":"https://api.github.com/users/abellotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abellotti/subscriptions","organizations_url":"https://api.github.com/users/abellotti/orgs","repos_url":"https://api.github.com/users/abellotti/repos","events_url":"https://api.github.com/users/abellotti/events{/privacy}","received_events_url":"https://api.github.com/users/abellotti/received_events","type":"User","site_admin":false},"assignees":[{"login":"abellotti","id":5797328,"avatar_url":"https://avatars.githubusercontent.com/u/5797328?v=3","gravatar_id":"","url":"https://api.github.com/users/abellotti","html_url":"https://github.com/abellotti","followers_url":"https://api.github.com/users/abellotti/followers","following_url":"https://api.github.com/users/abellotti/following{/other_user}","gists_url":"https://api.github.com/users/abellotti/gists{/gist_id}","starred_url":"https://api.github.com/users/abellotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abellotti/subscriptions","organizations_url":"https://api.github.com/users/abellotti/orgs","repos_url":"https://api.github.com/users/abellotti/repos","events_url":"https://api.github.com/users/abellotti/events{/privacy}","received_events_url":"https://api.github.com/users/abellotti/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-07-11T23:17:51Z","updated_at":"2016-07-27T23:36:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/9738","html_url":"https://github.com/ManageIQ/manageiq/pull/9738","diff_url":"https://github.com/ManageIQ/manageiq/pull/9738.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/9738.patch"},"body":"Purpose or Intent\r\n-----------------\r\nThe stuff we do in the initializer module under the Api controller currently doesn't play well with an object oriented model - the data isn't shared down into subclasses. Rather than try to maintain them as class variables (where they would be), I've opted to break out the initializer from the controller instead. The benefits:\r\n\r\n* the data it generates is encapsulated and can be accessed from anywhere.\r\n* this makes room for the Api to be more flexible about when it initializes, which is fairly expensive\r\n\r\n@jrafanie I think this will address part of the issue we saw last week where we wanted to defer loading of `ATTR_TYPES`, which accounted for the most of the performance regression when running `rake routes`. It is still loaded with `ApiController` as it stands but this could be deferred to some arbitrary point up to and including the first request made.\r\n\r\nThis is a fairly big PR - I'm happy to break it up into smaller ones if it's easier to review. The essential part (moving the data out of the Api controller) is currently blocking me from making objected oriented Api controllers.\r\n\r\nSteps for Testing/QA\r\n--------------------\r\nThe tests should be sufficient, and/or sending some requests to the server in development\r\n\r\n@miq-bot add-label api, refactoring\r\n@miq-bot assign @abellotti \r\n"},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/235753846","html_url":"https://github.com/ManageIQ/manageiq/pull/9738#issuecomment-235753846","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/9738","id":235753846,"user":{"login":"miq-bot","id":7806257,"avatar_url":"https://avatars.githubusercontent.com/u/7806257?v=3","gravatar_id":"","url":"https://api.github.com/users/miq-bot","html_url":"https://github.com/miq-bot","followers_url":"https://api.github.com/users/miq-bot/followers","following_url":"https://api.github.com/users/miq-bot/following{/other_user}","gists_url":"https://api.github.com/users/miq-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/miq-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miq-bot/subscriptions","organizations_url":"https://api.github.com/users/miq-bot/orgs","repos_url":"https://api.github.com/users/miq-bot/repos","events_url":"https://api.github.com/users/miq-bot/events{/privacy}","received_events_url":"https://api.github.com/users/miq-bot/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T23:36:38Z","updated_at":"2016-07-27T23:36:38Z","body":"<rubocop />Checked commits https://github.com/imtayadeway/manageiq/compare/c57879cafb95e25c5c470c2ba423e1c28f9c2753~...2f000c828e7f1afde17a97c0725faa139b426844 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1\n5 files checked, 0 offenses detected\nEverything looks good. :star:\n"}}
{"actor":{"display_login":"miq-bot"}}