Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-02 16:03:23 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-02 16:03:23 +0300
commita72a9af092c1bfcf9f8024d59c11cf222f07e1e7 (patch)
tree44b60265c1d476d026b2862d2c1244748f558d4f /app/presenters
parentb085478c4c2bed74fdc6eb2c33bfc62e791baf03 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/presenters')
-rw-r--r--app/presenters/ci/build_runner_presenter.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/presenters/ci/build_runner_presenter.rb b/app/presenters/ci/build_runner_presenter.rb
index 8e469795581..33b7899f912 100644
--- a/app/presenters/ci/build_runner_presenter.rb
+++ b/app/presenters/ci/build_runner_presenter.rb
@@ -34,7 +34,7 @@ module Ci
def refspecs
specs = []
- specs << refspec_for_pipeline_ref if merge_request_ref?
+ specs << refspec_for_pipeline_ref if should_expose_merge_request_ref?
specs << refspec_for_persistent_ref if persistent_ref_exist?
if git_depth > 0
@@ -50,6 +50,19 @@ module Ci
private
+ # We will stop exposing merge request refs when we fully depend on persistent refs
+ # (i.e. remove `refspec_for_pipeline_ref` when we remove `depend_on_persistent_pipeline_ref` feature flag.)
+ # `ci_force_exposing_merge_request_refs` is an extra feature flag that allows us to
+ # forcibly expose MR refs even if the `depend_on_persistent_pipeline_ref` feature flag enabled.
+ # This is useful when we see an unexpected behaviors/reports from users.
+ # See https://gitlab.com/gitlab-org/gitlab/issues/35140.
+ def should_expose_merge_request_ref?
+ return false unless merge_request_ref?
+ return true if Feature.enabled?(:ci_force_exposing_merge_request_refs, project)
+
+ Feature.disabled?(:depend_on_persistent_pipeline_ref, project, default_enabled: true)
+ end
+
def create_archive(artifacts)
return unless artifacts[:untracked] || artifacts[:paths]