Skip to content

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 set GIT_STRATEGY to none, and we fetch the needed files for the job from the API.
  • If we are in a protected/private project, we leave GIT_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 a protected/private project.
  • I cannot go with two separate jobs as currently in this MR (retrieve-tests-metadata and retrieve-tests-metadata-no-git-clone) because of the dependencies set to retrieve-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.

Related to #191273 (closed)

Edited by David Dieulivol

Merge request reports

Loading