Skip to content

Support Ruby 4.0#928

Open
ekohl wants to merge 2 commits into
theforeman:developfrom
ekohl:test-on-ruby-4
Open

Support Ruby 4.0#928
ekohl wants to merge 2 commits into
theforeman:developfrom
ekohl:test-on-ruby-4

Conversation

@ekohl

@ekohl ekohl commented Dec 28, 2025

Copy link
Copy Markdown
Member

Merging this will start testing Ruby 4.0 in all our plugins. It would be good to open PRs against some of the repos in https://theforeman.github.io/foreman-plugin-overview/#foreman-proxy and focus on the ones included in the installer since those are the most active.

Because I haven't done that, this is still a draft.

@ekohl ekohl changed the title Support Ruby version 4 Support Ruby 4.0 Dec 28, 2025
@ekohl ekohl mentioned this pull request Jan 23, 2026
@bastelfreak

Copy link
Copy Markdown
Member

This is passing on smart_proxy_openbolt: overlookinfra/smart_proxy_openbolt#26. And on smart_proxy_ansible: theforeman/smart_proxy_ansible#110. On how many plugins do we want to test this before merging it?

@ekohl

ekohl commented Feb 6, 2026

Copy link
Copy Markdown
Member Author

Foreman is in the stabilization week (https://community.theforeman.org/t/foreman-3-18-branching-process/45265) and I'd prefer to wait with this change until after 3.18.0 RC1 is out.

Comment thread smart_proxy.gemspec
s.required_ruby_version = '>= 3.0'
s.add_dependency 'base64'
s.add_dependency 'json'
s.add_dependency 'logger'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To satisfy the logger dependency with Ruby 4, we'll need to package it since it became a bundled gem in Ruby 4.
https://stdgems.org/logger/

I've attempted to add the package in packaging, but I realized we don't need it yet.
theforeman/foreman-packaging#13055

Is there a Redmine issue to track Ruby 4 support changes?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

To satisfy the logger dependency with Ruby 4, we'll need to package it since it became a bundled gem in Ruby 4.
https://stdgems.org/logger/

We don't need to until we package for Ruby 4. https://github.com/theforeman/foreman-packaging/tree/rpm/develop?tab=readme-ov-file#handle-gems-that-are-default-ruby-gems describes how we work around it. By the time we do move to Ruby 4 we'll automatically get a repoclosure failure.

Is there a Redmine issue to track Ruby 4 support changes?

Not yet. This was a test right after Ruby 4.0 was released to verify how compatible we are. Now that we're beyond branching I think we could look at enabling so we at least run CI.

ekohl added 2 commits May 26, 2026 17:15
The logger gem used to be a default gem, but is now a bundled gem which
means it needs to be declared as an explicit dependency.
@ekohl ekohl force-pushed the test-on-ruby-4 branch from 62d767f to a6cbec3 Compare May 26, 2026 15:15
@ekohl ekohl marked this pull request as ready for review May 26, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants