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

AlecK/APPEALS-44509 - (6.1 Base) #1671

Open
wants to merge 14 commits into
base: AlecK/APPEALS-46558
Choose a base branch
from

Conversation

AKeyframe
Copy link
Contributor

Resolves AlecK/APPEALS-44509

Description

These are the changes necessary for eFolder to become Zeitwerk compliant.

Acceptance Criteria

  • "All is good!" Triggers when running bin/rails zeitwerk:check

@jcroteau jcroteau changed the base branch from master to AlecK/APPEALS-46558 August 26, 2024 18:20
Comment on lines +1 to +9
# frozen_string_literal: true
require "rails_helper"

# See config/initializers/zeitwerk.rb if this fails
RSpec.describe "Zeitwerk Compliance Check" do
it "Eager loads all files without errors" do
expect { Rails.application.eager_load! }.not_to raise_error
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

For conformity w/ Caseflow, let's move this file to spec/config/zeitwerk_spec.rb.

@jcroteau jcroteau self-requested a review September 5, 2024 15:57
config.autoload_paths += Dir[Rails.root + 'app/jobs']
config.autoload_paths << Rails.root.join('lib')
config.autoload_paths << Rails.root.join('lib/scripts')

Copy link
Contributor

@jcroteau jcroteau Sep 5, 2024

Choose a reason for hiding this comment

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

Let's move the Zeitwerk inflector settings here (before config.autoload_paths) and delete the initializer, as was done for Caseflow in this commit.

This is a precautionary move, to circumvent potential sequencing issues when autoloading inflected constants in the autoload_once_paths (via the once autoloader).

We are not currently autloading anything with the once autoloader, but if down the road we need to, this will be one less gotcha we'll have to deal with.

For more details on this issue, see rails/rails#45568

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