Implement logs model using Elasticsearch

- Implement logs model using Elasticsearch with tests
- Implement transition model using both elasticsearch and database model
- Add LOGS_MODEL configuration to choose which to use.

Co-authored-by: Sida Chen <sidchen@redhat.com>
Co-authored-by: Kenny Lee Sin Cheong <kenny.lee@redhat.com>
This commit is contained in:
Kenny Lee Sin Cheong 2019-01-21 16:33:32 -05:00 committed by Sida Chen
parent 40c0352dd1
commit 035541c6f2
20 changed files with 1282 additions and 38 deletions

View file

@ -117,7 +117,7 @@ def log_action(kind_name, user_or_organization_name, performer=None, repository=
else:
account = config.app_config.get('SERVICE_LOG_ACCOUNT_ID')
if account is None:
account = User.select(fn.Min(User.id)).tuples().get()[0]
account = user.get_minimum_user_id()
if performer is not None:
performer = performer.id