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

fix: instrumentation of Rails 7 #993

Merged
merged 3 commits into from
Nov 2, 2021

Conversation

jimeh
Copy link
Contributor

@jimeh jimeh commented Oct 25, 2021

ActionView instrumentation no longer fails by having it use the same
subscriber logic as used for Rails 6.

Also add Rails 7 Appraisals to all relevant gems which has any Rails
Appraisals.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 25, 2021

CLA Signed

The committers are authorized under a signed CLA.

@@ -17,7 +17,7 @@ module ActionView
def self.subscribe(pattern = nil, callable = nil)
ActiveSupport::Notifications.subscribe(pattern, callable)
::ActiveSupport::Notifications.notifier.synchronize do
if ::Rails::VERSION::MAJOR == 6
if ::Rails::VERSION::MAJOR >= 6
Copy link
Contributor

@SomalianIvan SomalianIvan Oct 28, 2021

Choose a reason for hiding this comment

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

With rails/rails#43282 (not sure if it's included with the alpha) we don't even need to adjust the ordering of subscribers.

Suggested change
if ::Rails::VERSION::MAJOR >= 6
if ::Rails::VERSION::MAJOR == 6

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, nice. However that PR was merged just over 3 weeks after the latest alpha was published, so it's definitely not included right now.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

ahayworth
ahayworth previously approved these changes Nov 2, 2021
Copy link
Contributor

@ahayworth ahayworth left a comment

Choose a reason for hiding this comment

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

This looks fine to me - once rails/rails#43282 is in a released version, we can definitely consider dropping our subscription-ordering hacks for Rails 7 and beyond. 😄

@ahayworth ahayworth dismissed their stale review November 2, 2021 13:33

Ah, tests are failing

@ahayworth
Copy link
Contributor

@jimeh I approved the Actions workflow runs for you - thank you for being a first time contributor! - but now the tests seem to be failing.

@jimeh
Copy link
Contributor Author

jimeh commented Nov 2, 2021

@ahayworth Thanks, and the test failures are rather annoying. I had it all passing locally.

I'll try and resolve the failures a bit later today when I'm free :)

jimeh added 2 commits November 2, 2021 15:27
ActionView instrumentation no longer fails by having it use the same
subscriber logic as used for Rails 6.

Also add Rails 7 Appraisals to all relevant gems which has any Rails
Appraisals.
@jimeh jimeh force-pushed the add-rails-7-support branch from c61950c to 7b2fc3d Compare November 2, 2021 15:28
@jimeh
Copy link
Contributor Author

jimeh commented Nov 2, 2021

Test failures were due to Rails 7.x requiring Ruby 2.7.0 or later. I've just pushed a fix (hopefully), and also rebased the PR on top of latest state of the main branch.

Copy link
Contributor

@ahayworth ahayworth left a comment

Choose a reason for hiding this comment

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

Awesome, looks good - thanks!

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.

4 participants