Skip to content

Backfill project permissions in blob

What does this MR do and why?

Describe in detail what your merge request does and why.

Backfill the repository_access_level and visibility_level for blob in the main index.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

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

  1. Make sure you have advanced search enabled. Go to the admin settings. And check the boxes Elasticsearch indexing and Search with Elasticsearch enabled
  2. Run the query on local Elasticsearch:
GET gitlab-development/_count
{
  "query": {
    "bool": {
      "must_not": {
        "exists": {
          "field": "repository_access_level"
        }
      },
      "must": {
        "term": {
          "type": "blob"
        }
      }
    }
  }
}

Notice in the response that count should be non-zero.

  1. Now open the Rails console
bundle exec rails c

Run the following command

BackfillProjectPermissionsInBlobs.new(20230411064300).migrate
  1. Now, again run the above Elastic query and notice in the response that count should be 0

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 #344594 (closed)

Edited by Siddharth Dungarwal

Merge request reports