Skip to content

Backfill projects in Elasticsearch when transferred

What does this MR do?

Related to #214749 (closed) and completes the fix started in !50712 (merged) which handled invalidating the cache. It missed the fact that projects moved to Elasticsearch would need to be reindexed + all associated data so calling the maintain_elasticsearch_update method was not the right fix.

This MR indexes the project and all related data in Elasticsearch when moving to an indexed namespace (either via group or project transfer).

Note: This does not handle transfer from an indexed group to a non-indexed group and that will be handled in a follow up issue #297279 (closed)

How to test

Note: Make sure to have Elasticsearch and Advanced Search enabled

  1. Create two groups (Indexed Group, Non-Indexed Group)
  2. Enable Elasticsearch indexing restrictions
  3. Add the Indexed Group to the Namespaces to index section

transferring a project to a new group

  1. Add a new project to Non-Indexed Group
  2. Add some searchable text in a README and create a new issue
  3. Verify that a search finds the searchable text and is NOT using Advanced Search
  4. Transfer the project to the Indexed Group
  5. verify that a search finds the searchable text and is using Advanced Search

transferring a group containing a project to a new group

  1. Add a new group to Non-Indexed Group
  2. Add a new project to the new group
  3. Add some searchable text in a README and create a new issue
  4. Verify that a search finds the searchable text and is NOT using Advanced Search
  5. Transfer the group to the Indexed Group
  6. verify that a search finds the searchable text and is using Advanced Search

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Terri Chu

Merge request reports