Fix checking the gitlab_ci_yml of a project
What does this MR do and why?
We currently use repository.gitlab_ci_yml.present?
to check
if a project has a .gitlab-ci.yml
file in HEAD
. However, this is not a
correct approach because a project can have a custom CI config file set.
In this change, we are introducing has_ci_config_file?
to check
if a project has a set CI config file in its repository HEAD.
This is both a bug fix and a refactoring.
If the feature flag rollout becomes successful, then we can also
remove the gitlab_ci_yml
method in the next iteration.
This change is behind a feature flag ci_refactor_has_ci_config_file
(gitlab-com/gl-infra/production#17406 (closed)).
Related to #26169
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots
- Create a project with a custom CI config file.
- Check these areas;
A. Project repository page
Before enabling the FF ci_refactor_has_ci_config_file
;
After enabling the FF ci_refactor_has_ci_config_file
;
B. Project security configuration page
Before enabling the FF ci_refactor_has_ci_config_file
;
After enabling the FF ci_refactor_has_ci_config_file
;