Quoting Mikolaj Izdebski (2012-08-09 15:29:28)
> Examples are good, especially examples like these. To be fair, I
hadn't
> realized how simple things could be. Have you implemented this using a
> json plugin handling the communication between "your" plugins and f-r?!
Yes, I have implemented this as a single JSON plugin which basically:
1) asks F-R for all possible info (spec file scetions etc)
2) extracts more stuff on disk
3) reads metadata of all scripts
4) orders scripts basing on their dependencies
5) executes individual scripts
6) returns one reply to F-R containing results of all tests
I would love to release this code to the public, but I need to ask my
employer for consent before doing so.
And I see no reason why we couldn't add this JSON plugin directly into
f-r so that people can write these simple tests in shell (or whatever
decorated madness). We can install it by default into plugin directory,
and
JSONPlugin *almost* works (proved by Mikolaj being able to create
additional checks with it :-) ).
What is missing/wrong:
* Callback nature is sub-optimal. We can extract a lot of stuff and
place it in specific subdirectories in review dir similar to how
Mikolaj's plugins is already doing. We just do it automatically for
everyone (even internal plugins if they are so inclined).
* My original idea was that each group interested in certain package
type would create their "base" check and normal checks would be based
on that. So they would need to develop the JSON handling only once.
I'd even be inclined to package such wrappers directly in f-r to ease
stuff. It was not meant for each reviewer to create their own private
set of checks. And I still don't think we should be aiming there
primarily
So action items:
* Add basic information into ENV variables before calling plugins
* Add support for attachments (maybe I'll just scan contents of certain
fixed directory and consider each file as an attachment?)
* Create basic plugins in Perl/Ruby/whatever and install them in system
directories so tests can use them as their base tests in more simple
way without caring about JSON stuff. Plus we'll keep them updated
together with API if needed. We already have basic Perl stuff in the
example, just need to make it more modular so it can be reused.
* Include Mikolaj's plugin so people can create *really* simple stuff
with small shell scripts
Or does it sound really that bad?
--
Stanislav Ochotnicky <sochotnicky(a)redhat.com>
Software Engineer - Base Operating Systems Brno
PGP: 7B087241
Red Hat Inc.
http://cz.redhat.com