-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow seeding of dialogs from plugins #14668
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Code looks good, would you mind adding a test?
oh, those tests.... I'll add some just for you 🌹 :) |
@bdunne there you go. I had to refactor it a bit for the better and for better testability. I could also remove the |
spec/models/dialog_spec.rb
Outdated
expect(dialog_import_service).to receive(:import_all_service_dialogs_from_yaml_file).with( | ||
Rails.root.join(test_file_path, "seed_test.yaml").to_path | ||
) | ||
described_class.seed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should also expect(Dir).to receive(:glob).with(the path for the engine dialogs)
. The expect
above it true, but it's not related to the plugin part of the code.
@bdunne I set |
I could not resist and changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Changes look good, can you take care of the rubocop indentation comments?
doh, what happened to my pre commit hook... |
@@ -1,8 +1,9 @@ | |||
class Dialog < ApplicationRecord | |||
DIALOG_DIR = Rails.root.join("product/dialogs/service_dialogs") | |||
DIALOG_DIR_CORE = 'product/dialogs/service_dialogs'.freeze | |||
DIALOG_DIR_PLUGIN = 'content/service_dialogs'.freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we should just create a content/service_dialogs directory in manageiq proper, so the directories are consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can drop the DIALOG_DIR_CORE
logic once all dialogs have been moved to provider pugins or manageiq-content
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean move all from product/dialogs/service_dialogs
to content/service_dialogs
?
addressed all rubocop issues |
Checked commits durandom/manageiq@8b28480~...833f76d with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
I assume this is good to go? |
follows the same approach as in #14653
@miq-bot assign @bdunne
@miq-bot add_label enhancement, pluggable providers
are there many more file seeds of that kind that should be allowed to be seeded from plugins?
if so, we might group the seeding somewhere under
Vmdb::Plugins
- like you did withautomate_domain
.I'm just not sure, if we can hook nicely into the seeding process. Also, to have classes seeded only in the class (and not from an external location like plugins) has its upsides too