Keep the Ruby 3.2 CI floor off the OpenAI SDK's 3.3 requirement - #214
Closed
simonx1 wants to merge 2 commits into
Closed
Keep the Ruby 3.2 CI floor off the OpenAI SDK's 3.3 requirement#214simonx1 wants to merge 2 commits into
simonx1 wants to merge 2 commits into
Conversation
`bundle install` has been failing on the Ruby 3.2 matrix job since #207: openai-0.77.0 requires ruby version >= 3.3.0, which is incompatible with the current version, 3.2.11 #207 moved the git-sourced `openai` dev dependency to a revision where upstream raised `required_ruby_version` from >= 3.2.0 to >= 3.3.0. The gemspec here still declares >= 3.2.0 and CI still tests that floor, so resolution on 3.2 now has no valid candidate. It went unnoticed because setup-ruby's bundler cache satisfied the whole lockfile, so `bundle install` never re-resolved and never read that gemspec. Any PR that touches a rubygems-sourced gem forces a real resolve on the 3.2 runner and trips over it — which is what #213 (rubocop 1.89.0) did. Nothing in the suite needs the SDK: spec_helper's `require 'openai'` resolves to ruby-openai, which also ships lib/openai.rb, and the integration spec uses ruby-openai's `access_token:` API. The only consumer is examples/openai_ruby_mcp.rb, which unshifts the gem's load path explicitly. So gate it on Ruby >= 3.3 rather than let a dev-only example dependency dictate the library's supported floor. Verified on 4.0.6 that Gemfile.lock is unchanged and the suite is green, and with the guard forced false that resolution drops only the GIT section, `openai!` and its two unique transitive deps (cgi, connection_pool) with no version churn elsewhere — 1701 examples, 0 failures, RuboCop clean in both states. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
The Gemfile guard alone is not enough: `bundler-cache: true` makes
setup-ruby run `bundle config set --local deployment true`, and
deployment mode requires the Gemfile's dependency list to match
Gemfile.lock exactly:
The list of sources changed, but the lockfile can't be updated
because frozen mode is set
You have deleted from the Gemfile: * openai
Local `.bundle/config` beats `BUNDLE_*` env vars in Bundler's settings
precedence, so the job cannot opt out of deployment mode with an env
var. Turn the cache off for that one matrix entry instead and install
explicitly.
The 3.2 job now resolves rather than replays the lockfile. That is safe
here: the re-resolution is purely subtractive (verified by forcing the
guard false locally -- it drops only the GIT section, `openai!`, and the
two transitive deps unique to it, with no version churn elsewhere), and
every one of the 68 rubygems-sourced gems in Gemfile.lock accepts Ruby
3.2, so there is nothing else for it to downgrade.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Owner
Author
|
Superseded by a PR that drops Ruby 3.2 support outright instead of working around the OpenAI SDK's 3.3 floor. |
simonx1
added a commit
that referenced
this pull request
Aug 21, 2026
Supersedes #214, which kept the 3.2 job alive by gating the OpenAI SDK dev dependency behind a Ruby-version check and disabling gem caching on that one job. ## Problem `bundle install` fails on the Ruby 3.2 matrix job whenever Bundler has to resolve for real (i.e. whenever `setup-ruby`'s cache misses, as it does on any PR that touches a rubygems-sourced gem — #213 is the current example): ``` openai-0.77.0 requires ruby version >= 3.3.0, which is incompatible with the current version, 3.2.11 ``` #207 and #212 moved the git-sourced `openai` dev dependency to revisions where upstream raised its `required_ruby_version` to `>= 3.3.0`, while the gemspec here still declared `>= 3.2.0` and CI still tested that floor. ## Fix Drop 3.2 instead of working around it. Ruby 3.2 has been EOL since 2026-03-31, `.rubocop.yml` already sets `TargetRubyVersion: 3.3.5`, and a Gemfile/CI workaround for one dependency would have had to be maintained indefinitely. - `ruby-mcp-client.gemspec`: `required_ruby_version` is now `>= 3.3.0`. - `.github/workflows/ci.yml`: the two-entry matrix becomes a single `Test (Ruby 3.3, floor)` job, mirroring the shape of the 4.0.6 job. Gem caching stays on for both. - `README.md`: the Requirements section states the new floor. No library code changes. No `Gemfile.lock` changes. ## Breaking change This is a breaking change for anyone installing the gem on Ruby 3.2 — RubyGems will refuse the next released version there. `CHANGELOG.md` is written at release time in this repo, so the next release's **Breaking Changes** section should carry an entry for this. ## Verification - **Ruby 4.0.6:** `bundle install` leaves `Gemfile.lock` byte-identical; RuboCop clean; 1701 examples, 0 failures. - **Ruby 3.3.5 (new floor), uncached resolve in a fresh worktree:** `Gemfile.lock` byte-identical after `bundle install`, so the CI job's cached lockfile replay and a real resolve agree; RuboCop clean; 1701 examples, 0 failures. - No branch protection or rulesets reference the old `test (3.2)` / `test (3.3)` check names, so the rename is safe. Once merged, `@dependabot rebase` on #213 should turn it green. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
bundle installfails on the Ruby 3.2 matrix job:#207 moved the git-sourced
openaidev dependency to a revision where upstream raisedrequired_ruby_versionfrom>= 3.2.0to>= 3.3.0. The gemspec here still declares>= 3.2.0and CI still tests that floor, so resolution on 3.2 has no valid candidate.It went unnoticed because
setup-ruby's bundler cache satisfied the entire lockfile, sobundle installnever re-resolved and never read that gemspec. Any PR that touches a rubygems-sourced gem forces a real resolve on the 3.2 runner and trips over it — which is what #213 (rubocop 1.89.0) did. Itstest (3.3)failure is only matrix fail-fast, not a real failure.Fix
1. Gate the dependency on Ruby >= 3.3 (
Gemfile). Nothing in the suite needs the official SDK:spec_helper.rb'srequire 'openai'resolves to ruby-openai — both gems shiplib/openai.rb.spec/integration/openai_mcp_integration_spec.rbuses ruby-openai'saccess_token:API, not the official gem'sapi_key:.examples/openai_ruby_mcp.rb, which unshifts the gem's load path explicitly.A dev-only example dependency shouldn't dictate the library's supported floor.
2. Install uncached on the 3.2 job (
.github/workflows/ci.yml). The guard alone isn't enough —bundler-cache: truemakes setup-ruby runbundle config set --local deployment true, and deployment mode requires the Gemfile's dependency list to matchGemfile.lockexactly:Local
.bundle/configbeatsBUNDLE_*env vars in Bundler's settings precedence, so the job can't opt out of deployment mode via env. The cache is turned off for that one matrix entry instead.Verification
Gemfile.lockbyte-identical, RuboCop clean, 1701 examples / 0 failures.GITsection,openai!, and the two transitive deps unique to it (cgi,connection_pool). No version churn on any other gem. RuboCop clean, 1701 examples / 0 failures.Gemfile.lockaccept Ruby 3.2, so the uncached 3.2 resolve has nothing else it could downgrade.Trade-offs
examples/openai_ruby_mcp.rbwill now fail on Ruby 3.2 atGem::Specification.find_by_name('openai'). Left as-is — the example targets an SDK that genuinely requires 3.3. Happy to add a friendly abort if you want one.The alternative is to drop Ruby 3.2 entirely (EOL since 2026-03-31, and
.rubocop.ymlalready setsTargetRubyVersion: 3.3.5), which would be simpler but is a breaking change for users.Once merged,
@dependabot rebaseon #213 should turn it green.🤖 Generated with Claude Code