Skip to content

fix(gemspec): declare the gems Ruby 4 unbundled - #2112

Open
petr-klemsinsky wants to merge 1 commit into
masterfrom
INFRA-4765/ruby4-bundled-gems
Open

petr-klemsinsky wants to merge 1 commit into
masterfrom
INFRA-4765/ruby4-bundled-gems

Conversation

@petr-klemsinsky

@petr-klemsinsky petr-klemsinsky commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

lib/ requires base64, benchmark, csv and logger directly, and the gemspec declares none of them. They were default gems up to Ruby 3.0 and are bundled gems from Ruby 3.4/4.0 on — a bundled gem still resolves for a plain ruby -e, which is why this is easy to miss, but under bundle exec it is invisible unless some gemspec asks for it.

GoodData's Fedora 44 Jenkins agents ship Ruby 4.0.7, so any consumer that loads gooddata through bundler dies before it runs anything:

lib/gooddata/bricks/middleware/bench_middleware.rb:7: warning: benchmark used to be loaded from
the standard library, but is not part of the default gems since Ruby 4.0.0.
bundled_gems.rb:60:in 'Kernel.require': cannot load such file -- benchmark (LoadError)

That is how it surfaced: gdc-bear's cmdline-tool-tests fails on every spec when the job lands on the Fedora agent.

Change

Four s.add_dependency lines, same shape and for the same reason as the net-smtp / net-imap / net-pop block right above, which was added when Ruby 3.1 unbundled those.

Unconditional rather than guarded on RUBY_VERSION: all four resolve as explicit dependencies on Ruby 3.0.7 too (base64 0.3.0, benchmark 0.5.0, csv 3.3.6, logger 1.7.0), so there is no version to guess at.

json is deliberately not in the list — it is the one of the five that still resolves under bundle exec on Fedora 44, and json_pure is already a dependency.

Verification

Which of the directly-required libraries actually fail, measured under bundle exec in a bundle that does not declare them, on fedora:44:

ruby 4.0.7
  FAILS base64
  FAILS benchmark
  FAILS csv
  OK    json
  FAILS logger

End to end: gdc-bear's cmdline-tool-tests on Ruby 4.0.7 with its unmodified Gemfile and gooddata pointed at this branch — the suite now loads all the way through, and the only remaining failure is the real SSH connection to the staging cluster, which no container can satisfy:

$ bundle exec rspec --dry-run spec/apu/add_user_spec.rb
Net::SSH::AuthenticationFailed: Authentication failed for user nobody@gc.stg1.intgdc.com

Without this change the same run stops at cannot load such file -- benchmark.

Related

gooddata/gdc-bear#7787 works around it from the consumer side so the checklist can go green before this lands; this is the durable fix. gooddata/ci-infra#11506 fixes the separate Bundler 4 half of the same breakage.

JIRA: INFRA-4765

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added runtime requirements for Base64, Benchmark, CSV, and Logger libraries across all supported Ruby environments.

lib/ requires base64, benchmark, csv and logger directly. They were
default gems up to Ruby 3.0 and are bundled gems from Ruby 3.4/4.0 on,
so they still resolve standalone but are invisible under bundler unless
a gemspec asks for them.

On Fedora 44 agents this takes out every consumer that loads gooddata
through bundler: bench_middleware dies on LoadError before anything
runs. Same shape as the net-smtp block above.

JIRA: INFRA-4765

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: fb962acc-c23b-45b9-8ce3-ae5d498766b3
📥 Commits

Reviewing files that changed from the base of the PR and between 3da85bf and 1bb7a17.

📒 Files selected for processing: 1
  • gooddata.gemspec

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

📝 Walkthrough

The gemspec now declares base64, benchmark, csv, and logger as runtime dependencies for all Ruby versions and platforms.

Changes: Runtime Dependencies

Layer / File(s) Summary
Declare runtime dependencies
gooddata.gemspec
The gemspec adds unconditional runtime dependencies on base64, benchmark, csv, and logger.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 1bb7a

The gem now declares base64, benchmark, csv, and logger as runtime dependencies. Applications loading it through Bundler on newer Ruby releases will no longer fail with missing-library errors. Older Ruby versions the gem could already install on are unaffected, because existing dependencies had already excluded Ruby 2.2. No merge-blocking risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately identifies the gemspec change and its purpose: declaring Ruby 4 unbundled gems as dependencies.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the gemspec with care
Four new names now rest in there
Base64 and benchmark join the line
CSV and logger follow fine
The rabbit hops away, content and spry

Comment @coderabbitai help to get the list of available commands.

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