The main goal of this PR is to allow JSON API to query for events by type and by the search_key. It should be possible to do queries like this:
Get all the modules which have been rebuilt as dependency of module build with id 123
Get all the Docker images which have been rebuilt because of errata advisory RHBA-2017-123 update.
...
In order to do these queries, we have to extend the Event table by Event type (so you can limit the query to just events triggered by Errata or MBS, or dist-git and so on) and add a key by which the events can be searched. The key is different per each event type. For dist-git, it is branch and commit hash, for MBS it is build ID and so on.
There is new modules.EVENT_TYPES list which gives each BaseEvent subclass database id. There is new BaseEvent.search_key property, which returns the key used for searching for every BaseEvent instance.
I'm not sure if the search_key is enough generally, but for the current events and other events I have in my mind currently it should be enough to just have single key to query on.
The main goal of this PR is to allow JSON API to query for events by type and by the
search_key. It should be possible to do queries like this:In order to do these queries, we have to extend the Event table by Event type (so you can limit the query to just events triggered by Errata or MBS, or dist-git and so on) and add a key by which the events can be searched. The key is different per each event type. For dist-git, it is branch and commit hash, for MBS it is build ID and so on.
There is new
modules.EVENT_TYPESlist which gives each BaseEvent subclass database id. There is newBaseEvent.search_keyproperty, which returns the key used for searching for every BaseEvent instance.I'm not sure if the search_key is enough generally, but for the current events and other events I have in my mind currently it should be enough to just have single key to query on.