-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
Test against current and next Ruby and Rails versions #335
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes the following error: NameError: uninitialized constant Lograge::SimpleDelegator class SilentLogger < SimpleDelegator ^^^^^^^^^^^^^^^
This tweaks mostly work around the existing tests by disabling a couple cops.
Fixes an issue with the ruby/setup-ruby@v1 GitHub action where Rubocop fails while attempting to search the vendor/ directory.
The *.gemfile file extension appears to be well understood by rubocop and likely other tools.
These fixes were automatically made with: rubocop --auto-correct-all
Rubocop auto-corrected `data_clone.each.keys` to `data_clone.each_key` which resulted in the following error: RuntimeError: can't add a new key into hash during iteration To fix this, we use Hash#transform_keys (introduced in Ruby 2.5.0).
benlovell
approved these changes
Nov 17, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Definitely happy about the move to GitHub actions as well. Your comment on logstash-event
is spot on too. 🚀
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey folks! This pull request sets up continuous integration (CI) through GitHub Actions and tests against the following Ruby and Rails releases (see a successful build here):
HEAD
,3.1.0-preview1
,3.0
,2.7
,2.6
HEAD
,9.3
,9.2
HEAD
,21.3
Edge
,6.1
,6.0
,5.2
The versions listed above are actively maintained while other releases are beyond their end-of-life (EOL) are removed from the CI matrix.
Summary of changes
Dropping older Ruby and Rails versions
This may need some discussion but mainly, my rationale is that it would be better to point anyone dependent on older releases to older versions of the gem and continue forward with what's being supported by core maintainers. There's some interesting discussion in rspec/rspec-metagem#25 exploring how best to handle this kind of change and for a pre-1.0 project like this one, I think this is reasonable.
Switching from Travis CI to GitHub Actions
In retrospect, it might have been a good idea to ask about this beforehand! 😅 I like that the Ruby setup for GitHub Actions comes directly from the Ruby team (see
ruby/setup-ruby
) and it's nice to see everything in one UI. Otherwise, there isn't much of a difference. 🤷♀️lograge.gemspec
The following changes are made to
lograge.gemspec
:>= 2.5
is required. I felt pretty conflicted about this but I would prefer to move forward to what's currently supported.~> 3.1
(from>= 0
)~> 1.23
(from0.46.0
)~> 0.21
Rubocop
~> 1.23
These are the most notable changes that came as part of the upgrade to rubocop
~> 1.23
:Gemfile.*
to*.gemfile
rubocop --auto-correct-all
(code coverage suggests this was done without error)Formatters::Graylog2#call
is changed to useHash#transform_keys
instead of cloning and modifying with.each.keys
Future work
This was really fun to work on! I think it sets things up to a good spot where I can dive a little deeper. Some closing thoughts (mostly a reminder to myself):
rubocop-performance
and see if it can find and fix any low-hanging fruit. Off the top of my head, I know it will warn about the use ofdefine_method
inSilentLogger
.logstash-event
? It's such a strange dependency and I don't like that it's pinned to an old tag. I'm curious to see if we can rip that dependency out and serialize events without it.