#93 JSON API: too limited ways to access data
Closed: Invalid None Opened 11 years ago by leamas.

The Json API is modeled from the idea that a test uses the "get_section" call to get information about the spec and make decisions from that. This model is too limited, missing at least:
- The review directories (ReviewDirs.srpm_unpacked et. al.), needed to access many files.
- The get_files() and get_files_by_pattern() to access source files.
- The find_tag() call to find a tag in the spec file.
- Access to the build dir (Mock.get_builddir())
- Access to generated rpms (Mock.get_resultdir, srpm.get_used_rpms())
- Access to rpmlint output (srpm.rpmlint_output).

Perhaps loopholes to execute arbitrary python code in the plugin context is also needed, since it's hard to foresee every need when making a plugin


Another aspect is that there is no registration done by the plugins. As a consequence, f-r doesn't know which tests the plugin will perform. Nor can f-r disable or run single tests. Instead, this must be done on the plugin path level which is, well, not optimal.

All plugins should register which tests they are able to run. There should also be hooks to disable or run a single test of these.

I have fixes (yet to be published) for the first problems to register and manage tests (comment:1)

Still, given that we seem to focus on the new script API, I think we should consider deprecating this API and close the bug as WONTFIX

Login to comment on this ticket.

Metadata