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
- setup gdk for elasticsearch and index everything
- 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
- 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"
}
'
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Terri Chu