Skip to content

Send the schema-version-commits flag to the gitlab-elasticsearch-indexer

Ravi Kumar requested to merge 414804-send-schema_version-to-indexer into master

What does this MR do and why?

Sending the flag schema-version-commits=true to the gitlab-elastic-indexer if the migration add_schema_version_to_commits is finished otherwise don't send this flag. Update the GITLAB_ELASTICSEARCH_INDEXER_VERSION to use the correct gitlab-elastic-indexer

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

Numbered steps to set up and validate the change are strongly suggested.

  • Ensure the elasticsearch is enabled in the GDK.
  • Create a commit in some project
  • To simulate the migration is not finished, do an early return false here if the name equals to add_schema_version_to_commits
      def migration_finished?(name)
        return false if name == :add_schema_version_to_commits
        ::Elastic::DataMigrationService.migration_has_finished?(name)
      end
  • Verify the commit in the elastic that the schema_version attribute is not present
  • Now run the migration
bundle exec rake gitlab:elastic:index
  • Now create a new commit in some project

  • Verify the commit in the elastic that the schema_version attribute is present

  • Change the rid value with the project id in which you have added the commit

curl -XGET "http://localhost:9200/gitlab-development-commits/_search" -H "kbn-xsrf: reporting" -H "Content-Type: application/json" -d'
{
 "query": {
   "match": {
     "rid": 7
  }
 }
}' | json_pp

MR acceptance checklist

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

Related to #414804 (closed)

Edited by Ravi Kumar

Merge request reports

Loading