Draft: Remove `git clone` for "retrieve-tests-metadata" job if in a public project
The initial idea
- If we are in a
public
project, we setGIT_STRATEGY
tonone
, and we fetch the needed files for the job from the API. - If we are in a
protected
/private
project, we leaveGIT_STRATEGY
to its default value, and the job executes as currently.
This way, some gitlab-org/gitlab
jobs could be faster, and we would still do a regular git clone
in private forks until #31772 (closed) or similar is implemented.
The problems I face
- I first tried to set
GIT_STRATEGY: none
via https://docs.gitlab.com/ee/ci/yaml/#rulesvariables, but I cannot really do this, since I need both the original conditions in.test-metadata:rules:retrieve-tests-metadata
to be met, as we as an additional rule that would exclude the job if it's aprotected
/private
project. - I cannot go with two separate jobs as currently in this MR (
retrieve-tests-metadata
andretrieve-tests-metadata-no-git-clone
) because of the dependencies set toretrieve-tests-metadata
.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #191273 (closed)
Edited by David Dieulivol