-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(#223) display diff for nested arrays of objects #224
base: master
Are you sure you want to change the base?
(#223) display diff for nested arrays of objects #224
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_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