-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Allow diff-closures
to output json
#7243
base: master
Are you sure you want to change the base?
Conversation
What does the JSON output look like? |
Here's an excerpt of what I can get with {
"bash-interactive": {
"after": "∅",
"before": "∅",
"sizeDelta": "+6384.3"
},
"bind": {
"after": "9.18.7",
"before": "9.18.3",
"sizeDelta": "+44.8"
},
"blas": {
"after": "∅",
"before": "3",
"sizeDelta": "-56241.8"
},
"chrootenv": {
"after": "ε",
"before": "∅",
"sizeDelta": "+17.5"
},
...
} |
Can we use null, empty string or something that everyone knows how to type on their keyboard? |
Yeah, using
It would be nice to include the before/after store paths that are being compared. |
I favored consistency and kept the symbols in use in the "regular" display. |
I was just looking for a mean to exploit the data that is currently being rendered by |
cc7e8a4
to
cca1cf7
Compare
It would be cool to finish this! Nice to have JSON for all commands. |
I addressed the comments from the PR, either by updating the code, or by explaining why the display makes use of certain symbols. I didn't get any extra feedback here, and have asked for some on Matrix months ago without any replies. |
I enqueued this on the project board to try to get some feedback from the rest of the team. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-07-24-nix-team-meeting-minutes-75/31112/1 |
When the derivation name does not strictly follow the To help downstream users of this json, have you considered adding the Nix store paths for before/after in addition to only the version? That would also allow doing more than just display the before/after versions and size delta, like using external diff tools on the paths to get more diff information. |
Signed-off-by: Pamplemousse <git@xaviermaso.com>
Signed-off-by: Pamplemousse <git@xaviermaso.com>
cca1cf7
to
5915951
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.
In general I like this change, but I do have one critique about the output format. Granted, I'm not a maintainer, so my feedback isn't as binding as that of others might be.
"after": "20.08.1", | ||
"before": "20.08.2", | ||
"sizeDelta": 13900 | ||
}, |
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.
I share the concern that @SuperSandro2000 originally raised about these symbols not being typable on most keyboards, but I also understand that just null
is not explicit enough here because there are two different ways of a version not existing. As "after"
and "before"
can also contain multiple versions separated by commas, I would propose the following solution:
Make "after"
and "before"
lists of strings. ∅
(aka no version of this package exists/existed) is represented by an empty array []
, and ε
(aka an empty version of this package exists/existed) is represented by an array containing a single empty string [ "" ]
.
I feel this would make the output much more idiomatic to the semantics of JSON.
If you decide not to do this, I think it would at least be useful to add examples with ∅
, ε
and multiple versions here to show that the JSON output is exactly like the printed one.
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.
I like the idea.
However, I feel we should keep the two outputs (JSON, and regular print) consistent.
What do the other maintainers think about changing ε
for [ "" ]
and ∅
for []
in the old display?
No description provided.