Properly reindex existing work items
Problem description
I noticed that when a milestone is removed from an issue, for example, this one #553232, it's not being updated in the work items index. If you search for this same issue in ES (the below query), you would see it still has "18.2" assigned to milestone_title and all other milestone related fields are present. I tested it out locally, it's the same behavior.
GET gitlab-production-work_items/_search
{
"query": {
"match": {
"id": 169972883
}
}
}
After some debugging (please see this slack thread), it was happening because we were checking for milestone and all related fields to be present. But that didn't account for workflows where an issue gets unassigned from a milestone or has its weight removed.
Edited by 🤖 GitLab Bot 🤖