Skip to content

Fixes #38446 - Move plugin registration to own file#975

Merged
adamruzicka merged 2 commits into
theforeman:masterfrom
jturel:engine_plugin_register
Jul 7, 2025
Merged

Fixes #38446 - Move plugin registration to own file#975
adamruzicka merged 2 commits into
theforeman:masterfrom
jturel:engine_plugin_register

Conversation

@jturel

@jturel jturel commented Jun 4, 2025

Copy link
Copy Markdown
Contributor

Continuation of work started in #973 to fix code reloading.

The plugin registration calls into a lot of application code. This seems to be the least intrusive way to achieve parity but without registration happening again on each code reload

# e.g. having ProvisioningTemplate < Template, adding has_many :template_inputs to Template from concern
# Template.reflect_on_association :template_inputs # => <#Association...
# ProvisioningTemplate.reflect_on_association :template_inputs # => nil
require_dependency 'job_template'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Was this never needed or is it not needed anymore?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added JobTemplate directly in the array below. I think that's correct and the intention of this method call

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Now I wonder, if we're in REX, why do we jump through hoops to load the extension into JobTemplate dynamically, but that's probably a thing for another time

Comment thread lib/foreman_remote_execution/engine.rb
@jturel
jturel force-pushed the engine_plugin_register branch from 558d675 to 7dbd8ff Compare June 29, 2025 21:31
@adamruzicka
adamruzicka merged commit 04c34a0 into theforeman:master Jul 7, 2025
16 checks passed
@adamruzicka

Copy link
Copy Markdown
Contributor

Thank you @jturel !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants