{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/194083366","pull_request_review_id":127194227,"id":194083366,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDA4MzM2Ng==","diff_hunk":"@@ -0,0 +1,30 @@\n+describe CustomizationTemplate do\n+  context \"unique name validation\" do\n+    let(:pxe_image_type)                { FactoryGirl.create(:pxe_image_type) }\n+    let(:customization_template)        { FactoryGirl.create(:customization_template, :pxe_image_type => pxe_image_type) }\n+    let(:system_customization_template) { described_class.create!(:system => true, :name => \"nick\") }\n+\n+    it \"doesn't allow same name in same region\" do\n+      FactoryGirl.create(:customization_template, :name => \"fred\")\n+      expect { FactoryGirl.create(:customization_template, :name => \"fred\") }.to raise_error(ActiveRecord::RecordInvalid)\n+    end\n+\n+    it \"allows different names with the same pxe_image_type in same region\" do\n+      FactoryGirl.create(:customization_template, :name => \"fred\", :pxe_image_type => pxe_image_type)\n+      FactoryGirl.create(:customization_template, :name => \"nick\", :pxe_image_type => pxe_image_type)\n+      expect(described_class.count).to eq(2)\n+    end\n+\n+    it \"allow same name, nil pxe_image_types in different regions (for system seeding)\" do\n+      ctid = ApplicationRecord.id_in_region(system_customization_template.id, ApplicationRecord.my_region_number + 1)\n+      expect { described_class.create!(:system => true, :name => \"nick\", :id => ctid) }.to change(described_class, :count).by(1)\n+    end\n+\n+    it \"allows same name, different pxe_image_types in different regions\" do\n+      pid =  ApplicationRecord.id_in_region(pxe_image_type.id, MiqRegion.my_region_number + 1)\n+      ctid = ApplicationRecord.id_in_region(customization_template.id, MiqRegion.my_region_number + 1)\n+      pt2 =  FactoryGirl.create(:pxe_image_type, :id => pid)\n+      expect { FactoryGirl.create(:customization_template, :pxe_image_type => pt2, :id => ctid) }.to change(described_class, :count).by(1)","path":"spec/models/customization_template_spec.rb","position":27,"original_position":27,"commit_id":"b7fd5d88ce0c9cbb35c6d5065cb38d05ff0df32a","original_commit_id":"b7fd5d88ce0c9cbb35c6d5065cb38d05ff0df32a","user":{"login":"jrafanie","id":19339,"node_id":"MDQ6VXNlcjE5MzM5","avatar_url":"https://avatars0.githubusercontent.com/u/19339?v=4","gravatar_id":"","url":"https://api.github.com/users/jrafanie","html_url":"https://github.com/jrafanie","followers_url":"https://api.github.com/users/jrafanie/followers","following_url":"https://api.github.com/users/jrafanie/following{/other_user}","gists_url":"https://api.github.com/users/jrafanie/gists{/gist_id}","starred_url":"https://api.github.com/users/jrafanie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrafanie/subscriptions","organizations_url":"https://api.github.com/users/jrafanie/orgs","repos_url":"https://api.github.com/users/jrafanie/repos","events_url":"https://api.github.com/users/jrafanie/events{/privacy}","received_events_url":"https://api.github.com/users/jrafanie/received_events","type":"User","site_admin":false},"body":"Interesting, let me see if the test fails if I check that correctly.  Good 👀 ","created_at":"2018-06-08T14:52:50Z","updated_at":"2018-06-08T14:52:50Z","html_url":"https://github.com/ManageIQ/manageiq/pull/17544#discussion_r194083366","pull_request_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17544","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/194083366"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/17544#discussion_r194083366"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17544"}},"in_reply_to_id":194048493},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17544","id":193150943,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzMTUwOTQz","html_url":"https://github.com/ManageIQ/manageiq/pull/17544","diff_url":"https://github.com/ManageIQ/manageiq/pull/17544.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/17544.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/17544","number":17544,"state":"open","locked":false,"title":"Allow non-unique nil pxe_image_types during seed (for the current region)","user":{"login":"bdunne","id":651659,"node_id":"MDQ6VXNlcjY1MTY1OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/651659?v=4","gravatar_id":"","url":"https://api.github.com/users/bdunne","html_url":"https://github.com/bdunne","followers_url":"https://api.github.com/users/bdunne/followers","following_url":"https://api.github.com/users/bdunne/following{/other_user}","gists_url":"https://api.github.com/users/bdunne/gists{/gist_id}","starred_url":"https://api.github.com/users/bdunne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdunne/subscriptions","organizations_url":"https://api.github.com/users/bdunne/orgs","repos_url":"https://api.github.com/users/bdunne/repos","events_url":"https://api.github.com/users/bdunne/events{/privacy}","received_events_url":"https://api.github.com/users/bdunne/received_events","type":"User","site_admin":false},"body":"@jrafanie @carbonin Please review\r\n\r\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1588417\r\n\r\nWe want to disallow the same name template in different regions with the\r\nsame pxe_image_type.  Normally, region id sequences prevent this from\r\nhappening but we were treating nil pxe_image_types as the same.\r\nTherefore you could have the \"same\" pxe_image_type in different regions\r\nfor the same name template.\r\n\r\n","created_at":"2018-06-06T21:51:20Z","updated_at":"2018-06-08T14:52:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a50e5e347b55dc0bafebad61c3852cd4899431b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":106615676,"node_id":"MDU6TGFiZWwxMDY2MTU2NzY=","url":"https://api.github.com/repos/ManageIQ/manageiq/labels/bug","name":"bug","color":"ee0701","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17544/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17544/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/17544/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/b7fd5d88ce0c9cbb35c6d5065cb38d05ff0df32a","head":{"label":"bdunne:scope_seeding","ref":"scope_seeding","sha":"b7fd5d88ce0c9cbb35c6d5065cb38d05ff0df32a","user":{"login":"bdunne","id":651659,"node_id":"MDQ6VXNlcjY1MTY1OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/651659?v=4","gravatar_id":"","url":"https://api.github.com/users/bdunne","html_url":"https://github.com/bdunne","followers_url":"https://api.github.com/users/bdunne/followers","following_url":"https://api.github.com/users/bdunne/following{/other_user}","gists_url":"https://api.github.com/users/bdunne/gists{/gist_id}","starred_url":"https://api.github.com/users/bdunne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdunne/subscriptions","organizations_url":"https://api.github.com/users/bdunne/orgs","repos_url":"https://api.github.com/users/bdunne/repos","events_url":"https://api.github.com/users/bdunne/events{/privacy}","received_events_url":"https://api.github.com/users/bdunne/received_events","type":"User","site_admin":false},"repo":{"id":20791794,"node_id":"MDEwOlJlcG9zaXRvcnkyMDc5MTc5NA==","name":"manageiq","full_name":"bdunne/manageiq","owner":{"login":"bdunne","id":651659,"node_id":"MDQ6VXNlcjY1MTY1OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/651659?v=4","gravatar_id":"","url":"https://api.github.com/users/bdunne","html_url":"https://github.com/bdunne","followers_url":"https://api.github.com/users/bdunne/followers","following_url":"https://api.github.com/users/bdunne/following{/other_user}","gists_url":"https://api.github.com/users/bdunne/gists{/gist_id}","starred_url":"https://api.github.com/users/bdunne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdunne/subscriptions","organizations_url":"https://api.github.com/users/bdunne/orgs","repos_url":"https://api.github.com/users/bdunne/repos","events_url":"https://api.github.com/users/bdunne/events{/privacy}","received_events_url":"https://api.github.com/users/bdunne/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bdunne/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/bdunne/manageiq","forks_url":"https://api.github.com/repos/bdunne/manageiq/forks","keys_url":"https://api.github.com/repos/bdunne/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bdunne/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bdunne/manageiq/teams","hooks_url":"https://api.github.com/repos/bdunne/manageiq/hooks","issue_events_url":"https://api.github.com/repos/bdunne/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/bdunne/manageiq/events","assignees_url":"https://api.github.com/repos/bdunne/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/bdunne/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/bdunne/manageiq/tags","blobs_url":"https://api.github.com/repos/bdunne/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bdunne/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bdunne/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/bdunne/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bdunne/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/bdunne/manageiq/languages","stargazers_url":"https://api.github.com/repos/bdunne/manageiq/stargazers","contributors_url":"https://api.github.com/repos/bdunne/manageiq/contributors","subscribers_url":"https://api.github.com/repos/bdunne/manageiq/subscribers","subscription_url":"https://api.github.com/repos/bdunne/manageiq/subscription","commits_url":"https://api.github.com/repos/bdunne/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/bdunne/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/bdunne/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/bdunne/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/bdunne/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/bdunne/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bdunne/manageiq/merges","archive_url":"https://api.github.com/repos/bdunne/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bdunne/manageiq/downloads","issues_url":"https://api.github.com/repos/bdunne/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/bdunne/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/bdunne/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/bdunne/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bdunne/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/bdunne/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/bdunne/manageiq/deployments","created_at":"2014-06-13T04:12:55Z","updated_at":"2015-02-25T15:20:17Z","pushed_at":"2018-06-08T13:23:30Z","git_url":"git://github.com/bdunne/manageiq.git","ssh_url":"git@github.com:bdunne/manageiq.git","clone_url":"https://github.com/bdunne/manageiq.git","svn_url":"https://github.com/bdunne/manageiq","homepage":null,"size":209031,"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,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ManageIQ:master","ref":"master","sha":"0bd16abcf9bbf9eb0a7d7a906a678454ed1c380f","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":20789757,"node_id":"MDEwOlJlcG9zaXRvcnkyMDc4OTc1Nw==","name":"manageiq","full_name":"ManageIQ/manageiq","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},"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-06-08T13:34:23Z","pushed_at":"2018-06-08T14:48:07Z","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":253790,"stargazers_count":662,"watchers_count":662,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":638,"mirror_url":null,"archived":false,"open_issues_count":605,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":638,"open_issues":605,"watchers":662,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17544"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/17544"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/17544"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/17544/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17544/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17544/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/b7fd5d88ce0c9cbb35c6d5065cb38d05ff0df32a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jrafanie"}}