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

maint: drop support for Ruby < 2.5 and Rails < 5.0 #227

Merged
merged 13 commits into from
Jun 7, 2023

Conversation

robbkidd
Copy link
Member

@robbkidd robbkidd commented Jun 6, 2023

Which problem is this PR solving?

Old, unmaintained versions of things are starting to make the CI matrix of old combinations creak as the Ruby ecosystem starts to firmly drop support for those old, unmaintained versions.

Short description of the changes

  • Removes Ruby < 2.5 and Rails < 5.0 from the CI matrix
  • Remove examples/rails41
  • Change the beeline's required_ruby_version from ">= 2.2.0" to ">= 2.5.0"
  • Appease Rubocop violations for new TargetRubyVersion of 2.5

@robbkidd robbkidd requested a review from a team June 6, 2023 14:42
Old versions are starting to make CI creak under the strain of the
effort it takes to maintain the matrix of old combinations.

* Ruby 2.4 support was dropped 3 years ago (Mar 2020).

* Rails 4.2 support was dropped 6 years ago (Apr 2017)
@robbkidd robbkidd force-pushed the robb.what-if-we-drop-testing-ancient-to-antique-rubies branch from 7ef7f2c to ef7b7f4 Compare June 6, 2023 14:43
@JamieDanielson JamieDanielson added version: bump minor A PR that adds behavior, but is backwards-compatible. breaking-change Prefer 'version: bump major', but use this for breaking changes that don't bump major. labels Jun 6, 2023
Copy link
Contributor

@JamieDanielson JamieDanielson left a comment

Choose a reason for hiding this comment

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

it is time

@JamieDanielson JamieDanielson added version: bump major A PR that breaks backwards compatibility. and removed version: bump minor A PR that adds behavior, but is backwards-compatible. labels Jun 6, 2023
@robbkidd robbkidd self-assigned this Jun 6, 2023
@robbkidd
Copy link
Member Author

robbkidd commented Jun 6, 2023

Running RuboCop...
Inspecting 78 files
...C..........................................................................

Offenses:

honeycomb-beeline.gemspec:18:32: C: Gemspec/RequiredRubyVersion:
    required_ruby_version (2.5, declared in honeycomb-beeline.gemspec) and 
    TargetRubyVersion (2.2, which may be specified in .rubocop.yml) should be equal.
  spec.required_ruby_version = ">= 2.5.0"
                               ^^^^^^^^^^

OK … updating TargetRubyVersion in rubocop config to Ruby 2.5 …

❯ bundle exec rubocop --format offenses
 78/78 files

8   Layout/EmptyLinesAroundBlockBody
8   Layout/TrailingWhitespace
6   Layout/IndentationWidth
5   Style/RedundantFreeze
5   Style/SafeNavigation
4   Layout/RescueEnsureAlignment
4   Style/RedundantBegin
2   Layout/BlockAlignment
2   Performance/RegexpMatch
1   Style/UnpackFirst
--
45  Total

can open, worms everywhere

Workin' on it.

> Redundant begin block detected.

Yup. do..end blocks have an implicit 'begin' and rescue works fine
within them.
> Use 2 (not 4) spaces for indentation.

Sure. Yeah.
> Extra empty line detected at block body end.

Removed.
> Do not freeze immutable objects, as freezing them has no effect.

Sure. Note the frozen_string_literal declaration at the top of these
files.
> Use match? instead of =~ when MatchData is not used.

'match?' predicate methods introduced in Ruby 2.4 are faster than match
(which is called by =~) by avoiding the creation of a MatchData object
and not tracking backref.
> Use digest.unpack1("I!>") instead of digest.unpack("I!>").first

"‘String#unpack` can be replaced with the shorter method `unpack1`."
I'm just accepting this one. "Shorter" must mean the code *you* write
--for example, x.unpack("hey").first--because "unpack" on its own is 6
characters and "unpack1" is 7. :D
> Use safe navigation (&.) instead of checking if an object exists before calling the method.

Personally, I don't like how safe-nav reads, but my Ruby tastes were
established a long time ago. I won't fight the cop on this one.
@MikeGoldsmith
Copy link
Contributor

@robbkidd are you happy for this PR to be merged now?

@robbkidd
Copy link
Member Author

robbkidd commented Jun 7, 2023

@robbkidd are you happy for this PR to be merged now?

Yes. Yes, I am.

@robbkidd robbkidd merged commit 612ecac into main Jun 7, 2023
5 checks passed
@robbkidd robbkidd deleted the robb.what-if-we-drop-testing-ancient-to-antique-rubies branch June 7, 2023 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Prefer 'version: bump major', but use this for breaking changes that don't bump major. version: bump major A PR that breaks backwards compatibility.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing nightly build - Rails is unhappy
3 participants