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
- Create two groups (Indexed Group, Non-Indexed Group)
- Enable Elasticsearch indexing restrictions
- Add the
Indexed Group
to theNamespaces to index
section
transferring a project to a new group
- Add a new project to
Non-Indexed Group
- Add some searchable text in a README and create a new issue
- Verify that a search finds the searchable text and is NOT using Advanced Search
- Transfer the project to the
Indexed Group
- verify that a search finds the searchable text and is using Advanced Search
transferring a group containing a project to a new group
- Add a new group to
Non-Indexed Group
- Add a new project to the new group
- Add some searchable text in a README and create a new issue
- Verify that a search finds the searchable text and is NOT using Advanced Search
- Transfer the group to the
Indexed Group
- verify that a search finds the searchable text and is using Advanced Search
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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