{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/pulls/comments/232053774","pull_request_review_id":173163069,"id":232053774,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjA1Mzc3NA==","diff_hunk":"@@ -0,0 +1,44 @@\n+describe ServicePlan do\n+  describe \"#order\" do\n+    let(:service_plan) do\n+      described_class.new(:id               => 456,\n+                          :source           => source,\n+                          :tenant           => tenant,\n+                          :name             => \"plan_name\",\n+                          :service_offering => service_offering)\n+    end\n+    let(:source) { Source.new(:id => 654) }","path":"spec/models/service_plan_spec.rb","position":10,"original_position":10,"commit_id":"7ecd31a9de3fb4bd24b0dc2575e708057de2b9a7","original_commit_id":"7ecd31a9de3fb4bd24b0dc2575e708057de2b9a7","user":{"login":"agrare","id":12851112,"node_id":"MDQ6VXNlcjEyODUxMTEy","avatar_url":"https://avatars2.githubusercontent.com/u/12851112?v=4","gravatar_id":"","url":"https://api.github.com/users/agrare","html_url":"https://github.com/agrare","followers_url":"https://api.github.com/users/agrare/followers","following_url":"https://api.github.com/users/agrare/following{/other_user}","gists_url":"https://api.github.com/users/agrare/gists{/gist_id}","starred_url":"https://api.github.com/users/agrare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrare/subscriptions","organizations_url":"https://api.github.com/users/agrare/orgs","repos_url":"https://api.github.com/users/agrare/repos","events_url":"https://api.github.com/users/agrare/events{/privacy}","received_events_url":"https://api.github.com/users/agrare/received_events","type":"User","site_admin":false},"body":"Same here can just be `Source.create!(:tenant => tenant)`","created_at":"2018-11-08T20:43:34Z","updated_at":"2018-11-08T20:43:34Z","html_url":"https://github.com/ManageIQ/topological_inventory-core/pull/39#discussion_r232053774","pull_request_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/pulls/39","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/topological_inventory-core/pulls/comments/232053774"},"html":{"href":"https://github.com/ManageIQ/topological_inventory-core/pull/39#discussion_r232053774"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/topological_inventory-core/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/pulls/39","id":227767255,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3NzY3MjU1","html_url":"https://github.com/ManageIQ/topological_inventory-core/pull/39","diff_url":"https://github.com/ManageIQ/topological_inventory-core/pull/39.diff","patch_url":"https://github.com/ManageIQ/topological_inventory-core/pull/39.patch","issue_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/issues/39","number":39,"state":"open","locked":false,"title":"[WIP] Add ServicePlan#order and relevant external api changes","user":{"login":"eclarizio","id":164557,"node_id":"MDQ6VXNlcjE2NDU1Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/164557?v=4","gravatar_id":"","url":"https://api.github.com/users/eclarizio","html_url":"https://github.com/eclarizio","followers_url":"https://api.github.com/users/eclarizio/followers","following_url":"https://api.github.com/users/eclarizio/following{/other_user}","gists_url":"https://api.github.com/users/eclarizio/gists{/gist_id}","starred_url":"https://api.github.com/users/eclarizio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclarizio/subscriptions","organizations_url":"https://api.github.com/users/eclarizio/orgs","repos_url":"https://api.github.com/users/eclarizio/repos","events_url":"https://api.github.com/users/eclarizio/events{/privacy}","received_events_url":"https://api.github.com/users/eclarizio/received_events","type":"User","site_admin":false},"body":"This PR basically moves over code from https://github.com/ManageIQ/service_portal-api/blob/master/app/models/provider.rb#L95 to this repo onto the `ServicePlan` model.\r\n\r\nA couple things I think I need some guidance on, since I mostly just moved over the code and refactored:\r\n\r\n`service_plan#order` currently is returning `<some_parsed_external_data>['metadata']['selfLink']`. I think the original discussion was centered around wanting to return a `task_id` even if right now we're doing that task inline. So, this line will likely need to change but I'm not sure how. I don't think I know enough about what an actual response from the external api looks like or how we plan on delegating the work to a task.\r\n\r\nSome of the variables in the new `ExternalApiBroker` (which we can discuss about the name, I just threw something together) are not correct or I guessed at. For example, the `verify_ssl` option is an attribute on the `Provider` class back in the service portal API, but I don't know if we have an equivalent here, so I simply hardcoded it to `true`. Same thing goes for the `token` attribute, as well as the `url` attribute, which I've just set as a placeholder here in `base_url`. Are these available as things the `ServicePlan` would know about somehow through a related object that I can pass in, or something else?\r\n\r\n@agrare @gtanzillo @bdunne Can you guys review and advise on my questions above? Thanks!\r\n\r\n@agrare I tried to separate the external API stuff too to make it a bit easier to change to kubeclient instead of RestClient. Hope that helps a bit at least 😄 ","created_at":"2018-11-01T21:35:06Z","updated_at":"2018-11-08T20:43:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d37ccd0f7fa584cb9f81c83dabaca404da7794b6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/pulls/39/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/pulls/39/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/issues/39/comments","statuses_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/statuses/7ecd31a9de3fb4bd24b0dc2575e708057de2b9a7","head":{"label":"eclarizio:service_plan_ordering","ref":"service_plan_ordering","sha":"7ecd31a9de3fb4bd24b0dc2575e708057de2b9a7","user":{"login":"eclarizio","id":164557,"node_id":"MDQ6VXNlcjE2NDU1Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/164557?v=4","gravatar_id":"","url":"https://api.github.com/users/eclarizio","html_url":"https://github.com/eclarizio","followers_url":"https://api.github.com/users/eclarizio/followers","following_url":"https://api.github.com/users/eclarizio/following{/other_user}","gists_url":"https://api.github.com/users/eclarizio/gists{/gist_id}","starred_url":"https://api.github.com/users/eclarizio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclarizio/subscriptions","organizations_url":"https://api.github.com/users/eclarizio/orgs","repos_url":"https://api.github.com/users/eclarizio/repos","events_url":"https://api.github.com/users/eclarizio/events{/privacy}","received_events_url":"https://api.github.com/users/eclarizio/received_events","type":"User","site_admin":false},"repo":{"id":155776439,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU3NzY0Mzk=","name":"topological_inventory-core","full_name":"eclarizio/topological_inventory-core","private":false,"owner":{"login":"eclarizio","id":164557,"node_id":"MDQ6VXNlcjE2NDU1Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/164557?v=4","gravatar_id":"","url":"https://api.github.com/users/eclarizio","html_url":"https://github.com/eclarizio","followers_url":"https://api.github.com/users/eclarizio/followers","following_url":"https://api.github.com/users/eclarizio/following{/other_user}","gists_url":"https://api.github.com/users/eclarizio/gists{/gist_id}","starred_url":"https://api.github.com/users/eclarizio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclarizio/subscriptions","organizations_url":"https://api.github.com/users/eclarizio/orgs","repos_url":"https://api.github.com/users/eclarizio/repos","events_url":"https://api.github.com/users/eclarizio/events{/privacy}","received_events_url":"https://api.github.com/users/eclarizio/received_events","type":"User","site_admin":false},"html_url":"https://github.com/eclarizio/topological_inventory-core","description":null,"fork":true,"url":"https://api.github.com/repos/eclarizio/topological_inventory-core","forks_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/forks","keys_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/teams","hooks_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/hooks","issue_events_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/issues/events{/number}","events_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/events","assignees_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/assignees{/user}","branches_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/branches{/branch}","tags_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/tags","blobs_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/statuses/{sha}","languages_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/languages","stargazers_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/stargazers","contributors_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/contributors","subscribers_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/subscribers","subscription_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/subscription","commits_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/contents/{+path}","compare_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/merges","archive_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/downloads","issues_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/issues{/number}","pulls_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/pulls{/number}","milestones_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/milestones{/number}","notifications_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/labels{/name}","releases_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/releases{/id}","deployments_url":"https://api.github.com/repos/eclarizio/topological_inventory-core/deployments","created_at":"2018-11-01T21:12:07Z","updated_at":"2018-11-01T21:12:09Z","pushed_at":"2018-11-08T20:33:45Z","git_url":"git://github.com/eclarizio/topological_inventory-core.git","ssh_url":"git@github.com:eclarizio/topological_inventory-core.git","clone_url":"https://github.com/eclarizio/topological_inventory-core.git","svn_url":"https://github.com/eclarizio/topological_inventory-core","homepage":null,"size":214,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ManageIQ:master","ref":"master","sha":"6983393cd36e1f5c920e359b0c9ac96a71541888","user":{"login":"ManageIQ","id":1125575,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMjU1NzU=","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":149643737,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk2NDM3Mzc=","name":"topological_inventory-core","full_name":"ManageIQ/topological_inventory-core","private":false,"owner":{"login":"ManageIQ","id":1125575,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMjU1NzU=","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},"html_url":"https://github.com/ManageIQ/topological_inventory-core","description":null,"fork":false,"url":"https://api.github.com/repos/ManageIQ/topological_inventory-core","forks_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/forks","keys_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/teams","hooks_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/hooks","issue_events_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/issues/events{/number}","events_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/events","assignees_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/assignees{/user}","branches_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/branches{/branch}","tags_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/tags","blobs_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/statuses/{sha}","languages_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/languages","stargazers_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/stargazers","contributors_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/contributors","subscribers_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/subscribers","subscription_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/subscription","commits_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/contents/{+path}","compare_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/merges","archive_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/downloads","issues_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/issues{/number}","pulls_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/pulls{/number}","milestones_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/milestones{/number}","notifications_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/labels{/name}","releases_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/releases{/id}","deployments_url":"https://api.github.com/repos/ManageIQ/topological_inventory-core/deployments","created_at":"2018-09-20T17:10:19Z","updated_at":"2018-11-08T16:11:16Z","pushed_at":"2018-11-08T20:33:47Z","git_url":"git://github.com/ManageIQ/topological_inventory-core.git","ssh_url":"git@github.com:ManageIQ/topological_inventory-core.git","clone_url":"https://github.com/ManageIQ/topological_inventory-core.git","svn_url":"https://github.com/ManageIQ/topological_inventory-core","homepage":null,"size":206,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":2,"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":8,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/topological_inventory-core/pulls/39"},"html":{"href":"https://github.com/ManageIQ/topological_inventory-core/pull/39"},"issue":{"href":"https://api.github.com/repos/ManageIQ/topological_inventory-core/issues/39"},"comments":{"href":"https://api.github.com/repos/ManageIQ/topological_inventory-core/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/topological_inventory-core/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/topological_inventory-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/topological_inventory-core/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/topological_inventory-core/statuses/7ecd31a9de3fb4bd24b0dc2575e708057de2b9a7"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"agrare"}}