Reorganize/Dry-up `*Service` classes related to Cluster integration

We implemented a bunch of *Service classes at GKE Integration https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14470#note_42509445.

Here are the files.

app/services/ci/create_cluster_service.rb
app/services/ci/fetch_gcp_operation_service.rb
app/services/ci/fetch_kubernetes_token_service.rb
app/services/ci/finalize_cluster_creation_service.rb
app/services/ci/integrate_cluster_service.rb
app/services/ci/provision_cluster_service.rb
app/services/ci/update_cluster_service.rb

Those files were created in order to hide business logic from workers. By such a reason, those files are not well organized. For example, FinalizeClusterCreationService is pretty ambiguous as it's just a chunk of processes(feature envy). It's hard to understand what the class does.

We should reorganize those classes.

/cc @ayufan @grzesiek


The following discussion from gitlab-ce!14470 should be addressed:

  • @grzesiek started a discussion: (+1 comment)

    I wonder if we should need Ci::Cluster module, because we have quite a lot of related services 🤔 I'm fine with not doing this right now.

Assignee Loading
Time tracking Loading