diff --git a/.github/versions.yml b/.github/versions.yml index 467f91ad92..ec146e2ee9 100644 --- a/.github/versions.yml +++ b/.github/versions.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0be439be24..156c7fc6a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index 02dd0a08aa..2efa9625f8 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -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 @@ -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 @@ -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 }} @@ -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" } } @@ -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' @@ -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 }} @@ -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 }} diff --git a/.github/workflows/ci_jruby.yml b/.github/workflows/ci_jruby.yml index 4f48127c64..ca72ecb3d2 100644 --- a/.github/workflows/ci_jruby.yml +++ b/.github/workflows/ci_jruby.yml @@ -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 @@ -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 diff --git a/.github/workflows/ci_special.yml b/.github/workflows/ci_special.yml index 46e3e0c9f3..c584f6d7b5 100644 --- a/.github/workflows/ci_special.yml +++ b/.github/workflows/ci_special.yml @@ -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 diff --git a/.github/workflows/config_docs.yml b/.github/workflows/config_docs.yml index 22aee84aec..b45984345c 100644 --- a/.github/workflows/config_docs.yml +++ b/.github/workflows/config_docs.yml @@ -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 diff --git a/.github/workflows/performance_tests.yml b/.github/workflows/performance_tests.yml index 1aceb9e60d..19987a61c8 100644 --- a/.github/workflows/performance_tests.yml +++ b/.github/workflows/performance_tests.yml @@ -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 diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 8ceb0aced4..1dbb8d5c6e 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a96f4a10c7..c0505d04ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/release_notes.yml b/.github/workflows/release_notes.yml index ed77a6748e..a70fa4b4d3 100644 --- a/.github/workflows/release_notes.yml +++ b/.github/workflows/release_notes.yml @@ -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 diff --git a/.github/workflows/release_pr.yml b/.github/workflows/release_pr.yml index ec1015ecbf..e2507ae607 100644 --- a/.github/workflows/release_pr.yml +++ b/.github/workflows/release_pr.yml @@ -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 diff --git a/.github/workflows/slack_notifications.yml b/.github/workflows/slack_notifications.yml index 0dd7074859..5b53187943 100644 --- a/.github/workflows/slack_notifications.yml +++ b/.github/workflows/slack_notifications.yml @@ -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 @@ -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 diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index e091c8ecf3..77b3240e8a 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -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 . Required when using the New Relic REST API v2 to record deployments using the `newrelic deployments` command.' }, :backport_fast_active_record_connection_lookup => { diff --git a/test/agent_helper.rb b/test/agent_helper.rb index f53f4b7af3..ae7dfea555 100644 --- a/test/agent_helper.rb +++ b/test/agent_helper.rb @@ -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) diff --git a/test/multiverse/suites/config_file_loading/Envfile b/test/multiverse/suites/config_file_loading/Envfile index 819a8a1039..c90f1707e8 100644 --- a/test/multiverse/suites/config_file_loading/Envfile +++ b/test/multiverse/suites/config_file_loading/Envfile @@ -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('../../../../') diff --git a/test/multiverse/suites/config_file_loading/config_file_loading_test.rb b/test/multiverse/suites/config_file_loading/config_file_loading_test.rb index 15b18c5cd2..953427bea7 100644 --- a/test/multiverse/suites/config_file_loading/config_file_loading_test.rb +++ b/test/multiverse/suites/config_file_loading/config_file_loading_test.rb @@ -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 diff --git a/test/new_relic/agent/configuration/manager_test.rb b/test/new_relic/agent/configuration/manager_test.rb index b574690a98..cc2bc78349 100644 --- a/test/new_relic/agent/configuration/manager_test.rb +++ b/test/new_relic/agent/configuration/manager_test.rb @@ -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