diff --git a/dashboard/decorators.py b/dashboard/decorators.py index daff6a225..088e9f641 100644 --- a/dashboard/decorators.py +++ b/dashboard/decorators.py @@ -172,7 +172,7 @@ def mark_filter(result, record, param_id): result_by_param['metric'] += 1 result_by_param[value] = result_by_param.get(value, 0) + 1 - if record.get('x'): + if record.get('disagreement'): result_by_param['disagreements'] = ( result_by_param.get('disagreements', 0) + 1) diff --git a/dashboard/vault.py b/dashboard/vault.py index c01daa7fb..49ac91064 100644 --- a/dashboard/vault.py +++ b/dashboard/vault.py @@ -31,7 +31,8 @@ LOG = logging.getLogger(__name__) RECORD_FIELDS_FOR_AGGREGATE = ['record_id', 'primary_key', 'record_type', 'company_name', 'module', 'user_id', 'release', 'date', 'week', 'author_name', 'loc', 'type', - 'x', 'value', 'status', 'blueprint_id'] + 'disagreement', 'value', 'status', + 'blueprint_id'] def compact_records(records): diff --git a/stackalytics/processor/record_processor.py b/stackalytics/processor/record_processor.py index 8639a62da..47bb7a0b2 100644 --- a/stackalytics/processor/record_processor.py +++ b/stackalytics/processor/record_processor.py @@ -664,8 +664,8 @@ class RecordProcessor(object): disagreement = ((core_mark != 0) and ((core_mark < 0 < mark['value']) or (core_mark > 0 > mark['value']))) - old_disagreement = mark.get('x') - mark['x'] = disagreement + old_disagreement = mark.get('disagreement', False) + mark['disagreement'] = disagreement if old_disagreement != disagreement: yield mark diff --git a/tests/unit/test_record_processor.py b/tests/unit/test_record_processor.py index a61140d4f..76decd24b 100644 --- a/tests/unit/test_record_processor.py +++ b/tests/unit/test_record_processor.py @@ -988,17 +988,17 @@ class TestRecordProcessor(testtools.TestCase): homer_mark = next(itertools.ifilter( lambda x: x['date'] == (timestamp - 1), marks), None) - self.assertTrue(homer_mark.get('x'), + self.assertTrue(homer_mark.get('disagreement'), msg='Disagreement: core set -2 after +2') homer_mark = next(itertools.ifilter( lambda x: x['date'] == (timestamp + 2), marks), None) - self.assertFalse(homer_mark.get('x'), + self.assertFalse(homer_mark.get('disagreement'), msg='No disagreement: core set +2 after +1') bart_mark = next(itertools.ifilter( lambda x: x['date'] == (timestamp + 3), marks), None) - self.assertTrue(bart_mark.get('x'), + self.assertTrue(bart_mark.get('disagreement'), msg='Disagreement: core set +2 after -1') def test_commit_merge_date(self):