Backfill the missing wiki permissions in the main index
What does this MR do and why?
Backfill the visibility_access
and wiki_access_level
for wiki_blob
in the main index. This is a preliminary requirement to achieve moving the wiki_blobs
to the separate index.
The time for completion(internal link) of the migration is roughly 10 minutes.
Screenshots or screen recordings
After adding visibility_access
and wiki_access_level
for wiki_blob
in the main index:
How to set up and validate locally
- Make sure you have advanced search enabled. Go to the admin settings. And check the boxes
Elasticsearch indexing
andSearch with Elasticsearch enabled
- Make sure you have Project Wiki in your gdk. If not then switch to
master
and create one. - Run the query on local Elasticsearch:
GET gitlab-development/_count
{
"query": {
"bool": {
"must_not": {
"exists": {
"field": "wiki_access_level"
}
},
"must": {
"terms": {
"type": [
"wiki_blob"
]
}
}
}
}
}
Notice in the response that count
should be non-zero.
- Now open the Rails console
bundle exec rails c
Run the following command
require_relative 'ee/elastic/migrate/20230405500000_backfill_wiki_permissions_in_main_index.rb'
BackfillWikiPermissionsInMainIndex.new(20230405500000).migrate
- Now, again run the above Elastic query and notice in the response that
count
should be0
- Second thing to test is if you create a new wiki then it should already have
visibility_access
andwiki_access_level
. You can test by creating a new project wiki and without running the migration in the console, run the elastic query above and verify the count is0
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 #404693 (closed)
Edited by Ravi Kumar