Calculate independent reviewers as independent companies

Two or more independent reviewers are not co-workers and should be
calculated separately.

Change-Id: Ib3e978777557e52db64e715a07a21ecd8f0f7392
This commit is contained in:
Andrey Kurilin 2017-01-19 01:28:14 +02:00
parent aca45f3054
commit 50c31765c2
1 changed files with 5 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import functools
import os
import sys
import time
import uuid
import requests
import requests_cache
@ -107,6 +108,10 @@ def get_core_reviews_by_company(group):
'project_type=all&release=all&start_date=%s' %
(group, eng['id'], six_months)).json()['stats']:
company = stat['id']
if company == '*independent':
# several independent reviewers are not working in one company
company = 'independent-%s' % uuid.uuid4()
companies.setdefault(company, {'reviewers': 0, 'reviews': 0})
if eng['metric'] >= MIN_REVIEWS or eng['metric'] >= min_percent: