{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/4581","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/4581/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/4581/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/4581/events","html_url":"https://github.com/ManageIQ/manageiq/pull/4581","id":108979134,"number":4581,"title":"Fix and speed up Product feature seed and tests","user":{"login":"jrafanie","id":19339,"avatar_url":"https://avatars.githubusercontent.com/u/19339?v=3","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},"labels":[{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/test","name":"test","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-09-29T23:15:30Z","updated_at":"2015-11-06T18:09:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/4581","html_url":"https://github.com/ManageIQ/manageiq/pull/4581","diff_url":"https://github.com/ManageIQ/manageiq/pull/4581.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/4581.patch"},"body":"We have several duplicated identifiers in the `db/fixtures/miq_product_features.yml` when they must be unique.  The seed method will create on the first instance and update on each subsequent instance and the last one in the file always wins.  Since only the last one survives, I chose to delete these \"all but last duplicates\" cc @h-kataria @dclarizio \r\n\r\nTo get this list, I checked manually, but then decided to write a test so we don't accidentally add duplicates again.\r\n\r\nOnce these duplicates were eliminated, I then enhanced the tests to validate the first seed does only creates, a subsequent seed does not make any changes and eliminated some slowness (11 seconds -> 6 locally).\r\n\r\nMiqProductFeature.seed is also a little faster:\r\nInitial seed:            10.6 s -> 10.1 s\r\nSubsequent seed:  8.5 s -> 7.7 s\r\n\r\nFinally, I also removed the unused \"feature\" to seed product features from the non-existing `db/fixtures/miq_product_features` directory.  cc @Fryguy @gtanzillo @dclarizio Please let me know if this was wrong, I can't see this being used."},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/154488778","html_url":"https://github.com/ManageIQ/manageiq/pull/4581#issuecomment-154488778","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/4581","id":154488778,"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":"2015-11-06T18:09:30Z","updated_at":"2015-11-06T18:09:30Z","body":"<rubocop />Checked commits https://github.com/jrafanie/manageiq/compare/3981e7dab77eed1bc668ca7bbd489be5fb0a044a~...221fd6b1f7304fe7e0838e67ec697adc1a0a550a with ruby 1.9.3, rubocop 0.34.2, and haml-lint 0.13.0\n3 files checked, 3 offenses detected\n\n**app/models/miq_product_feature.rb**\n- [ ] :small_blue_diamond: - [Line 81](https://github.com/jrafanie/manageiq/blob/221fd6b1f7304fe7e0838e67ec697adc1a0a550a/app/models/miq_product_feature.rb#L81), Col 3 - [Metrics/AbcSize](http://rubydoc.info/gems/rubocop/0.34.2/RuboCop/Cop/Metrics/AbcSize) - Assignment Branch Condition size for seed_features is too high. [22.58/15]\n- [ ] :small_blue_diamond: - [Line 113](https://github.com/jrafanie/manageiq/blob/221fd6b1f7304fe7e0838e67ec697adc1a0a550a/app/models/miq_product_feature.rb#L113), Col 3 - [Metrics/AbcSize](http://rubydoc.info/gems/rubocop/0.34.2/RuboCop/Cop/Metrics/AbcSize) - Assignment Branch Condition size for seed_feature is too high. [18.92/15]\n- [ ] :small_blue_diamond: - [Line 136](https://github.com/jrafanie/manageiq/blob/221fd6b1f7304fe7e0838e67ec697adc1a0a550a/app/models/miq_product_feature.rb#L136), Col 121 - [Metrics/LineLength](http://rubydoc.info/gems/rubocop/0.34.2/RuboCop/Cop/Metrics/LineLength) - Line is too long. [164/120]\n"}}