Skip to content

Refactor Elasticsearch Indexed Containers specs to support parent strategy

What does this MR do?

Related to #240929 (closed)

The MR !40274 (merged) implements using parent strategy for associations in factories (see factory_bot docs) by removing FactoryBot.use_parent_strategy = false from factory_bot.rb, but that results in several failures that need to be fixed and merged in advance.

As @engwan kindly fixed all fallings and committed them individually, we just need to cherry-pick them and deliver them as their own MRs.

This specific MR contains the cherry-picked commit a8f95ec9 that fixes failings in

  • ee/spec/models/elasticsearch_indexed_namespace_spec.rb
  • ee/spec/models/elasticsearch_indexed_project_spec.rb
  • ee/spec/models/gitlab_subscription_spec.rb
  • ee/spec/support/shared_examples/models/elasticsearch_indexed_container_shared_examples.rb

For more context:

Heinrich Lee Yu @engwan commented:

I managed to fix the failures in !40274 (merged). Anyone want to create MRs from the commits there? 🙂 There are 42 commits and most should pass as their own MRs. I also put the explanation in the commit message. So, picking commits there should count as a review, then you can pass it on to a maintainer. 🙂

Screenshots

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 🤖 GitLab Bot 🤖

Merge request reports