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

HashRecursiveMerge: support arrays in recursive merge #1831

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nacc
Copy link

@nacc nacc commented Dec 14, 2021

Description

When HashRecursiveMerge currently encounters a non-Hash, it will simply return the "new" value. This is sub-optimal for cases where we might want to have some top-level defaults (e.g., for platforms) but certain cookbooks may want to define additional ones. The current code will only leverage the additional ones, instead of appending them to the global ones.

At this point, I'm looking for comments and if this seems like an appropriate direction, in which case I will add tests (and think harder about corner cases).

Issues Resolved

#650
#778

Check List

  • All tests pass. See TESTING.md for details.
  • New functionality includes testing.
  • New functionality has been documented in the README if applicable.

I am not 100% this is the right choice, but for our use-case, where we
will have top-level global platforms, and per-cookbook potential
additional platforms, we need something that allows them to be merged
together.

test-kitchen#778

Signed-off-by: Nishanth Aravamudan <[email protected]>
@nacc nacc force-pushed the naravamudan/support-arrays-in-recursive-merge branch from 0961368 to 55c2bdf Compare December 14, 2021 20:17
@nacc
Copy link
Author

nacc commented Dec 14, 2021

I realize that perhaps for safety purposes, we should maybe avoid changing the default behavior since it is used by the within-the-yaml merging (eg between suites, platforms). I think I can do that pretty easily by adding an opt-in parameter to rmerge.

@nacc
Copy link
Author

nacc commented Dec 14, 2021

I think the CI failures are the same as #1826

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.

None yet

1 participant