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

Add require statement #2170

Merged
merged 6 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# New Relic Ruby Agent Release Notes

## v9.4.2

Version 9.4.2 of the agent re-addresses the 9.4.0 issue of `NoMethodError` seen when using the `uppy-s3_multipart` gem.

- **Bugfix: Resolve NoMethodError**

Ruby agent 9.4.1 attempted to fix a `NoMethodError` introduced in 9.4.0. A missing `require` prevented a method from scoping appropriately and has now been added. Thanks to [@spickermann](https://github.com/spickermann) and [@ColinOrr](https://github.com/ColinOrr) for working with us to get this resolved. [PR#2167](https://github.com/newrelic/newrelic-ruby-agent/pull/2167)

## v9.4.1

Version 9.4.1 of the agent resolves a `NoMethodError` introduced in 9.4.0.
Expand Down
1 change: 1 addition & 0 deletions lib/new_relic/agent/instrumentation/roda.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# frozen_string_literal: true

require_relative 'roda/instrumentation'
require_relative 'roda/roda_transaction_namer'

DependencyDetection.defer do
named :roda
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module TransactionNamer
extend self

ROOT = '/'.freeze
REGEX_MULTIPLE_SLASHES = %r{^[/^\A]*(.*?)[/$?\z]*$}.freeze
REGEX_MULTIPLE_SLASHES = %r{^[/^]*(.*?)[/$?]*$}.freeze

def transaction_name(request)
path = request.path || ::NewRelic::Agent::UNKNOWN_METRIC
Expand Down
7 changes: 7 additions & 0 deletions test/multiverse/suites/roda/roda_instrumentation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ def test_roda_instrumentation_works_if_middleware_disabled
end
end

def test_roda_namer_removes_rogue_slashes
get('/home//')
txn = harvest_transaction_events![1][0]

assert_equal 'Controller/Roda/RodaTestApp/GET home', txn[0]['name']
end

def test_transaction_name_error
NewRelic::Agent.stub(:logger, NewRelic::Agent::MemoryLogger.new) do
# pass in {} to produce an error, because {} doesn't support #path and
Expand Down