Skip to content

Split EnvironmentsFinder into two

Dmytro Zaporozhets (DZ) requested to merge dz-refactor-environments-finder into master

What does this MR do?

Before this MR EnvironmentsFinder has 2 different ways of use. There was a common execute method but there was also find method that worked completely differently (not shared code). Some classes used execute while others used find. This MR splits finder into two separate finders.

In details:

  1. Move everything related to execute from app/finders/environments_finder.rb to app/finders/environments_by_deployments_finder.rb.
  2. Move everything related to execute from spec/finders/environments_finder_spec.rb to spec/finders/environments_by_deployments_finder_spec.rb.
  3. Classes that used EnvironmentsFinder#execute now use EnvironmentsByDeploymentsFinder#execute.
  4. Classes that used EnvironmentsFinder#find are kept as is.

Step 1 from #326668 (closed)

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 Dmytro Zaporozhets (DZ)

Merge request reports