First CI configuration refactoring interation
In order to reduce implementation efforts when adding new CI features, we want to refactor CI configuration code. See https://gitlab.com/gitlab-org/gitlab-ce/issues/15060, https://gitlab.com/gitlab-org/gitlab-ce/issues/14149
This is issue for first refactoring iteration of GitlabCiYamlProcessor and related parts of codebase.
In the first iteration we would like to:
-
Create a
Gitlab::Pipelinemodule or use existingGitlab::Ci.We can use name
Gitlab::Pipelineor existingGitlab::Ci, name to be defined. -
Create
Pipeline::ConfigclassThis will be initialized using contents of
.gitlab-ci.ymland will represent pipeline configuration. -
(Moved to another iteration)
Create aPipeline::RequestclassThis will encapsulate stage, ref, tag, and trigger requests (we currently pass this to
GitlabCiYamlProcessortoGitlabCiYamlProcessor#builds_for_stage_and_ref(stage, ref, tag = false, trigger_request = nil). -
Create a
Pipeline::Config::Entry::JobclassClass that will represent configuration entry for each job.
-
(Moved to another iteration)
Create aPipeline::FactoryclassWill take
ConfigandRequestinstance and will be responsible for fabricatingCi::Buildobjects.
In next steps we will extract each configuration entry to separate class, and work on validation and CI Lint.
@ayufan what do you think about this first iteration?