(#223) display diff for nested arrays of objects #224
+90
−3
Conversation
6fa1e51
to
0f46be9
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
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
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_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 atan-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 indices and descend into those nested structures.Checklist
rake
in your checkout directory, or review the CI job triggered whenever you push to a pull request.rake coverage:spec
or ignoring untestable sections of code with# :nocov
comments. If you need help getting to 100% coverage please ask; however, don't just submit code with no tests..gem
file into the vendor/cache directory./cc #223