Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings files with string keys clobbers settings instead of merging #23168

Open
Fryguy opened this issue Aug 30, 2024 · 1 comment
Open

Settings files with string keys clobbers settings instead of merging #23168

Fryguy opened this issue Aug 30, 2024 · 1 comment
Assignees
Labels

Comments

@Fryguy
Copy link
Member

Fryguy commented Aug 30, 2024

If a config/settings.local.yml file is present, and the internal keys are strings, then it clobbers settings from other sections.

  1. Create a config/settings.local.yml file such as

    prototype:
      test: test
  2. Open a rails console

  3. See that other settings are gone
    Before:

    > Settings.prototype.to_hash
    => {:amazon=>{:s3=>false}, :ems_vmware=>{:allow_direct_hosts=>false}, :ems_workflows=>{:enabled=>true}}

    After

    > Settings.prototype.to_hash
    => {:test=>"test"}

Note that if you use symbol keys the merging works fine

:prototype:
  :test: test
> Settings.prototype.to_hash
=> {:amazon=>{:s3=>false}, :ems_vmware=>{:allow_direct_hosts=>false}, :ems_workflows=>{:enabled=>true}, :test=>"test"}

I've created #23167 to at least give a clue that changes are present, since the settings.local.yml file is gitignored.

@Fryguy Fryguy added the bug label Aug 30, 2024
@Fryguy Fryguy changed the title settings.local.yml files with string keys clobbers settings instead of merging Settings files with string keys clobbers settings instead of merging Aug 30, 2024
@Fryguy
Copy link
Member Author

Fryguy commented Aug 30, 2024

Note that if you modify non-local files (e.g. config/settings.yml) with string keys this also happens. I've changed the Issue title to reflect that it's really any settings files.

@Fryguy Fryguy self-assigned this Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant