diff options
Diffstat (limited to 'app/presenters/ci/build_runner_presenter.rb')
-rw-r--r-- | app/presenters/ci/build_runner_presenter.rb | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/app/presenters/ci/build_runner_presenter.rb b/app/presenters/ci/build_runner_presenter.rb index 64461fa9193..ffa33dc9f15 100644 --- a/app/presenters/ci/build_runner_presenter.rb +++ b/app/presenters/ci/build_runner_presenter.rb @@ -93,7 +93,22 @@ module Ci end def refspec_for_persistent_ref - "+#{persistent_ref_path}:#{persistent_ref_path}" + # + # End-to-end test coverage for CI fetching seems to not be strong, so we + # are using a feature flag here to close the confidence gap. My (JV) + # confidence about the change is very high but if something is wrong + # with it after all, this would cause all CI jobs on gitlab.com to fail. + # + # The roll-out will be tracked in + # https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/746. + # + if Feature.enabled?(:scalability_ci_fetch_sha, type: :ops) + # Use persistent_ref.sha because it causes 'git fetch' to do less work. + # See https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/746. + "+#{pipeline.persistent_ref.sha}:#{pipeline.persistent_ref.path}" + else + "+#{pipeline.persistent_ref.path}:#{pipeline.persistent_ref.path}" + end end def persistent_ref_exist? @@ -107,10 +122,6 @@ module Ci pipeline.persistent_ref.exist? end - def persistent_ref_path - pipeline.persistent_ref.path - end - def git_depth_variable strong_memoize(:git_depth_variable) do variables&.find { |variable| variable[:key] == 'GIT_DEPTH' } |