splat icon indicating copy to clipboard operation
splat copied to clipboard

Handle merging (sub)segment lists in yaml merging

Open ethteck opened this issue 2 years ago • 0 comments

We support merging of multiple input yamls, but since segment and subsegments are lists, they won't properly be merged by the existing implementation of yaml merging.

Proposal: I think we need custom logic here in merge_configs:

# keys exist and match, see if a list to append
if type(main_config[curkey]) == list:
    main_config[curkey] += additional_config[curkey]

inside that if, something like

if curkey in ["segments", "subsegments"]:
    merge_segment_list(main_config[curkey], additional_config[curkey])

and then implement merge_segment_list so that it looks to see if segments in the additional config share a name with any in the main config. and if so, merge those with the same name, using merge_configs()

ethteck avatar Nov 24 '23 17:11 ethteck