From 8638dc752615cfd2ca13d041b44e30dec712aa15 Mon Sep 17 00:00:00 2001 From: Samuel O'Daniels <35481602+Samuelodan@users.noreply.github.com> Date: Tue, 22 Sep 2026 09:54:51 +0100 Subject: [PATCH] Bump deps, enable deprecation warnings, and fix related issues --- .github/workflows/ci.yml | 5 +- .rubocop.yml | 2 +- .ruby-version | 2 +- Gemfile | 4 +- Gemfile.lock | 150 +++++++++++++++++++------------------- spec/spec_helper.rb | 1 + spec/support/simplecov.rb | 2 +- src/foobara/cli_runner.rb | 12 +-- src/foobara/util.rb | 12 +-- 9 files changed, 98 insertions(+), 92 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd382e5..05dfea9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,13 +11,16 @@ jobs: ci: runs-on: ubuntu-latest name: RSpec and Rubocop + strategy: + matrix: + ruby: ['3.4', '4.0'] timeout-minutes: 3 steps: - uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ env.ruby_version }} + ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Run rspec run: bundle exec rspec diff --git a/.rubocop.yml b/.rubocop.yml index fdde201..2bc38f4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,5 @@ AllCops: - TargetRubyVersion: 3.2 + TargetRubyVersion: 4.0 NewCops: enable inherit_gem: diff --git a/.ruby-version b/.ruby-version index 2aa5131..43beb40 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.7 +4.0.7 diff --git a/Gemfile b/Gemfile index 615175e..d56a74a 100644 --- a/Gemfile +++ b/Gemfile @@ -22,7 +22,9 @@ group :development do end group :development, :test do - gem "foobara-anthropic-api", "< 2.0.0" + # one test fails on the newly released foobara-anthropic-api 1.0.6 + # related to `temperature` no longer being an allowed attribute + gem "foobara-anthropic-api", "1.0.5" gem "foobara-ollama-api", "< 2.0.0" gem "foobara-open-ai-api", "< 2.0.0" diff --git a/Gemfile.lock b/Gemfile.lock index 07bdf06..2eba803 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,32 +7,31 @@ PATH GEM remote: https://rubygems.org/ specs: - addressable (2.8.8) + addressable (2.9.0) public_suffix (>= 2.0.2, < 8.0) ast (2.4.3) base64 (0.3.0) - bigdecimal (4.0.1) - byebug (12.0.0) + bigdecimal (4.1.3) + byebug (13.0.0) + reline (>= 0.6.0) coderay (1.1.3) crack (1.0.1) bigdecimal rexml - date (3.5.1) diff-lcs (1.6.2) - docile (1.4.1) dotenv (3.2.0) - erb (6.0.1) - ffi (1.17.3-aarch64-linux-gnu) - ffi (1.17.3-aarch64-linux-musl) - ffi (1.17.3-arm-linux-gnu) - ffi (1.17.3-arm-linux-musl) - ffi (1.17.3-arm64-darwin) - ffi (1.17.3-x86-linux-gnu) - ffi (1.17.3-x86-linux-musl) - ffi (1.17.3-x86_64-darwin) - ffi (1.17.3-x86_64-linux-gnu) - ffi (1.17.3-x86_64-linux-musl) - foobara (0.4.1) + erb (6.0.7) + ffi (1.17.4-aarch64-linux-gnu) + ffi (1.17.4-aarch64-linux-musl) + ffi (1.17.4-arm-linux-gnu) + ffi (1.17.4-arm-linux-musl) + ffi (1.17.4-arm64-darwin) + ffi (1.17.4-x86-linux-gnu) + ffi (1.17.4-x86-linux-musl) + ffi (1.17.4-x86_64-darwin) + ffi (1.17.4-x86_64-linux-gnu) + ffi (1.17.4-x86_64-linux-musl) + foobara (0.6.4) bigdecimal foobara-lru-cache (< 2.0.0) foobara-util (< 2.0.0) @@ -45,16 +44,16 @@ GEM foobara (>= 0.4.1, < 2.0.0) foobara-cached-command (< 2.0.0) foobara-http-api-command (< 2.0.0) - foobara-cached-command (1.0.0) - foobara (< 2.0.0) + foobara-cached-command (1.0.1) + foobara (>= 0.1.1, < 2.0.0) foobara-dotenv-loader (0.0.3) dotenv foobara-http-api-command (0.0.9) foobara - foobara-json-schema-generator (1.1.0) + foobara-json-schema-generator (1.1.1) + foobara (>= 0.1.1, < 2.0.0) + foobara-llm-backed-command (1.0.3) foobara (>= 0.1.1, < 2.0.0) - foobara-llm-backed-command (1.0.2) - foobara (>= 0.0.136, < 2.0.0) foobara-ai (>= 1.0.0, < 2.0.0) foobara-json-schema-generator (>= 1.0.0, < 2.0.0) foobara-lru-cache (1.0.0) @@ -62,25 +61,25 @@ GEM foobara (>= 0.1.1, < 2.0.0) foobara-cached-command (>= 1.0.0, < 2.0.0) foobara-http-api-command (< 2.0.0) - foobara-open-ai-api (1.0.1) - foobara-cached-command - foobara-http-api-command - foobara-rubocop-rules (1.0.10) + foobara-open-ai-api (1.0.2) + foobara (>= 0.6.4, < 2.0.0) + foobara-cached-command (< 2.0.0) + foobara-http-api-command (< 2.0.0) + foobara-rubocop-rules (1.1.1) rubocop rubocop-rspec - foobara-spec-helpers (0.0.4) + foobara-spec-helpers (0.1.1) foobara-util - foobara-util (1.0.7) + foobara-util (1.0.8) formatador (1.2.3) reline - guard (2.19.1) + guard (2.20.2) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) logger (~> 1.6) lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) - ostruct (~> 0.6) pry (>= 0.13.0) shellany (~> 0.0) thor (>= 0.18.1) @@ -91,15 +90,17 @@ GEM rspec (>= 2.99.0, < 4.0) hashdiff (1.2.1) inheritable-thread-vars (0.0.3) - io-console (0.8.2) - irb (1.16.0) + io-console (0.9.4) + irb (1.18.0) pp (>= 0.6.0) + prism (>= 1.3.0) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.18.0) - language_server-protocol (3.17.0.5) + json (3.0.2) + language_server-protocol (3.17.0.6) lint_roller (1.1.0) - listen (3.9.0) + listen (3.10.0) + logger rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) @@ -110,36 +111,39 @@ GEM nenv (~> 0.1) shellany (~> 0.0) ostruct (0.6.3) - parallel (1.27.0) - parser (3.3.10.0) + parallel (2.2.0) + parser (3.3.12.0) ast (~> 2.4.1) racc - pp (0.6.3) + pp (0.6.4) prettyprint prettyprint (0.2.0) - prism (1.7.0) - pry (0.15.2) + prism (1.9.0) + pry (0.16.0) coderay (~> 1.1) method_source (~> 1.0) - pry-byebug (3.11.0) - byebug (~> 12.0) - pry (>= 0.13, < 0.16) - psych (5.3.1) - date - stringio - public_suffix (7.0.0) + reline (>= 0.6.0) + pry-byebug (3.12.0) + byebug (~> 13.0) + pry (>= 0.13, < 0.17) + public_suffix (7.0.5) racc (1.8.1) rainbow (3.1.1) - rake (13.3.1) + rake (13.4.2) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rdoc (7.0.3) + rbs (4.2.0) + logger + prism (>= 1.6.0) + tsort + rdoc (8.0.0) erb - psych (>= 4.0.0) + prism (>= 1.6.0) + rbs (>= 4.0.0) tsort - regexp_parser (2.11.3) - reline (0.6.3) + regexp_parser (2.13.0) + reline (0.7.0) io-console (~> 0.5) rexml (3.4.4) rspec (3.13.2) @@ -154,48 +158,44 @@ GEM rspec-its (2.0.0) rspec-core (>= 3.13.0) rspec-expectations (>= 3.13.0) - rspec-mocks (3.13.7) + rspec-mocks (3.13.8) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.6) - rubocop (1.82.1) - json (~> 2.3) + rspec-support (3.13.7) + rubocop (1.91.0) + json (>= 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) - parallel (~> 1.10) + parallel (>= 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.48.0, < 2.0) + rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.49.0) + rubocop-ast (1.50.0) parser (>= 3.3.7.2) prism (~> 1.7) rubocop-rake (0.7.1) lint_roller (~> 1.1) rubocop (>= 1.72.1) - rubocop-rspec (3.8.0) + rubocop-rspec (3.10.2) lint_roller (~> 1.1) - rubocop (~> 1.81) - ruby-prof (1.7.2) + regexp_parser (>= 2.0) + rubocop (~> 1.86, >= 1.86.2) + ruby-prof (2.0.5) base64 + ostruct ruby-progressbar (1.13.0) shellany (0.0.1) - simplecov (0.22.0) - docile (~> 1.1) - simplecov-html (~> 0.11) - simplecov_json_formatter (~> 0.1) - simplecov-html (0.13.2) - simplecov_json_formatter (0.1.4) - stringio (3.2.0) - thor (1.4.0) + simplecov (1.3.0) + thor (1.5.0) tsort (0.2.0) - unicode-display_width (3.2.0) - unicode-emoji (~> 4.1) - unicode-emoji (4.2.0) + unicode-display_width (3.3.0) + unicode-emoji (~> 4.3) + unicode-emoji (4.3.0) vcr (6.4.0) - webmock (3.26.1) + webmock (3.26.4) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -214,7 +214,7 @@ PLATFORMS DEPENDENCIES foobara-agent-cli! - foobara-anthropic-api (< 2.0.0) + foobara-anthropic-api (= 1.0.5) foobara-dotenv-loader (< 2.0.0) foobara-ollama-api (< 2.0.0) foobara-open-ai-api (< 2.0.0) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f25cf3e..3688dae 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,7 @@ require "pry" require "pry-byebug" require "rspec/its" +Warning[:deprecated] = true require_relative "support/simplecov" require_relative "../boot/start" diff --git a/spec/support/simplecov.rb b/spec/support/simplecov.rb index 3bbbebf..43f747a 100644 --- a/spec/support/simplecov.rb +++ b/spec/support/simplecov.rb @@ -1,7 +1,7 @@ require "simplecov" SimpleCov.start do - add_filter "spec/" + skip "spec/" # enable_coverage :branch minimum_coverage line: 100 # TODO: enable this? worth it to get to 100% branch coverage? diff --git a/src/foobara/cli_runner.rb b/src/foobara/cli_runner.rb index c3b9ec1..6cd4ec5 100644 --- a/src/foobara/cli_runner.rb +++ b/src/foobara/cli_runner.rb @@ -42,19 +42,19 @@ def run print_outcome(outcome) print_prompt rescue => e - # :nocov: + # simplecov:disable Util.pipe_writeline(io_err, e.message) Util.pipe_writeline(io_err, e.backtrace) - # :nocov: + # simplecov:enable end end end def print_welcome_message welcome_message = if agent_name - "Welcome! I am #{agent_name}!" + +"Welcome! I am #{agent_name}!" else - "Welcome to the Foobara Agent CLI!" + +"Welcome to the Foobara Agent CLI!" end welcome_message << " What would you like me to attempt to accomplish?" @@ -70,9 +70,9 @@ def print_outcome(outcome) message, stream = if outcome.success? [outcome.result[:message_to_user], io_out] else - # :nocov: + # simplecov:disable ["ERROR: #{outcome.errors_hash}", io_err] - # :nocov: + # simplecov:enable end print_agent_message(message, stream) diff --git a/src/foobara/util.rb b/src/foobara/util.rb index e6c4d07..3ac446b 100644 --- a/src/foobara/util.rb +++ b/src/foobara/util.rb @@ -31,11 +31,11 @@ def pipe_wait_readable(io, timeout = nil) def pipe_io_operation(_io) yield rescue EOFError - # :nocov: + # simplecov:disable nil - # :nocov: + # simplecov:enable rescue IOError => e - # :nocov: + # simplecov:disable message = e.message if message.include?("closed") && message.include?("stream") @@ -43,16 +43,16 @@ def pipe_io_operation(_io) else raise end - # :nocov: + # simplecov:enable end def close(io) io.close nil rescue IOError - # :nocov: + # simplecov:disable nil - # :nocov: + # simplecov:enable end end end