Skip to content
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

Display value differences to actual environment #158

Merged
merged 3 commits into from
Jun 15, 2023
Merged

Display value differences to actual environment #158

merged 3 commits into from
Jun 15, 2023

Conversation

oneiros
Copy link
Collaborator

@oneiros oneiros commented May 31, 2023

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:

we see a table [...] or we show a unified diff.

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 chose development instead):

image

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 line diff 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.

If a key is displayed from a different environment
than the node is actually in _and_ a file with
the same path exists in the original environment
_and_ the value in that file differs from the one
displayed, show the differences.

Uses the `diffy` gem to highlight the differences.
@oneiros oneiros requested a review from a team as a code owner May 31, 2023 13:24
@tuxmea tuxmea merged commit 165e89b into main Jun 15, 2023
@tuxmea tuxmea deleted the issue-151 branch June 15, 2023 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show current used values when selecting nodes from different environment
3 participants