Skip to content

Send archived value to the indexer

Ravi Kumar requested to merge 416248-send-archived-value-to-indexer into master

What does this MR do and why?

This MR will send a --archived flag to the indexer if the migration add_archived_to_wikis is already finished. The value of the flag will be true if the project is archived and false if the project is not archived.

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 the elastic search is enabled in the GDK.
  • Create a new wiki
  • To simulate the migration is not finished, do an early return false here if the name equals to add_archived_to_wikis
      def migration_finished?(name)
        return false if name == :add_archived_to_wikis
        ::Elastic::DataMigrationService.migration_has_finished?(name)
      end
  • Verify wikis in the elastic that the archived attribute is not present
  • Now run the migration
bundle exec rake gitlab:elastic:index
  • Now create a new wiki in some project

  • Verify the wiki in the elastic that the archived attribute is present. And the value must be false

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

curl -XGET "http://localhost:9200/gitlab-development-wikis/_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 #416248 (closed)

Related to Send the archived value from Gitlab to the indexer (#417741 - closed)

Edited by Ravi Kumar

Merge request reports

Loading