Skip to content

Conversation

kieranklaassen
Copy link
Contributor

Summary

  • Adds missing resolve instance method that delegates to the class method
  • Fixes usage of RubyLLM.models.resolve in the migration template
  • Includes comprehensive test coverage with TDD approach

Context

The upgrade migration template at lib/generators/ruby_llm/upgrade_to_v1_7/templates/migration.rb.tt uses RubyLLM.models.resolve on lines 74 and 139. However, RubyLLM.models returns a Models instance, which didn't have the resolve method - it was only available as a class method.

Changes

  • Added resolve instance method in Models class that delegates to self.class.resolve
  • Added test coverage for all three usage patterns:
    • With provider specified
    • Without provider (auto-detection)
    • With assume_exists option for unknown models

Test plan

  • Run bundle exec rspec spec/ruby_llm/models_spec.rb -e resolve - all tests pass
  • Verified the migration template can now use RubyLLM.models.resolve without errors

🤖 Generated with Claude Code

The migration template uses RubyLLM.models.resolve which requires
the instance to delegate to the class method. This commit adds the
missing delegation and comprehensive tests using TDD approach.

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

Co-Authored-By: Claude <[email protected]>
Copy link
Contributor

@tpaulshippy tpaulshippy left a comment

Choose a reason for hiding this comment

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

Looks like this has some Layout/TrailingWhitespace offenses from rubocop. All 8 autocorrectable.

Copy link

codecov bot commented Sep 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.29%. Comparing base (0d23da4) to head (89605e2).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #407      +/-   ##
==========================================
+ Coverage   84.27%   84.29%   +0.01%     
==========================================
  Files          36       36              
  Lines        1895     1897       +2     
  Branches      493      493              
==========================================
+ Hits         1597     1599       +2     
  Misses        298      298              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@crmne crmne merged commit 078ef25 into crmne:main Sep 13, 2025
14 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.

3 participants