Skip to content

Commit

Permalink
Merge pull request #2170 from newrelic/roda_require_update
Browse files Browse the repository at this point in the history
Add require statement
  • Loading branch information
tannalynn authored Aug 18, 2023
2 parents eb110fc + 92281f7 commit c30e43c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
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

0 comments on commit c30e43c

Please sign in to comment.