-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix compatibility with Ruby HEAD & add Ruby versions to CI #12
Fix compatibility with Ruby HEAD & add Ruby versions to CI #12
Conversation
I'm not sure if |
IMO, |
Yeah, I'm inclined to agree. I just went with this approach because it matches the current one, and I was unsure if there was a reason |
Okay, I looked into it, and I think if we just call |
I wrote this gem almost a decade ago (one month left!) in an evening. If there was a reason, I don't remember why, and even if there was, stuff has probably changed in the meantime. This change sounds good to me. |
Hm, I re-ran these failures and they're still persisting. Seems like a coveralls issue; I'm not particularly tied to coveralls in general, just seemed like good hygiene at the time. What do either of you think? I'm tempted to just say "let's rip it out." |
Does Coveralls provide any information about the coverage against the logger API, or only this gem's patches? |
I think Coveralls already does the setup, so we just need to stop calling I can look into it later. https://github.com/steveklabnik/mono_logger/blob/master/test/mri_logger_test.rb#L3-L7 |
@steveklabnik I've pushed another commit that seems to fix the double registration problem. |
Thank you! Two things I'm noticing now that I'm re-running this:
Really appreciate all the help here. |
I'm fine with removing Coveralls; I don't know if anyone else watching this PR has opinions. I've been trying to figure out the answer to why the format no longer matches. |
I was struggling with this, so I asked @indirect. And he found it.
The only thing that's confusing here is, this patch removes the space, but this is the only versions we're actually seeing with the space? That's very confusing? |
@indirect beat me to it again: this line adds it. Our test code is taken from the previous, old version of the test code, this new version adds it in. Sounds like we should call |
@steveklabnik I've
If you can trigger CI to double check, and it passes, I can clean up the commits and then this should be good to go! |
Looking great! Happy to click merge once you're happy with the commits :) Thank you so much again for all the help here. |
Starting SimpleCov multiple times produces an error on recent Ruby versions. We could fix this, but we're also uploading to a deprecated Coveralls endpoint, and aren't using it anyway, so it's simplest to remove it entirely.
The trailing whitespace changed upstream, and since we don't touch that code, and need to be compatible across Ruby versions, it is simplest to just make the test ignore it.
ruby/logger#85 added `@level_override` to the `Logger` initializer. Since we didn't call `super` in `initialize`, the variable was uninitialized, and we would run into a `NoMethodError` in `Logger#level` on Ruby HEAD: def level @level_override[Fiber.current] || @Level # ^^^^^^^^^^^^^^^ NoMethodError: undefined method `[]' for nil:NilClass end
6346af4
to
8a02cfa
Compare
@steveklabnik assuming CI still passes, it should be good to go now. |
@sambostock Thank you for the fix 🙌 |
Would you consider to release the newer version of mono_logger that includes this fix? Because Rails CI also runs Ruby 3.3.0dev that is failing as explained in resque/resque#1856 |
@yahonda released as 1.1.2! |
Thanks for the new release. |
Compatibility with Ruby HEAD is broken due to changes in ruby/logger#85.
See resque/resque#1856 for example.
ruby/logger#85 introduced setting
@level_override
ininitialize
. Since we don't callsuper
, we need to set it ourselves.This also adds Ruby
3.1
,3.2
, &HEAD
to the CI matrix.