Skip to content

Conversation

sbernhard
Copy link
Contributor

@sbernhard sbernhard commented Apr 14, 2025

Support of ruby version 3.4.

Therefore we need to add the dependency to logger here. See ruby-concurrency/concurrent-ruby#1062

@sbernhard sbernhard force-pushed the add_logger_dep branch 8 times, most recently from ab66b0b to 632c98f Compare April 17, 2025 09:05
@sbernhard sbernhard changed the title concurrent-ruby dropped logger dependency Fixes #3838 - concurrent-ruby dropped logger dependency Apr 17, 2025
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Looking at https://stdgems.org/logger/ it states:

The gem type will be changed to bundled gem in a future version of Ruby

So it will be dropped (possibly Ruby 3.5). We also require the logging gem in lib/proxy/log.rb so I wonder if we can align on that.

Reading the concurrent-ruby source code I see you can assign the global logger so perhaps we should do that instead? You can see they deprecated the create_stdlib_logger so they're moving away from it as well.

Having said that, I do think in some places (log_buffer at least) we directly rely on the logger gem.

What do you think we should do?

@sbernhard
Copy link
Contributor Author

I don't think its about the Logger rubygem - the logger is part of ruby itself.
In Ubuntu deliverd by libruby3.2. In EL world deliverd by ruby-libs

The same change was done in rails/rails#54621, too

@ekohl
Copy link
Member

ekohl commented Apr 17, 2025

I don't think its about the Logger rubygem - the logger is part of ruby itself.
In Ubuntu deliverd by libruby3.2. In EL world deliverd by ruby-libs

This is the key thing: for now it is, but in Ruby 3.5 it will be removed: ruby/ruby@d7e558e. We can expect Ruby 3.5 in December and I like to look forward. If we can get rid of it altogether now that'll save work in the future.

@ekohl ekohl changed the title Fixes #3838 - concurrent-ruby dropped logger dependency Fixes #38383 - concurrent-ruby dropped logger dependency Apr 17, 2025
@sbernhard
Copy link
Contributor Author

I don't think its about the Logger rubygem - the logger is part of ruby itself.
In Ubuntu deliverd by libruby3.2. In EL world deliverd by ruby-libs

This is the key thing: for now it is, but in Ruby 3.5 it will be removed: ruby/ruby@d7e558e. We can expect Ruby 3.5 in December and I like to look forward. If we can get rid of it altogether now that'll save work in the future.

Well, during a installation of the smart-proxy on Windows we got this issue because of the missing 'require logger'.
Therefore, if it does not break anything right now, I would suggest to add this fix.

@ekohl
Copy link
Member

ekohl commented Apr 17, 2025

It concerns me we don't see it in CI now and I question the location. We also have https://github.com/theforeman/smart-proxy/blob/develop/lib/smart_proxy_for_testing.rb. Does it mean we simply don't hit the code paths in our testing?

Related: right now we're only testing on Ruby 3.0 but we should expand our matrix with Ruby 3.1 (Debian 12), 3.2 (Ubuntu 24.04) and 3.3 (EL 10 & Debian 13). Ideally also 3.4 for the future. Perhaps then we'd probably see it ourselves in CI?

@sbernhard
Copy link
Contributor Author

Related: right now we're only testing on Ruby 3.0 but we should expand our matrix with Ruby 3.1 (Debian 12), 3.2 (Ubuntu 24.04) and 3.3 (EL 10 & Debian 13). Ideally also 3.4 for the future. Perhaps then we'd probably see it ourselves in CI?

I added these versions. Only 3.4 failed to test:

"test/tftp/tftp_api_test.rb" "test/tftp/tftp_server_test.rb" "test/tftp/tftp_test.rb" "test/util_test.rb" "test/validations_test.rb" 
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.4.0/gems/rack-2.2.13/lib/rack/show_exceptions.rb:3: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add ostruct to your Gemfile or gemspec to silence this warning.
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.4.0/gems/logging-2.4.0/lib/logging.rb:10: warning: syslog was loaded from the standard library, but is not part of the default gems starting from Ruby 3.4.0.
You can add syslog to your Gemfile or gemspec to silence this warning.
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.4.0/gems/rubyipmi-0.11.1/lib/rubyipmi/observablehash.rb:1: warning: observer was loaded from the standard library, but is not part of the default gems starting from Ruby 3.4.0.
You can add observer to your Gemfile or gemspec to silence this warning.
/opt/hostedtoolcache/Ruby/3.4.3/x64/lib/ruby/3.4.0/bundled_gems.rb:[8](https://github.com/theforeman/smart-proxy/actions/runs/14521274599/job/40742594648#step:7:9)2:in 'Kernel.require': cannot load such file -- observer (LoadError)
	from /opt/hostedtoolcache/Ruby/3.4.3/x64/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
	```
=> observer rubygem
But we should also have a look at ostruct.

@sbernhard
Copy link
Contributor Author

I tried without the "require logger" - but this wasn't found by our testing. I wonder why...

@sbernhard
Copy link
Contributor Author

sbernhard commented Apr 29, 2025

Fixed the tests.

How to continue with this @ekohl ?

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Some minor nits but overall I like where this is heading.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Looking at https://projects.theforeman.org/issues/38357 this should probably be Refs #38357 and be cherry picked into 3.15.0.

@sbernhard
Copy link
Contributor Author

Tests broken. Oh, this lovely rubygems:

image
(excon updated 26min ago :-) )

@sbernhard
Copy link
Contributor Author

sbernhard commented May 27, 2025

Pinned excon <= 1.2.5 for now.
Excon fixed it already in excon/excon@2f5654b - just waiting for a new version.

Update: Fixed. new 1.2.7 of excon was just released.

@sbernhard sbernhard changed the title Fixes #38444 - Support of ruby version 3.4 Refs #38357 - Support of ruby version 3.4 May 27, 2025
ekohl
ekohl previously approved these changes May 27, 2025
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Thanks for updating this. What do you think about the last inline suggestion?

@lhellebr I'd like to include this in RC2 or GA if possible.

@ekohl
Copy link
Member

ekohl commented May 27, 2025

@sbernhard could you also squash the commits into 1 so Redmine issues is pleased and we'll also cherry pick correctly?

Also a note to https://community.theforeman.org/c/development/9 will be nice for all developers.

@sbernhard
Copy link
Contributor Author

@ekohl rebase / squash done.
would be good to finish this soonish. Looks like https://github.com/theforeman/smart_proxy_salt/actions/runs/15293534588/job/43017475837?pr=106#step:9:53 does fail because of this PR, too.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Thanks!

@ekohl ekohl merged commit a1c20c7 into theforeman:develop May 28, 2025
11 checks passed
@ekohl
Copy link
Member

ekohl commented May 28, 2025

@sbernhard thanks a lot for picking this up. Would you mind creating the Discourse post to mention we'll do this? For developers the impact is that their Smart Proxy CI will start running on Ruby 3.4 now and that can cause failures.

@sbernhard
Copy link
Contributor Author

Would you mind creating the Discourse post to mention we'll do this? For developers the impact is that their Smart Proxy CI will start running on Ruby 3.4 now and that can cause failures.

I hope this is ok: https://community.theforeman.org/t/smart-proxy-ci-now-running-on-ruby-3-4/43409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants