theforeman / foreman_rh_cloud

a plugin to Foreman that generates and uploads reports to the Red Hat cloud
GNU General Public License v3.0
6 stars 32 forks source link

Fix uninitialized constant ForemanRhCloud::VERSION #915

Closed stejskalleos closed 4 weeks ago

stejskalleos commented 1 month ago

Workflows:

stejskalleos commented 1 month ago

@ofedoren

ofedoren commented 1 month ago

Thanks, @stejskalleos, that could do it. We could also try to do it future-proof: since we already remove that constant from Zeitwerk loader, we can explicitly require it in the same initializer, so we don't need to require it in each file that potentially uses that constant. In https://github.com/theforeman/foreman_rh_cloud/blob/develop/config/initializers/zeitwerk.rb:

require 'foreman_rh_cloud/version'

Rails.autoloaders.main.ignore(
  ForemanRhCloud::Engine.root.join('lib/foreman_rh_cloud/version.rb')
)
jeremylenz commented 1 month ago

I've also been getting some problems in foreman_theme_satellite with Rails.autoloaders.main.ignore - apparently main doesn't exist sometimes?

ofedoren commented 1 month ago

I've also been getting some problems in foreman_theme_satellite with Rails.autoloaders.main.ignore - apparently main doesn't exist sometimes?

AFAIU, .main comes with Zeitwerk. Before that I think it was .autoloaders.each for Rails' ones?