Skip to content

Conversation

@github-actions
Copy link
Contributor

Automated PR for 10.0.0 release

hannahramadan and others added 30 commits November 12, 2025 11:52
…oyments

Remove `newrelic deployments` and Capistrano support
Rename `bin/newrelic` to `bin/newrelic_rpm`
Co-authored-by: Kayla Reopelle <[email protected]>
Co-authored-by: Kayla Reopelle <[email protected]>
Remove Language Agent Security Policies (LASP)
…nvalid

Validate `record_custom_event` type
* Add `logger` as a dependency for Ruby 4.0 support. Also, update some tests to include `benchmark`.
@github-actions
Copy link
Contributor Author

SimpleCov Report

Coverage Threshold
Line 93.56% 93%

tannalynn and others added 27 commits December 18, 2025 09:10
## Summary
Fixes test failure when running with Bundler 4.0+ by skipping a test that validates behavior for old Bundler versions that no longer applies.

## Problem
The test `test_rubygems_specs_works_with_all_specs_when_installed_specs_is_absent` was failing with Bundler 4.0.3+ because:
- Bundler 4.0 removed `Bundler.rubygems.all_specs` in favor of `Bundler.rubygems.installed_specs`
- The test was attempting to simulate old Bundler behavior by stubbing `respond_to?` and then calling `all_specs`
- Since `all_specs` no longer exists in Bundler 4.0+, this raises a `Bundler::RemovedError`

## Solution
Added a skip condition to the test when running with Bundler 4.0+, as the scenario it tests (old Bundler without `installed_specs`) is no longer relevant for modern Bundler versions.

The implementation code in `lib/new_relic/helper.rb` already handles this correctly by:
1. First checking if `installed_specs` is available (Bundler 2.5.12+)
2. Falling back to `all_specs` only for very old Bundler versions
This PR fixing warning when run test.

```
❯ bundle exec rake
/Users/ydah/newrelic-ruby-agent/test/new_relic/agent/configuration/default_source_test.rb:313: warning: assigned but unused variable - default
/Users/ydah/newrelic-ruby-agent/test/new_relic/agent/configuration/sampler_config_validator_test.rb:46: warning: assigned but unused variable - config_value
/Users/ydah/newrelic-ruby-agent/test/new_relic/agent/datastores_test.rb:188: warning: assigned but unused variable - elapsed
/Users/ydah/newrelic-ruby-agent/test/new_relic/agent/transaction/distributed_tracing_test.rb:590: warning: assigned but unused variable - parent_priority
/Users/ydah/newrelic-ruby-agent/test/new_relic/agent/transaction/distributed_tracing_test.rb:663: warning: assigned but unused variable - parent_sampled
/Users/ydah/newrelic-ruby-agent/test/new_relic/dependency_detection_test.rb:477: warning: assigned but unused variable - execution_took_place
/Users/ydah/newrelic-ruby-agent/test/new_relic/newrelicyml_test.rb:115: warning: assigned but unused variable - config_hash
```
1. Migrate to the plugin system in .rubocop.yml (replaced `require` with `plugins`).
2. Rename `Naming/PredicateName` to `Naming/PredicatePrefix`.
3. Remove redundant `Metrics/AbcSize` disable directives from:
   - lib/new_relic/agent/instrumentation/curb/chain.rb
   - lib/new_relic/agent/span_event_primitive.rb
   - lib/new_relic/agent/transaction.rb
Fix test compatibility with Bundler 4.0+ (all_specs removal)
Introduce version comparison helper method(s)
Bump rubocop and related plugin versions
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.

7 participants