It seems like the `merge_dict` <update >I had made...
# development
b
It seems like the
merge_dict
update I had made introduced a bug. The logic of the previous
merge_dict
didn't actually match the comment it originally had. I detail the findings in my new PR and issue. • Issue: https://github.com/cloud-custodian/cloud-custodian/issues/10329 • PR: https://github.com/cloud-custodian/cloud-custodian/pull/10328 Let me know if you have any thoughts.
āœ… 1
Is there a way to check that the UpdateDistribution method is called? I am looking at some examples of mock_factory, but they are mostly checking for exceptions.
Added a check for it using mock
I was taking a look at it more and added another PR to revert the exception that was added to
merge_dict
as well: https://github.com/cloud-custodian/cloud-custodian/pull/10335
a
Is that in response to a case where you wanted c7n to merge types that the existing logic would call non-conformable? Or more of a conceptual fix?
b
More of a conceptual fix if we encounter it in the future but also because I don't want to break any other existing scenarios of merge_dict that I can't think of prior to my changes for partial-statement.
a
My concern there (highlighted by your test actually) is that the policy might "work" in a way that's more surprising than a non-conformable error. If we merge lists by appending them but tuples by replacing, I can see that being potentially more confusing than saying "whoa you can't merge these" and forcing a more careful look.
I do totally understand the impulse to say "we shouldn't bail just because I didn't see something coming" though šŸ˜…
(I'll drop a review on the PR too, just thinking/talking it through here also)
b
Yeah I will try to come to the community meeting tomorrow since I was also kind of on the fence about this too.
šŸ‘ 1