Skip to content
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

Merged
merged 2 commits into from
Dec 10, 2024
Merged

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Dec 4, 2024

No description provided.

Copy link
Member

@ofedoren ofedoren left a 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?

@@ -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
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekohl ekohl mentioned this pull request Dec 5, 2024
@ekohl
Copy link
Member Author

ekohl commented Dec 5, 2024

It's green both with and without:
image

Copy link
Member

@ofedoren ofedoren left a 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 :)

@ekohl ekohl marked this pull request as draft December 6, 2024 12:48
@ekohl
Copy link
Member Author

ekohl commented Dec 6, 2024

Waiting for #165, marking as draft to be sure.

@ekohl ekohl marked this pull request as ready for review December 6, 2024 15:05
@ekohl
Copy link
Member Author

ekohl commented Dec 10, 2024

@ofedoren does it look good to you?

Copy link
Member

@ofedoren ofedoren left a 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:

@@ -2,18 +2,20 @@ module ForemanKubevirt
class Engine < ::Rails::Engine
engine_name "foreman_kubevirt"
config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
Copy link
Member

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.

Copy link
Member

@ofedoren ofedoren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Green and beautiful :)

@ekohl ekohl merged commit bf45efa into theforeman:master Dec 10, 2024
21 checks passed
@ekohl ekohl deleted the rails-7-compat branch December 10, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants