Add Search Migrations Admin API
What does this MR do and why?
Related gitlab-org/search-team/team-tasks#143 (moved)
This MR adds a new Admin API endpoint to expose Advanced Search Migrations.
It's the first step to adding a chatops command (will be done in another MR)
Changes include:
- two new endpoints:
/admin/search/migrations
and/admin/search/migrations/:name_or_version
- expose two new fields in
Elastic::MigrationRecord
- specs
Screenshots or screen recordings
N/A
How to set up and validate locally
- enable advanced search/elasticsearch for gdk
- index all data in gdk
- these are admin API calls so you'll need an access token for the gdk admin account
- list all migrations
curl --request GET \ --url http://gdk.test:3000/api/v4/admin/search/migrations \ --header 'Private-Token: YOUR_GDK_ADMIN_TOKEN' \
- get a migration by version number
curl --request GET \ --url http://gdk.test:3000/api/v4/admin/search/migrations/20201116142400 \ --header 'Private-Token: YOUR_GDK_ADMIN_TOKEN' \
- get a migration by name
curl --request GET \ --url http://gdk.test:3000/api/v4/admin/search/migrations/AddNewDataToIssuesDocuments \ --header 'Private-Token: YOUR_GDK_ADMIN_TOKEN' \
- example record json
{
"version": 20230503064300,
"name": "BackfillProjectPermissionsInBlobsUsingPermutations",
"started_at": "2023-05-03T16:04:44.074+00:00",
"completed_at": "2023-05-03T16:04:44.074+00:00",
"completed": true,
"obsolete": false,
"migration_state": {
"permutation_idx": 8,
"documents_remaining": 5,
"task_id": "I2_LXc-xQlOeu-KmjYpM8g:172820",
"documents_remaining_for_permutation": 0
}
}
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