Skip to content

JSON input and output #20

@simevo

Description

@simevo

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions