Display value differences to actual environment #158
Merged
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.
Closes #151
When displaying a value from a different environment, this will now display differences to the value from the same file in the original environment of the node (if those exist).
From the issue:
I actually opted for a bit of both. I started by using the
diffy
gem (https://github.com/samg/diffy) to visualize the diff. This worked really nicely, but I (think) I initially switched original and changed value, so when displaying this vertically stacked it was not very clear which was which. Luckily,diffy
has a nice side-by-side functionality that I could use to create a table where I can use column headings to make it crystal clear which value is from which environment.This is how it looks (the node I selected is in the
globs
environment, but here I chosedevelopment
instead):The tabs are only displayed if there really is a differing value in the original environment. I am not 100% happy with the labels on the tabs ("Value" and "Diff"). If you have a better idea, please let me know.
The
diffy
gem actually shells out to the command linediff
utility, so this creates an implicit dependency on that. Given that it is available in most systems and more importantly in all official ruby docker images I think this is not a problem.