diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-02 13:03:23 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-02 13:03:23 +0000 |
commit | a72a9af092c1bfcf9f8024d59c11cf222f07e1e7 (patch) | |
tree | 44b60265c1d476d026b2862d2c1244748f558d4f /app/presenters | |
parent | b085478c4c2bed74fdc6eb2c33bfc62e791baf03 (diff) | |
download | gitlab-ce-a72a9af092c1bfcf9f8024d59c11cf222f07e1e7.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/ci/build_runner_presenter.rb | 15 |
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] |