Skip to content

Commit

Permalink
[enriched-bugzillarest] Add new field is_open
Browse files Browse the repository at this point in the history
This code add the field `is_open` to know if the tiket is open.
Schema and test updated accordingly.

Signed-off-by: Quan Zhou <[email protected]>
  • Loading branch information
zhquan authored and valeriocos committed Apr 14, 2020
1 parent 48486d0 commit 578b494
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions grimoire_elk/enriched/bugzillarest.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ def get_rich_item(self, item):
eitem['time_to_last_update_days'] = None
eitem['url'] = None

# Add the field to know if the ticket is open
eitem['is_open'] = issue.get('is_open', None)

if 'long_desc' in issue:
eitem['number_of_comments'] = len(issue['long_desc'])
if 'comments' in issue:
Expand Down
1 change: 1 addition & 0 deletions schema/bugzilla.csv
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ creation_date,date
delta_ts,date
grimoire_creation_date,date
is_bugzilla_bug,long
is_open,boolean
labels,list
main_description,keyword
metadata__enriched_on,date
Expand Down
1 change: 1 addition & 0 deletions tests/test_bugzillarest.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def test_raw_to_enrich(self):
self.assertIn('main_description_analyzed', eitem)
self.assertIn('summary', eitem)
self.assertIn('summary_analyzed', eitem)
self.assertIn('is_open', eitem)

def test_enrich_repo_labels(self):
"""Test whether the field REPO_LABELS is present in the enriched items"""
Expand Down

0 comments on commit 578b494

Please sign in to comment.