(#223) display diff for nested arrays of objects#224
(#223) display diff for nested arrays of objects#224masterzen wants to merge 8 commits intogithub:masterfrom
Conversation
6fa1e51 to
0f46be9
Compare
When using octocatalog-diff with puppet resources with deep nested datastructures such as nested arrays of objects, octocatalog- diff would not display diffs when array elements are modified,added or removed. In fact, it turns out `dig_out_key` doesn't descend into arrays index that hashdiff can produce, like for instance: testtype::test::parameters::testparam::another-one::an-array[0]::env `dig_out_key` would stop at `an-array` because it doesn't know that's and array index it should try to descend into. This patch adds the functionality for `dig_out_key` to follow array index and descend into those nested structure.
0f46be9 to
e4c3660
Compare
ahayworth
left a comment
There was a problem hiding this comment.
Could you add a few more test cases? I'm thinking specifically of cases where the arrays are not just one element apart, but when they differ more significantly.
|
@ahayworth , I'll do my best to add a few more tests. |
|
@masterzen - if you're able to add a few more specs, I'd like to target this for |
|
@ahayworth I'm very sorry, I thought I would be able to do that during the holidays, but alas I couldn't spare a minute. Unfortunately, I don't think I'll be able to add those tests before the 2.1.0 deadline :( |
|
Thanks! I'll see if I can work it in on my end. 😄 |
Overview
This pull request fixes #223.
When using octocatalog-diff with puppet resources with deep nested datastructures such as nested arrays of objects, octocatalog-diff would not display diffs when array elements are modified, added or removed.
In fact, it turns out
dig_out_keydoesn't descend into arrays index that hashdiff can produce, like for instance:testtype::test::parameters::testparam::another-one::an-array[0]::envdig_out_keywould stop atan-arraybecause it doesn't know that's and array index it should try to descend into.This patch adds the functionality for
dig_out_keyto follow array indices and descend into those nested structures.Checklist
rakein your checkout directory, or review the CI job triggered whenever you push to a pull request.rake coverage:specor ignoring untestable sections of code with# :nocovcomments. If you need help getting to 100% coverage please ask; however, don't just submit code with no tests..gemfile into the vendor/cache directory./cc #223