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 engine loading for Rails 7.2 #1702

Merged
merged 2 commits into from
Oct 31, 2023
Merged

Conversation

vinistock
Copy link
Member

Motivation

Commit rails/rails@ebfca90 renamed eager_load_paths to all_eager_load_paths.

For Rails applications pointing to main, Tapioca ends up not loading all engine paths

Implementation

The idea of the implementation is to switch to using the Rails 7.2 name of the configuration and just ensure it always exists even for older versions.

Tests

I'm not sure how we can write a test for this given that 7.2 has no releases yet. I did test this in Core though.

Rails 7.2 changed `eager_load_paths` for `all_eager_load_paths` in this
rails/rails@ebfca90
@vinistock vinistock self-assigned this Oct 30, 2023
@vinistock vinistock requested a review from a team as a code owner October 30, 2023 18:35
Co-authored-by: Andy Waite <[email protected]>
@vinistock vinistock merged commit 34fc676 into main Oct 31, 2023
28 checks passed
@vinistock vinistock deleted the vs/fix_engine_loading_rails_72 branch October 31, 2023 18:49
@shopify-shipit shopify-shipit bot temporarily deployed to production October 31, 2023 20:02 Inactive
@paracycle
Copy link
Member

I'm not sure how we can write a test for this given that 7.2 has no releases yet. I did test this in Core though.

We do test against Rails main, so this should have been caught already. But, it seems our existing tests weren't able to catch this failure, since Rails main builds only have a single unrelated failure even before this PR was merged. 🤔

@vinistock
Copy link
Member Author

We probably don't have tests related to engine files under the app folder. Anything under lib loads properly with the old code, we only lose the paths under app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants