Skip to content

WIP: Fixed mocking com environment for specs

Aishwarya Subramanian requested to merge com-skeleton-spec-fix into master

What does this MR do?

Adds following fixes to the com module skeleton files:

  1. Fixes the way com environment is mocked in specs:

    • Thread.current[:is_com] memoizes the setting for .com environment. Thus, a better way to mock would be to set the value for Thread.current[:is_com] as true for com-only specs.
  2. Adds higher precedence for view and task files under com module.

    • For e.g. if app/views/test.html.haml exists in ee and com - if the environemtn is .com, the view from com module should get the precedence.
  3. Adds js, css and images from com module onto assets_path

Note: It was intentional to not include Pt. (2) and (3) as part of customers-gitlab-com#722 (closed), with the thought process being it may not make sense to add them without any view/asset files actually being present in the module.

However, adding it now as other developers may add view/asset files - and with the config changes not being present, the precedence may not work as expected.

Relates to customers-gitlab-com#722 (closed)

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Performance 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 Aishwarya Subramanian

Merge request reports