Fix the indexing when project_feature get changes
What does this MR do and why?
- For maintaining the elasticsearch index, we checked the
repository_access_levelchanges on theprojectobject, which is wrong. It should be checked on theproject_featureobject. In addition, I am also adding check forwiki_access_level. - Implemented the
forceoption inElasticWikiIndexerWorker. Sendingforce: truewhen the project needs backfilling. Whenever we change anything on the project level like visibility levels or move the project from one namespace to another then we must do the force reindexing of the whole repository - Then Bumped the
GITLAB_ELASTICSEARCH_INDEXER_VERSION. In the new version, I am updating the SCHEMA_VERSION of thewiki_blobs. Means all the wikis which will be indexed from now will have correct values and a new SCHEMA_VERSIOn. Later on, I will write a migration to update all the wikis which have the old SCHEMA_VERSION(old SCHEMA_VERSION means they have the wrong values).
How to set up and validate locally
- Make sure the elasticsearch is enabled. Navigate to the elasticsearch settings and make sure the two checkboxes
Elasticsearch indexingandSearch with Elasticsearch enabledunder theAdvanced Searchare enabled. - Update the visibility level of a project with the wiki.
- Ensure on the elasticsearch that
visibility_levelfor thewikiandcommitsindex gets updated correctly
curl -XGET "http://localhost:9200/gitlab-development-wikis/_search" -H "kbn-xsrf: reporting" -H "Content-Type: application/json" -d' | json_pp
curl -XGET "http://localhost:9200/gitlab-development-commits/_search" -H "kbn-xsrf: reporting" -H "Content-Type: application/json" -d' | json_pp
- Update the wiki visibility of a project with the wiki.
- Ensure on the elasticsearch that the
wiki_access_levelfor thewikiindex gets updated correctly.
curl -XGET "http://localhost:9200/gitlab-development-wikis/_search" -H "kbn-xsrf: reporting" -H "Content-Type: application/json" -d' | 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #410777
Edited by Ravi Kumar