Skip to content

Commit

Permalink
Merge pull request #2894 from newrelic/ruby-3-4-0-preview-2
Browse files Browse the repository at this point in the history
Test Ruby 3.4.0-preview2
  • Loading branch information
kaylareopelle authored Oct 10, 2024
2 parents f7803d5 + c0091a3 commit c96ac53
Show file tree
Hide file tree
Showing 17 changed files with 65 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .github/versions.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
# This file is consumed by lib/tasks/gha.rake
ruby/setup-ruby:
:tag: v1.191.0
:sha: 52753b7da854d5c07df37391a986c76ab4615999
:tag: v1.196.0
:sha: f26937343756480a8cb3ae1f623b9c8d89ed6984
actions/checkout:
:tag: v4.1.7
:sha: 692973e3d937129bcbf40652eb9f2f61becf3332
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7
- uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
- uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: '3.3'
- run: bundle
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev

- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: ${{ matrix.ruby-version }}

Expand Down Expand Up @@ -231,7 +231,7 @@ jobs:
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev

- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: ${{ matrix.ruby-version }}

Expand Down Expand Up @@ -324,7 +324,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7

- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: ${{ matrix.ruby-version }}

Expand Down Expand Up @@ -364,7 +364,7 @@ jobs:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7
- uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
- uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: '3.3'
- run: bundle
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7
- uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
- uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: '3.3'
- run: bundle
Expand All @@ -36,7 +36,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.5, 3.3.5, 3.4.0-preview1]
ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.5, 3.3.5, 3.4.0-preview2]

steps:
- name: Configure git
Expand All @@ -50,7 +50,7 @@ jobs:
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev

- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: ${{ matrix.ruby-version }}

Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
"3.3.5": {
"rails": "norails,rails61,rails70,rails71,rails72,railsedge"
},
"3.4.0-preview1": {
"3.4.0-preview2": {
"rails": "norails,rails61,rails70,rails71,rails72"
}
}
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
fail-fast: false
matrix:
multiverse: [agent, ai, background, background_2, database, frameworks, httpclients, httpclients_2, rails, rest]
ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.5, 3.3.5, 3.4.0-preview1]
ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.5, 3.3.5, 3.4.0-preview2]
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
Expand All @@ -243,7 +243,7 @@ jobs:
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev

- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: ${{ matrix.ruby-version }}

Expand Down Expand Up @@ -308,14 +308,14 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby-version: [2.7.8, 3.0.7, 3.1.6, 3.2.5, 3.3.5, 3.4.0-preview1]
ruby-version: [2.7.8, 3.0.7, 3.1.6, 3.2.5, 3.3.5, 3.4.0-preview2]
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7

- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: ${{ matrix.ruby-version }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_jruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7

- name: Install JRuby
uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: jruby-9.4.8.0

Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7

- name: Install JRuby
uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: jruby-9.4.8.0

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci_special.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
- name: Install OS packages
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev

- name: Install Ruby 3.4.0-preview1
uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
- name: Install Ruby 3.4.0-preview2
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: 3.4.0-preview1
ruby-version: 3.4.0-preview2

- name: Setup bundler
run: ./.github/workflows/scripts/setup_bundler
env:
RUBY_VERSION: 3.4.0-preview1
RUBY_VERSION: 3.4.0-preview2

- name: Run Unit Tests
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/config_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
pull-requests: write
steps:
- name: Install Ruby 3.3
uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: 3.3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/performance_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7
with:
ref: 'main'
- uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
- uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: '3.3'
- run: bundle
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
pull-requests: write
steps:
- name: Install Ruby 3.3
uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: 3.3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
fetch-depth: 0

- uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
- uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: 3.3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
contents: write
pull-requests: write
steps:
- uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
- uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: 3.3
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
pull-requests: write
steps:
- name: Install Ruby 3.3
uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: 3.3

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/slack_notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
gem_notifications:
runs-on: ubuntu-22.04
steps:
- uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
- uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: 3.3
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
cve_notifications:
runs-on: ubuntu-22.04
steps:
- uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # tag v1.191.0
- uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # tag v1.196.0
with:
ruby-version: 3.3
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7
Expand Down
1 change: 1 addition & 0 deletions lib/new_relic/agent/configuration/default_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil)
:public => true,
:type => String,
:allowed_from_server => false,
:exclude_from_reported_settings => true,
:description => 'Your New Relic <InlinePopover type="userKey" />. Required when using the New Relic REST API v2 to record deployments using the `newrelic deployments` command.'
},
:backport_fast_active_record_connection_lookup => {
Expand Down
2 changes: 1 addition & 1 deletion test/agent_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def assert_log_contains(log, message)
lines = log.array

assert (lines.any? { |line| line.match(message) }),
"Could not find message. Log contained: #{lines.join("\n")}"
"Could not find message: '#{message.inspect}'. Log contained: #{lines.join("\n")}"
end

def assert_audit_log_contains(audit_log_contents, needle)
Expand Down
22 changes: 18 additions & 4 deletions test/multiverse/suites/config_file_loading/Envfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,34 @@

omit_collector!

# TODO: RUBY 3.4
# The CI has a prism-related error when it tries to run this suite
# The problem may be a bug fixed in future preview releases
# Disable ths suite for now, and try again when the next version
# is out.
PSYCH_VERSIONS = [
[nil],
['4.0.0', 2.4],
['3.3.0', 2.4]
[nil, 2.4, 3.3],
['4.0.0', 2.4, 3.3],
['3.3.0', 2.4, 3.3]
]

def stringio_version
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4')
"gem 'stringio', '3.1.2.dev'"
else
"gem 'stringio'"
end
end

def gem_list(psych_version = nil)
<<~RB
#{stringio_version}
# stub file system so we can test that newrelic.yml can be loaded from
# various places.
gem 'fakefs', :require => false

gem 'psych'#{psych_version}
gem 'jar-dependencies', '0.4.1' if RUBY_PLATFORM == 'java'
gem 'jar-dependencies', '0.4.1' if RUBY_PLATFORM == 'java'

# don't start the agent
gem 'newrelic_rpm', :require => false, :path => File.expand_path('../../../../')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,20 @@ def test_warning_logged_when_config_file_yaml_parsing_error
assert_log_contains(log, /ERROR.*Failed to read or parse configuration file at config\/newrelic\.yml/)
end

def test_warning_logged_when_config_file_erb_error
path = File.join(@cwd, 'config', 'newrelic.yml')
setup_config(path, {}, "\n\n\n<%= this is not ruby %>") # the error is on line 4
setup_agent

log = with_array_logger { NewRelic::Agent.manual_start }

assert_log_contains(log, /ERROR.*Failed ERB processing/)
assert_log_contains(log, /\(erb\):4/)
# TODO: RUBY 3.4 SUPPORT
# Both error class and output have changes in Ruby 3.4
# See Issue: https://github.com/newrelic/newrelic-ruby-agent/issues/2902
unless Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0')
def test_warning_logged_when_config_file_erb_error
path = File.join(@cwd, 'config', 'newrelic.yml')
setup_config(path, {}, "\n\n\n<%= this is not ruby %>") # the error is on line 4
setup_agent

log = with_array_logger { NewRelic::Agent.manual_start }

assert_log_contains(log, /ERROR.*Failed ERB processing/)
assert_log_contains(log, /\(erb\):4/)
end
end

def test_exclude_commented_out_erb_lines
Expand Down
4 changes: 2 additions & 2 deletions test/new_relic/agent/configuration/manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,8 @@ def test_unsatisfied_values_stay_cached
def test_logger_does_not_receive_excluded_settings
log = with_array_logger(:debug) { @manager.log_config('direction', 'source') }.array.join('')

assert_includes(log, ':app_name')
refute_includes(log, ':license_key')
assert_includes(log, 'app_name')
refute_includes(log, 'license_key')
end

def test_reset_cache_return_early_for_jruby
Expand Down

0 comments on commit c96ac53

Please sign in to comment.