Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for older rubies, rails and redis #566

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

fatkodima
Copy link
Contributor

Also a candidate for a new major release, imo.

This PR drops support for:

  1. ruby < 3.1 (https://devcenter.heroku.com/articles/ruby-support-reference#supported-runtimes, https://endoflife.date/ruby)
  2. rails < 7
  3. redis < 6 (https://redis.io/docs/latest/operate/rs/installing-upgrading/product-lifecycle/).

It also updates CI to check against newer railses.

There is a mention about jruby in the readme, but no tests on CI. I would suggest just dropping it, as I am not sure many people (anyone?) uses it in production to worth the effort.

@fatkodima
Copy link
Contributor Author

fatkodima commented Nov 15, 2024

I also noticed, that there is a rubocop and standardrb. I would suggest removing the latter and properly use rubocop and fix all the current offenses.

Also, there is a

task "test:all": %i[rubocop test forked_tests benchmarks:memory benchmarks]
task, which runs forked_tests. These are not ran on CI currently and are broken. That should be also fixed.

I can help, if ok.

@@ -4,7 +4,7 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in coverband.gemspec
gemspec
gem 'rails', '~>7'
Copy link
Owner

Choose a reason for hiding this comment

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

we might want a rails7 rails 7.1 and rails 7.2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, we have gemfiles for 7.0, 7.1 and 7.2, thats github incorrectly displays this change as a renamed file 🤷

@@ -25,14 +25,14 @@ def initialize(redis, opts = {})
@save_report_batch_size = opts[:save_report_batch_size] || 100
@format_version = REDIS_STORAGE_FORMAT_VERSION
@redis = redis
raise "HashRedisStore requires redis >= 2.6.0" unless supported?
raise "HashRedisStore requires redis >= 6.0.0" unless supported?
Copy link
Owner

Choose a reason for hiding this comment

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

Do we have a reason to require redis 6, we were checking this based on features that redis supports but we aren't using any of the more modern and newer redis features.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no reason, only as encouraging people upgrading their redis. I also doubt that people are on the latest version of coverband, but on the redis which is EOL many years ago. But happy to revert.

@@ -13,7 +13,7 @@ class RouteTracker < AbstractTracker
TITLE = "Routes"

def initialize(options = {})
if Rails&.respond_to?(:version) && Gem::Version.new(Rails.version) >= Gem::Version.new("6.0.0") && Gem::Version.new(Rails.version) < Gem::Version.new("7.1.0")
if Rails&.respond_to?(:version) && Gem::Version.new(Rails.version) < Gem::Version.new("7.1.0")
require_relative "../utils/rails6_ext"
Copy link
Owner

Choose a reason for hiding this comment

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

in this case we can delete this check and delete the rails6_ext file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We still support rails 7.0, but the feature was added in 7.1 (rails/rails#43755)

@danmayer
Copy link
Owner

Thanks... I guess we could start putting together a major release.

  • I am good with updating to all the latest supported versions
  • The JRuby tests were flaky and causing issues when I moved to github actions, but the support was added due to some requests, so I don't want to drop it. We can either fix the tests or add a comment that it is no longer tested
  • I will try to fix the forked tests on CI they worked with a small tweak on my machine.

on Rubocop and Standard, I prefer standardrb for all my projects, I have rubocop as some editor tool chains seem to struggle with using standard as a auto formatter. Rubocop is supposed to use standard via the config file but appears not to do so...

  • If we are going to remove one, I would remove all the references to rubocop
  • CI enforces standardrb passing
  • standard is currently passing
danmayer@dellstation:~/projects/coverband$ bundle exec standardrb
Inspecting 153 files
.........................................................................................................................................................

@danmayer
Copy link
Owner

I fixed the forked tests, I also fixed up the benchmark tasks.... those are all now running on CI.

See the few comments I left after that I am happy to merge this.

Copy link
Contributor Author

@fatkodima fatkodima left a comment

Choose a reason for hiding this comment

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

Updated PR with removing old dummy apps from test/ directory.

@@ -4,7 +4,7 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in coverband.gemspec
gemspec
gem 'rails', '~>7'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, we have gemfiles for 7.0, 7.1 and 7.2, thats github incorrectly displays this change as a renamed file 🤷

@@ -25,14 +25,14 @@ def initialize(redis, opts = {})
@save_report_batch_size = opts[:save_report_batch_size] || 100
@format_version = REDIS_STORAGE_FORMAT_VERSION
@redis = redis
raise "HashRedisStore requires redis >= 2.6.0" unless supported?
raise "HashRedisStore requires redis >= 6.0.0" unless supported?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no reason, only as encouraging people upgrading their redis. I also doubt that people are on the latest version of coverband, but on the redis which is EOL many years ago. But happy to revert.

@@ -13,7 +13,7 @@ class RouteTracker < AbstractTracker
TITLE = "Routes"

def initialize(options = {})
if Rails&.respond_to?(:version) && Gem::Version.new(Rails.version) >= Gem::Version.new("6.0.0") && Gem::Version.new(Rails.version) < Gem::Version.new("7.1.0")
if Rails&.respond_to?(:version) && Gem::Version.new(Rails.version) < Gem::Version.new("7.1.0")
require_relative "../utils/rails6_ext"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We still support rails 7.0, but the feature was added in 7.1 (rails/rails#43755)

@fatkodima
Copy link
Contributor Author

I honestly prefer rubocop over standardrb, because I like full control and also when trying to ignore something with standardrb it starts looking like a hack for me. So I suggest having only one of them. If you want to remove one of them, please do, or let me know and I can do this.

@danmayer
Copy link
Owner

danmayer commented Nov 18, 2024

There is no reason, only as encouraging people upgrading their redis. I also doubt that people are on the latest version of coverband, but on the redis which is EOL many years ago. But happy to revert.

yeah let's leave it with the older redis support... Many users of Coverband are trying to use it because they are maintaining old legacy apps, so we often have users that are way behind the curve in terms of updates. You can see various issues people open wanting support for older Ruby and Rails versions... I want to be able to update but I do try to keep a pretty wide support window for that reason.

I honestly prefer rubocop over standardrb...

yeah I understand on rubocop vs standardrb, everyone has some favorites there, I am more on the standardrb side of things as I don't want to tweak things to much... but I can try to totally remove rubocop as it seems like running Rubocop with the standardrb mode doesn't really work correctly. I will take a look at cleaning that up tonight.

@fatkodima
Copy link
Contributor Author

Reverted redis changes.

@danmayer danmayer merged commit c562891 into danmayer:main Nov 20, 2024
47 of 48 checks passed
@danmayer
Copy link
Owner

Thanks for all of this clean up, merged this main branch will be part of a major version release.

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