Skip to content

Load migration completed value from index

What does this MR do and why?

Noticed during debugging there are some advanced search migrations which completed? values might return false after they have run and completed. Once a migration is marked as completed in Elasticsearch, the migration completed? method is never checked again. This is by design.

The API for search migrations now uses the index as the SSOT for completed

Screenshots or screen recordings

N/A

How to set up and validate locally

  1. setup gdk for elasticsearch and index everything
  2. hit the search migrations api endpoint, verify that completed is true (need an admin account to access)
   curl --request GET \
        --url http://gdk.test:3000/api/v4/admin/search/migrations/BackfillHiddenOnMergeRequests 
  1. change completed in the index for that migration document
   curl --request PUT \
     --url http://localhost:9200/gitlab-development-migrations/_doc/20230427555555 \
     --header 'Content-Type: application/json' \
     --data '{
   	"completed": false,
   	"state": {},
   	"name": "BackfillHiddenOnMergeRequests",
   	"started_at": "2023-06-29T20:25:20.776Z",
   	"completed_at": "2023-06-29T20:25:20.776Z"
   }
   '
  1. hit the search migrations api endpoint, verify that completed is false
   curl --request GET \
  --url http://gdk.test:3000/api/v4/admin/search/migrations/BackfillHiddenOnMergeRequests 

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Terri Chu

Merge request reports