Stop exposing MR refs in favor of persistent pipeline refs
Summary
We've added a persisted ref for pipeline at !17043 (merged).
With this change, we don't need to expose merge request refs to runners anymore.
refs/merge-requests/:iid/headrefs/merge-requests/:iid/mergerefs/merge-requests/:iid/train
This introduces a good effect that pipelines can keep running even if the ref is removed by the system, which currently fails by failed to find ref (e.g. When a MR is dropped from a merge train)
Proposal
diff --git a/app/presenters/ci/build_runner_presenter.rb b/app/presenters/ci/build_runner_presenter.rb
index 8e469795581..f03c69e0031 100644
--- a/app/presenters/ci/build_runner_presenter.rb
+++ b/app/presenters/ci/build_runner_presenter.rb
@@ -34,7 +34,6 @@ module Ci
def refspecs
specs = []
- specs << refspec_for_pipeline_ref if merge_request_ref?
specs << refspec_for_persistent_ref if persistent_ref_exist?
if git_depth > 0
@@ -87,10 +86,6 @@ module Ci
"+#{Gitlab::Git::TAG_REF_PREFIX}#{ref}:#{RUNNER_REMOTE_TAG_PREFIX}#{ref}"
end
- def refspec_for_pipeline_ref
- "+#{ref}:#{ref}"
- end
-
def refspec_for_persistent_ref
"+#{persistent_ref_path}:#{persistent_ref_path}"
end