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 uninitialized constant ForemanRhCloud::VERSION #915

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

stejskalleos
Copy link
Contributor

Workflows:

  • insights client registration
  • rh_cloud_inventory:report:generate task

@stejskalleos
Copy link
Contributor Author

@ofedoren

@ofedoren
Copy link
Member

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')
)

Copy link
Member

@chris1984 chris1984 left a comment

Choose a reason for hiding this comment

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

I like @ofedoren method so we don't have to include it in each file, @stejskalleos can you update the pr and we can test

@jeremylenz
Copy link
Collaborator

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

@ofedoren
Copy link
Member

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?

Workflows:
- insights client registration
- rh_cloud_inventory:report:generate task
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, @stejskalleos, seems to fix the issue

Copy link
Member

@chris1984 chris1984 left a comment

Choose a reason for hiding this comment

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

Thanks @stejskalleos

@chris1984 chris1984 merged commit 50445de into theforeman:develop Oct 25, 2024
19 checks passed
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.

4 participants