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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make nix path-info --json return an object not array #9242

Merged
merged 4 commits into from
Nov 6, 2023

Commits on Nov 6, 2023

  1. Add comparison functions for NarInfo

    We will need these for tests.
    Ericson2314 committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    0b0d1b5 View commit details
    Browse the repository at this point in the history
  2. Shuffle ValidPathInfo JSON rendering

    `Store::pathInfoToJSON` was a rather baroque functions, being full of
    parameters to support both parsed derivations and `nix path-info`. The
    common core of each, a simple `dValidPathInfo::toJSON` function, is
    factored out, but the rest of the logic is just duplicated and then
    specialized to its use-case (at which point it is no longer that
    duplicated).
    
    This keeps the human oriented CLI logic (which is currently unstable)
    and the core domain logic (export reference graphs with structured
    attrs, which is stable), separate, which I think is better.
    Ericson2314 committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    937e02e View commit details
    Browse the repository at this point in the history
  3. Include compression in the NarInfo JSON format

    It was forgotten before.
    Ericson2314 committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    a7212e1 View commit details
    Browse the repository at this point in the history
  4. Make nix path-info --json return an object not array

    Before it returned a list of JSON objects with store object information,
    including the path in each object. Now, it maps the paths to JSON
    objects with the metadata sans path.
    
    This matches how `nix derivation show` works.
    
    Quite hillariously, none of our existing functional tests caught this
    change to `path-info --json` though they did use it. So just new
    functional tests need to be added.
    Ericson2314 committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    cc46ea1 View commit details
    Browse the repository at this point in the history