Skip to content

Commit

Permalink
Add missing status to Kitsune/SUMO index
Browse files Browse the repository at this point in the history
There is a new field in the enriched index, `status`,
which contains the current status of the question.
The status could be `solved`, `archived`, `locked`,
or `open`.

Signed-off-by: Jose Javier Merchante <[email protected]>
  • Loading branch information
jjmerchante committed Sep 11, 2024
1 parent 7e0095c commit 9b8ff90
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions grimoire_elk/enriched/kitsune.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,16 @@ def get_rich_item(self, item, kind='question', equestion=None):
origin = item['origin'].rstrip('/')
eitem['url'] = f"{origin}/{question['locale']}/questions/{question['id']}"

# Add status
if question['is_solved']:
eitem['status'] = 'solved'
elif question['is_archived']:
eitem['status'] = 'archived'
elif question['is_locked']:
eitem['status'] = 'locked'
else:
eitem['status'] = 'open'

eitem['author'] = question['creator']['username']
if question['creator']['display_name']:
eitem['author'] = question['creator']['display_name']
Expand Down
8 changes: 8 additions & 0 deletions releases/unreleased/status-in-sumo-enriched-index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Status in SUMO enriched index
category: added
author: Jose Javier Merchante <[email protected]>
issue: null
notes: >
Add the missing status in the SUMO backend. The status could
be `solved`, `archived`, `locked` or `open`.

0 comments on commit 9b8ff90

Please sign in to comment.