#63 resolve-deps: Add a --json flag to get full output in JSON form
Merged by ncoghlan. Opened by ncoghlan.
modularity/ ncoghlan/fedmod issue-62-resolve-deps-json-output  into  master

Download 63.patch

(Rebased and amended from @otaylor's initial PR in https://pagure.io/modularity/fedmod/pull-request/47)

When --json is passed to fedmod resolve-deps, return output in JSON form that contains, for each package

  • The NVR of the package
  • The NVR of the corresponding source package
  • The package in the transaction that satisfied each requirement

This is intended to allow other tools to provide higher-level reporting or analysis while sharing the underlying data sources and dependency-reporting logic of fedmod.

In particular, @otaylor using this for tooling to create module contents based based on the contents of the "upstream" flatpak runtimes. Example report

The replacement PR is to account for the merge conflicts caused by other changes that have been made to fedmod (like switching the CLI processing over to click), and to revert back to the original "Dependency providers are reported as a list to account for the parallel provider case" behaviour.

It also adds the docs and tests that had been deferred until the desired behaviour had been determined.

2 new commits added

  • Add docs for 'resolve-deps --json'
  • Add a basic 'resolve-deps --json' test case

@otaylor @asamalik I think this PR is ready to go now - the new test is just a basic one to check for the expected output structure, but it exercises the end-to-end flow for the new option pretty well.

Pull-Request has been merged by ncoghlan

Metadata