Skip to content

Commit

Permalink
Fix DSL config source in diagnose report (#1307)
Browse files Browse the repository at this point in the history
It would only report the config options set the last time
`Appsignal.configure` was called, not all of them combined.
  • Loading branch information
tombruijn authored Sep 27, 2024
1 parent d81bbdf commit 27b9aff
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changesets/report-all-dsl-config-options-in-config-source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: patch
type: fix
---

Report all the config options set via `Appsignal.config` in the DSL config source in the diagnose report. Previously, it would only report the options from the last time `Appsignal.configure` was called.
2 changes: 1 addition & 1 deletion lib/appsignal/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def write_to_environment # rubocop:disable Metrics/AbcSize

# @api private
def merge_dsl_options(options)
@dsl_config = options
@dsl_config.merge!(options)
merge(options)
end

Expand Down
5 changes: 5 additions & 0 deletions spec/lib/appsignal/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,11 @@ def on_load
expect(config.dsl_config).to eq(dsl_config)
end

it "merges the options when called multiple times" do
config.merge_dsl_options(:extra_option => "yes")
expect(config.dsl_config).to eq(dsl_config.merge(:extra_option => "yes"))
end

describe "overriding system detected config" do
describe ":running_in_container" do
let(:dsl_config) { { :running_in_container => true } }
Expand Down

0 comments on commit 27b9aff

Please sign in to comment.