Skip to content

Conversation

@trevorturk
Copy link
Contributor

Summary

Adds Zeitwerk eager loading validation to CI to catch autoloading issues before release.

Problem

Lack of CI check for catching eager loading issues. Recent example: ActiveRecord dependency bug (PR #504) would have been caught by this check.

Solution

Add Zeitwerk::Loader.eager_load_all check after linter step:

bundle exec ruby -e "require 'ruby_llm'; Zeitwerk::Loader.eager_load_all"

Placement: After linter, before tests

  • Structural validation happens together
  • Fast fail (~2s) before expensive test matrix

Blocked

This PR depends on #504 (ActiveRecord dependency fix).

Without #504, the eager loading check fails with:

NameError: uninitialized constant RubyLLM::ActiveRecord::ActsAs::ActiveSupport

After #504 is merged: ✅ Passes

Benefits

  • Catches inflector issues
  • Catches constant definition issues
  • Catches missing conditional checks
  • Fast fail (~2s check)
  • Prevents production crashes

🤖 Generated with Claude Code

Adds validation that Zeitwerk can eager load all files without errors.
This catches autoloading issues like inflector bugs and missing
conditional checks before they reach production.

- Added check after linter step for fast fail
- Runs on all Ruby/Rails matrix combinations
- ~2 second check prevents production crashes

## Blocked

This PR depends on crmne#504 (ActiveRecord dependency fix) to pass.
Without it, the eager loading check fails with NameError.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
trevorturk added a commit to trevorturk/ruby_llm-mcp that referenced this pull request Nov 18, 2025
Adds a validation step that runs Zeitwerk::Loader.eager_load_all after
dependency installation to catch autoloading issues early in the CI pipeline.

This check helps prevent production crashes by detecting:
- Inflector configuration errors
- Constant definition issues
- Missing conditional checks for optional dependencies

The check runs quickly (~2 seconds) before the test matrix, providing
rapid feedback on structural issues.

Note: This check currently fails due to upstream ruby_llm ActiveRecord
dependency issues. See:
- crmne/ruby_llm#504
- crmne/ruby_llm#505

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

1 participant