{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/129598175","pull_request_review_id":52381496,"id":129598175,"diff_hunk":"@@ -0,0 +1,52 @@\n+describe TaskHelpers::Imports::PolicySets do\n+  let(:data_dir)            { File.join(File.expand_path(__dir__), 'data', 'policy_sets') }\n+  let(:policy_set_file)     { 'Policy_Profile_Import_Test.yaml' }\n+  let(:bad_policy_set_file) { 'Bad_Policy_Profile_Import_Test.yml' }\n+  let(:policy_set_one_guid) { \"869d8a1c-eef8-4075-8f10-fb2b4198c20d\" }\n+  let(:policy_set_two_guid) { \"b762f0cb-8a50-4464-8ded-1f1ce341f3a7\" }\n+\n+  it 'should import all .yaml files in a specified directory' do\n+    options = { :source => data_dir }\n+    expect do\n+      TaskHelpers::Imports::PolicySets.new.import(options)\n+    end.to_not output.to_stderr\n+\n+    assert_test_policy_set_one_present\n+    assert_test_policy_set_two_present\n+  end\n+\n+  it 'should import a specified policy set export file' do\n+    options = { :source => \"#{data_dir}/#{policy_set_file}\" }\n+    expect do\n+      TaskHelpers::Imports::PolicySets.new.import(options)\n+    end.to_not output.to_stderr\n+\n+    assert_test_policy_set_one_present\n+    expect(MiqPolicySet.find_by(:guid => policy_set_two_guid)).to be_nil\n+  end\n+\n+  it 'should fail to import a specified policy set file' do\n+    options = { :source => \"#{data_dir}/#{bad_policy_set_file}\" }\n+    expect do\n+      TaskHelpers::Imports::PolicySets.new.import(options)\n+    end.to output.to_stderr\n+  end","path":"spec/lib/task_helpers/imports/policy_sets_spec.rb","position":33,"original_position":33,"commit_id":"2523be90a097199dc41389282198c104c415716c","original_commit_id":"2523be90a097199dc41389282198c104c415716c","user":{"login":"eclarizio","id":164557,"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":"I would say to give this file the same treatment as the other import file.","created_at":"2017-07-26T15:01:25Z","updated_at":"2017-07-26T15:01:42Z","html_url":"https://github.com/ManageIQ/manageiq/pull/15256#discussion_r129598175","pull_request_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/15256","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/129598175"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/15256#discussion_r129598175"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/15256"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/15256","id":123186955,"html_url":"https://github.com/ManageIQ/manageiq/pull/15256","diff_url":"https://github.com/ManageIQ/manageiq/pull/15256.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/15256.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/15256","number":15256,"state":"open","locked":false,"title":"Add rake script to export/import policies and policy profiles","user":{"login":"branic","id":13800082,"avatar_url":"https://avatars3.githubusercontent.com/u/13800082?v=4","gravatar_id":"","url":"https://api.github.com/users/branic","html_url":"https://github.com/branic","followers_url":"https://api.github.com/users/branic/followers","following_url":"https://api.github.com/users/branic/following{/other_user}","gists_url":"https://api.github.com/users/branic/gists{/gist_id}","starred_url":"https://api.github.com/users/branic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/branic/subscriptions","organizations_url":"https://api.github.com/users/branic/orgs","repos_url":"https://api.github.com/users/branic/repos","events_url":"https://api.github.com/users/branic/events{/privacy}","received_events_url":"https://api.github.com/users/branic/received_events","type":"User","site_admin":false},"body":"These rake scripts and classes provide functionality for exporting/importing of the following ManageIQ object types:\r\n\r\n- policies (MiqPolicy)\r\n- policy profiles (MiqPolicySet)\r\n\r\nThis PR uses the framework that was implemented for PR #14126 to export/import other ManageIQ object types.\r\n\r\nThese scripts are based on the [CFME RH Consulting Scripts](https://github.com/rhtconsulting/cfme-rhconsulting-scripts) and are used by Red Hat consultants to enable storing customizations in Git and maintaining customizations between environments (e.g. dev/qa/prod) for an SDLC lifecycle.\r\n\r\n\r\n","created_at":"2017-05-31T03:37:10Z","updated_at":"2017-07-26T15:01:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"91bea500863ca2237a9284aa7e7ca9be882f9211","assignee":{"login":"gmcculloug","id":2591569,"avatar_url":"https://avatars0.githubusercontent.com/u/2591569?v=4","gravatar_id":"","url":"https://api.github.com/users/gmcculloug","html_url":"https://github.com/gmcculloug","followers_url":"https://api.github.com/users/gmcculloug/followers","following_url":"https://api.github.com/users/gmcculloug/following{/other_user}","gists_url":"https://api.github.com/users/gmcculloug/gists{/gist_id}","starred_url":"https://api.github.com/users/gmcculloug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmcculloug/subscriptions","organizations_url":"https://api.github.com/users/gmcculloug/orgs","repos_url":"https://api.github.com/users/gmcculloug/repos","events_url":"https://api.github.com/users/gmcculloug/events{/privacy}","received_events_url":"https://api.github.com/users/gmcculloug/received_events","type":"User","site_admin":false},"assignees":[{"login":"gmcculloug","id":2591569,"avatar_url":"https://avatars0.githubusercontent.com/u/2591569?v=4","gravatar_id":"","url":"https://api.github.com/users/gmcculloug","html_url":"https://github.com/gmcculloug","followers_url":"https://api.github.com/users/gmcculloug/followers","following_url":"https://api.github.com/users/gmcculloug/following{/other_user}","gists_url":"https://api.github.com/users/gmcculloug/gists{/gist_id}","starred_url":"https://api.github.com/users/gmcculloug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmcculloug/subscriptions","organizations_url":"https://api.github.com/users/gmcculloug/orgs","repos_url":"https://api.github.com/users/gmcculloug/repos","events_url":"https://api.github.com/users/gmcculloug/events{/privacy}","received_events_url":"https://api.github.com/users/gmcculloug/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/15256/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/15256/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/15256/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/2523be90a097199dc41389282198c104c415716c","head":{"label":"branic:policy_export_import","ref":"policy_export_import","sha":"2523be90a097199dc41389282198c104c415716c","user":{"login":"branic","id":13800082,"avatar_url":"https://avatars3.githubusercontent.com/u/13800082?v=4","gravatar_id":"","url":"https://api.github.com/users/branic","html_url":"https://github.com/branic","followers_url":"https://api.github.com/users/branic/followers","following_url":"https://api.github.com/users/branic/following{/other_user}","gists_url":"https://api.github.com/users/branic/gists{/gist_id}","starred_url":"https://api.github.com/users/branic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/branic/subscriptions","organizations_url":"https://api.github.com/users/branic/orgs","repos_url":"https://api.github.com/users/branic/repos","events_url":"https://api.github.com/users/branic/events{/privacy}","received_events_url":"https://api.github.com/users/branic/received_events","type":"User","site_admin":false},"repo":{"id":80170369,"name":"manageiq","full_name":"branic/manageiq","owner":{"login":"branic","id":13800082,"avatar_url":"https://avatars3.githubusercontent.com/u/13800082?v=4","gravatar_id":"","url":"https://api.github.com/users/branic","html_url":"https://github.com/branic","followers_url":"https://api.github.com/users/branic/followers","following_url":"https://api.github.com/users/branic/following{/other_user}","gists_url":"https://api.github.com/users/branic/gists{/gist_id}","starred_url":"https://api.github.com/users/branic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/branic/subscriptions","organizations_url":"https://api.github.com/users/branic/orgs","repos_url":"https://api.github.com/users/branic/repos","events_url":"https://api.github.com/users/branic/events{/privacy}","received_events_url":"https://api.github.com/users/branic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/branic/manageiq","description":"ManageIQ Open-Source Management Platform","fork":true,"url":"https://api.github.com/repos/branic/manageiq","forks_url":"https://api.github.com/repos/branic/manageiq/forks","keys_url":"https://api.github.com/repos/branic/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/branic/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/branic/manageiq/teams","hooks_url":"https://api.github.com/repos/branic/manageiq/hooks","issue_events_url":"https://api.github.com/repos/branic/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/branic/manageiq/events","assignees_url":"https://api.github.com/repos/branic/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/branic/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/branic/manageiq/tags","blobs_url":"https://api.github.com/repos/branic/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/branic/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/branic/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/branic/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/branic/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/branic/manageiq/languages","stargazers_url":"https://api.github.com/repos/branic/manageiq/stargazers","contributors_url":"https://api.github.com/repos/branic/manageiq/contributors","subscribers_url":"https://api.github.com/repos/branic/manageiq/subscribers","subscription_url":"https://api.github.com/repos/branic/manageiq/subscription","commits_url":"https://api.github.com/repos/branic/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/branic/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/branic/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/branic/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/branic/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/branic/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/branic/manageiq/merges","archive_url":"https://api.github.com/repos/branic/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/branic/manageiq/downloads","issues_url":"https://api.github.com/repos/branic/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/branic/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/branic/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/branic/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/branic/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/branic/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/branic/manageiq/deployments","created_at":"2017-01-27T00:49:19Z","updated_at":"2017-01-27T00:49:31Z","pushed_at":"2017-05-31T03:58:49Z","git_url":"git://github.com/branic/manageiq.git","ssh_url":"git@github.com:branic/manageiq.git","clone_url":"https://github.com/branic/manageiq.git","svn_url":"https://github.com/branic/manageiq","homepage":"manageiq.org","size":188808,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ManageIQ:master","ref":"master","sha":"7a7350e514d0a06c4ef555486486bbf75aceb74d","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":"2017-07-21T10:59:56Z","pushed_at":"2017-07-26T14:53:00Z","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":205110,"stargazers_count":495,"watchers_count":495,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":493,"mirror_url":null,"open_issues_count":814,"forks":493,"open_issues":814,"watchers":495,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/15256"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/15256"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/15256"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/15256/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/15256/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/15256/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/2523be90a097199dc41389282198c104c415716c"}}}}
{"actor":{"display_login":"eclarizio"}}