Closed okcleary closed 8 months ago
@okcleary Thanks for your contribution. This looks like a great feature and we have discussed in the Slack channel that I am currently running your branch locally to make sure nothing breaks for me. Could you help me to review this PR by explaining to me how we can be sure that the change is backwards-compatible and will not break anything for others?
@okcleary Thanks for your contribution. This looks like a great feature and we have discussed in the Slack channel that I am currently running your branch locally to make sure nothing breaks for me. Could you help me to review this PR by explaining to me how we can be sure that the change is backwards-compatible and will not break anything for others?
Thanks! There are two points to consider here for the backwards-compatibility of this change.
The first one is the decision to not change any of the existing merge strategies - using a different strategy is optin by the user, and the existing default strategy of each key is untouched by this PR.
The second point is the change to merging the stackgroup config, seen here:
Currently only the only key merged is dependencies
which is done explicitly. This PR changes it so the merge behaves in the same way as the stack merges - considering all keys that could be mergeable. This change is backwards compatible because all the other keys besides dependencies have child_wins
as the default strategy so the behaviour is the same as before.
Thanks @zaro0508, I've updated with the suggested documentation changes.
Add configuration for inheritance strategies for list and dict configs.
This resolves #1187 by allowing selecting a dict_merge strategy at a stack group/stack level, while remaining backwards compatible with existing stacks by retaining the default of child_wins.
This does not however address the example from the original issue of including tags of dependencies (or dependents?), as I don't believe this fits with the existing model (or makes sense as a use case).
This PR additionally adds the same support to all list and dict based configs.
The config for inheritance strategy itself is also inheritable, but not configurable.
From the original issue example:
Example: Assume Sceptre project A, B and C with dependency C -> B
root StackConfig config/config.yaml
config/prod/A.yaml
config/prod/C.yaml
config/prod/B.yaml
PR Checklist
[Resolve #issue-number]
.poetry run tox
) are passing.poetry run pre-commit run --all-files
).Approver/Reviewer Checklist
Other Information
Guide to writing a good commit