Add a boolean field hidden in the Issue ES mapping
What does this MR do and why?
This MR will add a boolean field hidden in the Issue
ES mapping. The value of hidden
will be true
if the author of the issue is banned
and the value will be false
if the author of the issue is unbanned. This field can be used to filter out the hidden issues in the search results
Screenshots or screen recordings
How to set up and validate locally
- Run local development with elasticsearch and sidekiq running
gdk start
- Run the elasticsearch migration
gitlab:elastic:index
- Run the ES
_search
query and make sure thehidden
attribute is present
curl -H 'Content-type: application/json' -XGET 'http://localhost:9200/gitlab-development-issues/_search' | json_pp
- Now ban an author of an issue, and run the
_search
query again. Set the author_id to the banned user_id.
curl -H 'Content-type: application/json' -XGET 'http://localhost:9200/gitlab-development-issues/_search' -d '{ "query": { "term": { "author_id": 47 } } }' | json_pp
- Make sure the
hidden
attribute value istrue
. You might have to wait for a few seconds to finish the reindexing - Now unban the user and run the same query
curl -H 'Content-type: application/json' -XGET 'http://localhost:9200/gitlab-development-issues/_search' -d '{ "query": { "term": { "author_id": 47 } } }' | json_pp
- Make sure the
hidden
attribute value isfalse
. You might have to wait for few seconds to finish the reindexing
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #341448 (closed)
Edited by Ravi Kumar