summaryrefslogtreecommitdiff
path: root/app/helpers/blob_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r--app/helpers/blob_helper.rb12
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