Fix GIT_DEPTH variable precedence in git operations
What does this MR do?
This MR fixes the issue where the GIT_DEPTH variable does not follow CI/CD variable precedence rules when set in .gitlab-ci.yml vs project/pipeline variables.
Related issues
Closes #28894 (closed)
Author's checklist
-
Follow the Contribution Guidelines -
If this MR is the resolution of a security issue, I have read the security process for developers and understand I must not share details of this security issue outside of this MR -
This change is backward compatible. If not, please include steps to communicate to our users -
Tests added for new functionality. If not, please raise an issue to follow up -
Documentation added/updated, if needed
How to test
- Create a project with a
.gitlab-ci.ymlthat setsGIT_DEPTH: 5 - Set a project CI/CD variable
GIT_DEPTHwith value2 - Run a pipeline and check the job log
- The log should show "Fetching changes with git depth set to 2..." (project variable takes precedence)
What are the relevant issue numbers?
Closes #28894 (closed)
Does this MR meet the acceptance criteria?
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Merge request checklist
-
Tests -
Added for this feature/bug -
All builds are passing
-
-
Changelog entry -
Documentation (if required) -
Code review