Skip to content

Add methods for injecting EE modules

Yorick Peterse requested to merge prepend-ee-helper into master

What does this MR do?

This adds the methods prepend_if_ee, extend_if_ee, and include_if_ee that can be used to inject EE specific modules in EE.

These methods are exposed as an initializer that is loaded as soon as possible. For tests that use fast_spec_helper.rb we must load this initializer manually, as the Rails environment is not loaded. This is not the most pretty setup, but unfortunately there is no alternative that we can use.

EE MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14863

TODO

  • Update EE to use these new methods everywhere
  • Update InjectEnterpriseEditionModule cop to check for these new methods
  • Add cop to tell developers to use these new methods instead of using prepend/include/extend
  • Update documentation to cover the new setup

Does this MR meet the acceptance criteria?

Conformity

Edited by Yorick Peterse

Merge request reports