Add schema_version to merge_requests
What does this MR do and why?
This MR adds an integer field schema_version
in the merge_requests
mapping. This field is useful in the case of reindexing all documents of merge_requests
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Ensure Elasticsearch is enabled
- Run the following command and ensure the
mappings
in the response is empty
curl -H 'Content-type: application/json' -XGET 'http://localhost:9200/gitlab-development-merge_requests/_mapping/field/schema_version'
- Now open the rails console
bundle exec rails c
- Run the following command in the console
Elastic::DataMigrationService[20230823154049].send(:migration).migrate
- Now again run the curl command in the bash terminal and ensure the
mapping
in the response has the values. - Now edit or create any MR and check that MR in the elastic. Verify that
schema_version
field is populated.
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 #372856 (closed)
Edited by Ravi Kumar