-
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
Octocatalog-diff is missing diffs from some nested arrays of objects #223
Comments
masterzen
pushed a commit
to masterzen/octocatalog-diff
that referenced
this issue
May 14, 2020
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.
masterzen
pushed a commit
to masterzen/octocatalog-diff
that referenced
this issue
May 14, 2020
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.
5 tasks
masterzen
pushed a commit
to masterzen/octocatalog-diff
that referenced
this issue
May 14, 2020
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.
masterzen
pushed a commit
to masterzen/octocatalog-diff
that referenced
this issue
May 14, 2020
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When dealing with parameters that are contains arrays of objects, octocatalog-diff doesn't report any differences.
For instance the following Puppet resource:
Modifying any object of the
env
nested array (that is the keys or the values), or adding or removing objects from it will not trigger any diff to be displayed.The above commands just generate the following warning regarding the resource:
Note that there's no mention of the compilation directory in the parameters value, so there's no reason for it to be ignored.
Running with
--display-datatype-changes
still doesn't display the changes, but produces the following debug log:Interesting, apparently octocatalog-diff thinks both before and after parameters are
nil
.After looking at the code and debugging, it appears that the values of those nested parameters are removed in
hashdiff_nested_changes
and more precisely indig_out_key
.Indeed,
dig_out_key
doesn't seem to support array indices (likean-array[0]
) as key names and thus bails out returning nil without descending into the pointed object.Yes.
A PR will soon be published to fix this issue :)
The text was updated successfully, but these errors were encountered: