From 873da5f4f14ac8098e2b3cd4941db62645ae7610 Mon Sep 17 00:00:00 2001 From: hramadan Date: Thu, 17 Aug 2023 08:53:17 -0700 Subject: [PATCH 1/5] Add require statment --- CHANGELOG.md | 8 ++++++++ lib/new_relic/agent/instrumentation/roda.rb | 1 + 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 107ea6dad2..705df70244 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # New Relic Ruby Agent Release Notes +## v9.4.2 + +Version 9.4.2 of the agent re-addresses a `NoMethodError` introduced in 9.4.0. + +- **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. diff --git a/lib/new_relic/agent/instrumentation/roda.rb b/lib/new_relic/agent/instrumentation/roda.rb index f55553572d..2606c602d3 100644 --- a/lib/new_relic/agent/instrumentation/roda.rb +++ b/lib/new_relic/agent/instrumentation/roda.rb @@ -3,6 +3,7 @@ # frozen_string_literal: true require_relative 'roda/instrumentation' +require_relative 'roda/roda_transaction_namer' DependencyDetection.defer do named :roda From 419fe18b96145aa75bac7b53bde9fa037eb6f546 Mon Sep 17 00:00:00 2001 From: hramadan Date: Thu, 17 Aug 2023 10:05:10 -0700 Subject: [PATCH 2/5] Add regex test --- test/multiverse/suites/roda/roda_instrumentation_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/multiverse/suites/roda/roda_instrumentation_test.rb b/test/multiverse/suites/roda/roda_instrumentation_test.rb index 16b88a603d..2d77eb861c 100644 --- a/test/multiverse/suites/roda/roda_instrumentation_test.rb +++ b/test/multiverse/suites/roda/roda_instrumentation_test.rb @@ -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 From e5563abe178030407df2c696386ad8b31127b04e Mon Sep 17 00:00:00 2001 From: hramadan Date: Thu, 17 Aug 2023 10:05:29 -0700 Subject: [PATCH 3/5] Update regex --- .../agent/instrumentation/roda/roda_transaction_namer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/new_relic/agent/instrumentation/roda/roda_transaction_namer.rb b/lib/new_relic/agent/instrumentation/roda/roda_transaction_namer.rb index 2985a2a6f0..82b284694e 100644 --- a/lib/new_relic/agent/instrumentation/roda/roda_transaction_namer.rb +++ b/lib/new_relic/agent/instrumentation/roda/roda_transaction_namer.rb @@ -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 From 7922937e8873b2d31941120643540e5f4cb08c7f Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Fri, 18 Aug 2023 10:23:41 -0700 Subject: [PATCH 4/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 705df70244..b784003873 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## v9.4.2 -Version 9.4.2 of the agent re-addresses a `NoMethodError` introduced in 9.4.0. +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** From 1646af9c5ea1bdea9878049cfc2995c04240892e Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Fri, 18 Aug 2023 10:23:46 -0700 Subject: [PATCH 5/5] Update CHANGELOG.md Co-authored-by: Kayla Reopelle (she/her) <87386821+kaylareopelle@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b784003873..e32ad1a6a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Version 9.4.2 of the agent re-addresses the 9.4.0 issue of `NoMethodError` seen - **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) + 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