Improve backend domain model of CI/CD variables
Description
Our backend model of CI/CD variables has become more complex recently. It accumulated some technical debt, and despite spending some time on refactorings there is still some room for improvement.
We recently added bridge jobs and we need to share some variables between a bridge job and a build job. We are using inheritance via mixins, however we could benefit from using composition here.
We also do have some inconsistent naming, described below, in the "old description". We do have a few other issues about technical debt related to variables, and we could benefit from doing a few more refactorings in this area.
Old descritpion
After we've done https://gitlab.com/gitlab-org/gitlab-ce/issues/32568 and https://gitlab.com/gitlab-org/gitlab-ce/issues/12729, we also want to refactor Ci::Variable
to Ci::ProjectVariable
. Because Ci::Variable
or variable
was meant to be a project thing, but new kinds of variables will be added soon.
Old Plan
We do
- Refactor the domain name from
Ci::Variable
toCi::ProjectVariable
- Refactor
variable
toproject_variable
in codebase - Refactor factory from
factory :ci_variable
tofactory :ci_project_variable
- those changes have been included in a Backend MR of Group-wide secret variable, so we'll decouple the change to a new MR
We don't
- Rename table from
ci_variables
toci_project_variables
Proposal
Refactor in all codebase (function/tests/doc)