diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 00:09:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 00:09:08 +0300 |
commit | 7671216b60e2796a050358ff808b4a0c2de3d22f (patch) | |
tree | 605dfc1339a3cd7dc7353ac6d725191086a9acca /app/helpers/blob_helper.rb | |
parent | c2367afbf57ebc65d5b78a743b5d6a91f0aece9f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r-- | app/helpers/blob_helper.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 77a320f8925..9c09ddafbf1 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -341,4 +341,16 @@ module BlobHelper edit_fork_button_tag(common_classes, project, text, edit_blob_fork_params(edit_path)) end end + + def show_suggest_pipeline_creation_celebration? + experiment_enabled?(:suggest_pipeline) && + @blob.auxiliary_viewer.valid?(project: @project, sha: @commit.sha, user: current_user) && + @blob.path == Gitlab::FileDetector::PATTERNS[:gitlab_ci] && + @project.uses_default_ci_config? && + cookies[suggest_pipeline_commit_cookie_name].present? + end + + def suggest_pipeline_commit_cookie_name + "suggest_gitlab_ci_yml_commit_#{@project.id}" + end end |