Skip to content

feat: add Ruby 3.4 and 4.0 support#78

Merged
mridang merged 4 commits intobetafrom
feat/add-support-for-ruby-4
Mar 3, 2026
Merged

feat: add Ruby 3.4 and 4.0 support#78
mridang merged 4 commits intobetafrom
feat/add-support-for-ruby-4

Conversation

@mridang
Copy link
Copy Markdown
Collaborator

@mridang mridang commented Mar 3, 2026

This adds support for Ruby 4.

Description

This pull-request adds support for Ruby 4.0 while maintaining backward compatibility with Ruby 3.x. It introduces a .ruby-version file as the single source of truth for CI workflows, updates devbox and the Dockerfile to Ruby 4.0, and expands the integration test matrix to include Ruby 3.4 and 4.0. Gems removed from the Ruby 4.0 default set (cgi, date, logger, net-http, tempfile, time, uri) are now declared as explicit runtime dependencies.

Related Issue

No related issue.

Motivation and Context

Ruby 4.0 has been released and this project needs to support both Ruby 3.x and 4.x. Several gems were removed from the Ruby 4.0 default set and must now be declared explicitly to avoid LoadError at runtime. The CI workflows previously hardcoded Ruby 3.0 and the integration matrix did not cover Ruby 3.4 or 4.0.

How Has This Been Tested?

All tests pass locally on Ruby 4.0 via devbox (32/32 tests, 0 RuboCop offenses, no Steep type errors). The gem was verified to build and load correctly on Docker containers for ruby:3.0, ruby:3.4, and ruby:4.0. The integration matrix now covers Ruby 3.0 through 4.0.

Documentation:

No documentation changes required.

Checklist:

  • I have updated the documentation accordingly.
  • I have assigned the correct milestone or created one if non-existent.
  • I have correctly labeled this pull request.
  • I have linked the corresponding issue in this description.
  • I have requested a review from at least 2 reviewers
  • I have checked the base branch of this pull request
  • I have checked my code for any possible security vulnerabilities

Add .ruby-version as single source of truth for CI workflows.
Update devbox, Dockerfile, and CI workflows for Ruby 4.0.
Expand integration test matrix to include Ruby 3.4 and 4.0.
Add formerly-default gems as explicit dependencies for Ruby 4.0
compatibility (cgi, date, logger, net-http, tempfile, time, uri).
Wrap rdoc/task require for Ruby 4.0 where rdoc is no longer a
default gem.
@mridang mridang marked this pull request as draft March 3, 2026 04:03
mridang added 3 commits March 3, 2026 15:11
The previous pin (v1.242.0) predates Ruby 4.0 and does not
include it in its available versions list.
The sanity stub's Gemfile.lock specifies BUNDLED WITH 2.2.33 which is
incompatible with Ruby 3.4+ (DidYouMean::SPELL_CHECKERS removed). By
removing bundler-cache, the default bundler shipped with each Ruby
version is used instead. The next step already runs bundle install.
The sanity stub's Gemfile.lock on main specifies BUNDLED WITH 2.2.33.
Bundler downgrades itself to that version which is incompatible with
Ruby 3.4+ (DidYouMean::SPELL_CHECKERS removed). Removing the lockfile
lets the default bundler resolve dependencies fresh.
@mridang mridang requested a review from Copilot March 3, 2026 04:26
@mridang mridang self-assigned this Mar 3, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the project to support Ruby 4.0 while keeping Ruby 3.x compatibility, mainly by making Ruby-version selection consistent across dev/CI tooling and explicitly depending on stdlib gems that are no longer default in Ruby 4.

Changes:

  • Add explicit runtime gem dependencies (e.g., cgi, date, logger, net-http, tempfile, time, uri) to avoid Ruby 4 LoadErrors.
  • Introduce .ruby-version and update CI workflows to rely on it; expand the integration matrix to include Ruby 3.4 and 4.0.
  • Update devbox and Docker setup to Ruby 4.0, and adjust Rake tasks to tolerate rdoc being absent.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
zitadel-client.gemspec Adds explicit runtime dependencies for stdlib gems removed from Ruby 4’s default set.
Gemfile.lock Updates locked dependency graph to reflect new runtime deps and Bundler version.
Gemfile Adds securerandom for test/integration specs that require it under Ruby 4.
Rakefile Makes rdoc task optional when rdoc isn’t installed.
Dockerfile Switches base image to Ruby 4.0.
.ruby-version Establishes Ruby 4.0 as the repo’s default Ruby version.
devbox.json / devbox.lock Updates devbox environment to Ruby 4.0 and adds clang tooling.
.github/workflows/typecheck.yml Uses ruby/setup-ruby without hardcoding Ruby 3.0 (implicitly relies on .ruby-version).
.github/workflows/test.yml Same as typecheck: relies on .ruby-version instead of hardcoding.
.github/workflows/linting.yml Same: relies on .ruby-version and bumps setup-ruby action pin.
.github/workflows/release.yml Same: relies on .ruby-version and bumps setup-ruby action pin.
.github/workflows/integration.yml Expands Ruby matrix to 3.0–4.0; removes lockfile before bundle install in sanity project.
spec/spec_helper.rb Removes trailing blank lines.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mridang mridang marked this pull request as ready for review March 3, 2026 04:30
@mridang mridang merged commit 1fc12bb into beta Mar 3, 2026
19 checks passed
github-actions bot pushed a commit that referenced this pull request Mar 10, 2026
# [4.1.0-beta.12](v4.1.0-beta.11...v4.1.0-beta.12) (2026-03-10)

### Features

* add Ruby 3.4 and 4.0 support ([#78](#78)) ([1fc12bb](1fc12bb))
* add TransportOptions for configuring TLS, proxy, and default headers ([#79](#79)) ([441dd2a](441dd2a))
github-actions bot pushed a commit that referenced this pull request Mar 18, 2026
# [4.1.0](v4.0.0...v4.1.0) (2026-03-17)

### Bug Fixes

* **build:** enable the pipeline to also run the commitlint checks ([95ab583](95ab583))
* **build:** fix the name of the docker-related dependabot updates [skip ci] ([0ce8340](0ce8340))
* **build:** include Gemfile.lock in semantic-release git assets ([7ad9a82](7ad9a82))
* **build:** Remove and ignore Gemfile.lock for library development ([37253a5](37253a5))
* **build:** trigger pipeline only on all branches for push [skip ci] ([c7be885](c7be885))
* **ci:** disable bundler frozen mode in release workflow ([44db79b](44db79b))
* **test:** fixed the user-agent regex so that it matches the new rc versions ([d777ae5](d777ae5))

### Features

* add better_coverage reporter for Jest-style coverage output ([70056dd](70056dd))
* add Ruby 3.4 and 4.0 support ([#78](#78)) ([1fc12bb](1fc12bb))
* add TransportOptions for configuring TLS, proxy, and default headers ([#79](#79)) ([441dd2a](441dd2a))
* initial beta sdk release for Zitadel v4.0.0-rc.1 ([7085e13](7085e13))
* **sdk:** generate SDK for version v4.0.0 ([#65](#65)) ([bd58225](bd58225))
* **sdk:** generate SDK for version v4.1.3 ([#70](#70)) ([5775f26](5775f26))
* **sdk:** generate SDK for version v4.11.0 ([#77](#77)) ([10e4778](10e4778))
* **sdk:** generate SDK for version v4.2.0 ([#71](#71)) ([df5a05c](df5a05c))
* **sdk:** generate SDK for version v4.3.0 ([#73](#73)) ([10cea79](10cea79))
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.

2 participants