-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fix compatibility with Zeitwerk #160
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.
Thanks, @ekohl, I thought this plugin is safe, since #158 didn't show any errors.
Now, just to double check, could you please add a commit to test with theforeman/foreman#10299?
lib/foreman_kubevirt/engine.rb
Outdated
@@ -4,7 +4,7 @@ class Engine < ::Rails::Engine | |||
config.autoload_paths += Dir["#{config.root}/app/models/concerns"] | |||
initializer "foreman_kubevirt.register_plugin", :before => :finisher_hook do |_app| | |||
Foreman::Plugin.register :foreman_kubevirt do |
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.
Just to be aligned with other plugins, we could probably wrap this in app.reloader.to_prepare
block.
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.
Perhaps that also solves the deprecation warning I still saw. Will try
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.
Could you submit that as a change in https://github.com/theforeman/foreman_plugin_template/blob/master/lib/foreman_plugin_template/engine.rb as well?
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.
Perhaps that also solves the deprecation warning I still saw. Will try
That it does.
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.
Could you submit that as a change in https://github.com/theforeman/foreman_plugin_template/blob/master/lib/foreman_plugin_template/engine.rb as well?
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.
Still weird it didn't fail before, but now it at least seems safer. Thanks, @ekohl ! Don't forget to drop the last commit before merge :)
Waiting for #165, marking as draft to be sure. |
@ofedoren does it look good to you? |
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.
Overall LGTM, but just to be more nitpicky:
lib/foreman_kubevirt/engine.rb
Outdated
@@ -2,18 +2,20 @@ module ForemanKubevirt | |||
class Engine < ::Rails::Engine | |||
engine_name "foreman_kubevirt" | |||
config.autoload_paths += Dir["#{config.root}/app/models/concerns"] |
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'd drop this. If an error occurs then we should fix it (there might be uninitialized constant error or something similar). Such paths are already come from Foreman/Rails themselves.
236e913
to
36cd448
Compare
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.
Green and beautiful :)
No description provided.