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

JSON input and output #20

Open
simevo opened this issue Apr 25, 2020 · 0 comments
Open

JSON input and output #20

simevo opened this issue Apr 25, 2020 · 0 comments
Assignees

Comments

@simevo
Copy link

simevo commented Apr 25, 2020

It would be handy to cache the output of dose-ceve (see the TODO "Cache this output ..." at line 148).
Also, getting the ratt run results in JSON format opens the way for a few interesting use cases, including ratt-as-a-service.

The output JSON format would be such that with some basic filtering it can be used to feed ratt with the list of packages to build.
For example when passed the -jsonout ratt.json option, ratt would output the following JSON file:

{
  "start": 2147483647,
  "end": 2147483647,
  "changes": "../texinfo_6.7.0.dfsg.2-5_amd64.changes",
  "debs": ["../info-dbgsym_6.7.0.dfsg.2-5_amd64.deb",
    "../info_6.7.0.dfsg.2-5_amd64.deb",
    "../install-info-dbgsym_6.7.0.dfsg.2-5_amd64.deb",
    "../install-info_6.7.0.dfsg.2-5_amd64.deb",
    "../texinfo-dbgsym_6.7.0.dfsg.2-5_amd64.deb",
    "../texinfo_6.7.0.dfsg.2-5_amd64.deb"
  ],
  "built": [{
      "package": "kdbusaddons",
      "status": "passed",
      "time": 1234
    },
    {
      "package": "libltcsmpte",
      "status": "failed",
      "time": 567
    },
    {
      "package": "libevhtp",
      "status": "maybe",
      "time": 890
    },
    {
      "package": "libtheora",
      "status": "passed",
      "time": 123
    }
  ]
}

This file can be easily filtered with jq, as in:

cat ratt.json | jq '[.built | .[] | select(.time < 600) | .package]'
cat ratt.json | jq '[.built | .[] | select(.status == "failed") | .package]'

obtaining for example:

[
  "libltcsmpte",
  "libtheora"
]

This format would be suitable for input, i.e. when ratt is started with -jsonin ratt1.json passing the above file, it would skip invoking dose-ceve and start rebuilding the libltcsmpte and libtheora packages straightaway.

@creekorful creekorful self-assigned this Nov 10, 2021
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

No branches or pull requests

2 participants