Skip to content

Add Zeitwerk loader support#62

Merged
evgeni merged 1 commit intoRedHatSatellite:developfrom
ofedoren:feat-support-zeitwerk
Sep 11, 2024
Merged

Add Zeitwerk loader support#62
evgeni merged 1 commit intoRedHatSatellite:developfrom
ofedoren:feat-support-zeitwerk

Conversation

@ofedoren
Copy link
Copy Markdown
Contributor

No description provided.

@ofedoren ofedoren force-pushed the feat-support-zeitwerk branch 2 times, most recently from 2473158 to 03110b9 Compare August 1, 2024 11:43
@ofedoren ofedoren force-pushed the feat-support-zeitwerk branch 2 times, most recently from e19c1f4 to 298925e Compare September 3, 2024 14:10
@evgeni evgeni force-pushed the feat-support-zeitwerk branch from 298925e to ae70164 Compare September 10, 2024 13:31
Comment thread lib/foreman_theme_satellite/engine.rb
@evgeni evgeni force-pushed the feat-support-zeitwerk branch from ae70164 to 5399608 Compare September 10, 2024 13:44
@evgeni
Copy link
Copy Markdown
Member

evgeni commented Sep 10, 2024

Any idea why the link test now fails?

@ofedoren
Copy link
Copy Markdown
Contributor Author

Isn't this because something wasn't updated for the tests? Like #70

@evgeni
Copy link
Copy Markdown
Member

evgeni commented Sep 10, 2024

No

@ekohl
Copy link
Copy Markdown
Contributor

ekohl commented Sep 10, 2024

 NoMethodError: undefined method `empty?' for nil:NilClass
/home/runner/work/foreman_theme_satellite/foreman_theme_satellite/foreman_theme_satellite/test/link_checker.rb:50:in `navigate_path'

I think the way it gets loaded doesn't work. The rake task doesn't load the whole Rails environment but loads one file directly.

In #58 I've taken a more native approach, but I still have to finish that.

@evgeni evgeni force-pushed the feat-support-zeitwerk branch from 5399608 to 352cec9 Compare September 11, 2024 09:02
Comment thread test/link_checker.rb Outdated
inner_hash = hash[first]

return inner_hash if rest.empty?
return inner_hash if rest.nil? or rest.empty?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Before Zeitwerk, Rails was loaded when this test was running and Rails in its endless wisdom adds empty? to NilClass. With Zeitweirk, no Rails is present here, and so no NilClass.empty?. Let's catch that via nil? first.

@evgeni evgeni force-pushed the feat-support-zeitwerk branch from 352cec9 to 3f0595f Compare September 11, 2024 09:07
@evgeni evgeni merged commit fd43f8e into RedHatSatellite:develop Sep 11, 2024
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.

3 participants