forked from ripienaar/puppet-catalog-diff
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fixup - enhancements! #47
Open
trlinkin
wants to merge
7
commits into
acidprime:master
Choose a base branch
from
trlinkin:fixup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit adds a new, more intelligent formatter method for consuming identified parameter differences between the catalogs. This formatter tries to show values side by side for simple comparison. This formatter is a basic first attempt and will be enhanced later.
Without this commit, the "differ" was not using functional routines that would correctly consume catalogs from disk. Methods like `from_pson` are no longer available. The "differ" also has implicit code for reading '.json' extensions despite not having it documented that they were valid. This commit removes the ability to attempt to handle JSON catalogs. When it comes to PSON catalogs, it will use the appropriate and verified working method available in Puppet 4. This commit also sorts some of the results of the "diffing" process for cleaner presentation later.
Without this commit, the "diff" face had a few different problems. The simple ones were a matter of unreadable code. The more important issue was the lazy method by which data coming out of the "differ" was formatted and presented. This commit starts by re-tabbing the whole document. The lines trying to output to the console were also difficult to read and a bit of a mess. They were split out into a more usable form. This commit also takes advantage of the new method of presenting parameter differences that has been added to the formatter.
The code that sends the differ output off to be formatted takes a somewhat simple approach of treating data generically. To present the param diff data in a more usable manner, a purpose specific method has been created. We need to make sure this method gets used instead of the generic formatting approach for this data. Right now the approach taken for keeping that data from going through the generic method is wrong. A lack of understanding since the code is sort of dense. This commit ensures that the param data not be passed through the generic formatting loop. It also ensures that the param data that gets passed is actually coming from the correct place.
This commit ensures that the output generated by the param diff formatter. This commit also corrects an issue where the name of the resource in question was not being passed correctly.
This commit enables the presentation of resources in "diff" format as a default. The command line flag "display_resource_diff" has been changed to "no_resource_diff" to be used to disable the behavior.
This commit adds back the code for loading PSON files and JSON files in Puppet 3.x. It also ensures that the correct loading method is used between 3.x and 4.x versions of Puppet. In Puppet 4.x it raises an error when trying to load JSON catalogs. There was not an obvious method for loading these files that could be found, additionally a JSON catalog could not be found to test with.
Nice changes in there. If you're still interested, would you mind rebasing them against https://github.com/camptocamp/puppet-catalog-diff ? |
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.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some general changes for the tool to make output more instantly useful. Also, now it can load catalogs on Puppet 4, so thats cool I guess.