Skip to content

Commit

Permalink
[bugzillarest] Add keywords field to enriched indices
Browse files Browse the repository at this point in the history
This commit adds the 'keywords' field to the
enriched indices of bugzillarest.

Signed-off-by: Santiago Dueñas <[email protected]>
  • Loading branch information
sduenas committed Oct 8, 2024
1 parent 1eea904 commit 37ba407
Show file tree
Hide file tree
Showing 3 changed files with 25 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 @@ -124,6 +124,9 @@ def get_rich_item(self, item):
eitem["component"] = issue['component']
eitem["product"] = issue['product']

# Keywords
eitem["keywords"] = issue['keywords']

# Fix dates
date_ts = str_to_datetime(issue['creation_time'])
eitem['creation_ts'] = date_ts.strftime('%Y-%m-%dT%H:%M:%S')
Expand Down
8 changes: 8 additions & 0 deletions releases/unreleased/keywords-data-on-enriched-items.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Keywords data on enriched items
category: added
author: Santiago Dueñas <[email protected]>
issue: null
notes: >
Keywords field is included now on the enriched
items of bugzilla and bugzillarest indices.
14 changes: 14 additions & 0 deletions tests/test_bugzillarest.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ def test_enrich_repo_labels(self):
eitem = enrich_backend.get_rich_item(item)
self.assertIn(REPO_LABELS, eitem)

def test_enrich_keywords(self):
"""Test whether keywords are included on the enriched items"""

self._test_raw_to_enrich()
enrich_backend = self.connectors[self.connector][2]()

for item in self.items[0:5]:
eitem = enrich_backend.get_rich_item(item)
self.assertEqual(eitem['keywords'], [])

item = self.items[6]
eitem = enrich_backend.get_rich_item(item)
self.assertEqual(eitem['keywords'], ['crash', 'regression'])

def test_raw_to_enrich_sorting_hat(self):
"""Test enrich with SortingHat"""

Expand Down

0 comments on commit 37ba407

Please sign in to comment.