From b8f67c5e4735eb25a3d03daeb95900dc87692123 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 14 Dec 2015 11:28:49 +0100 Subject: Do not display ci build status if builds enabled but no `.gitlab-ci.yml` Ref #3827 --- app/models/ci/commit.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/models/ci/commit.rb') diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 75465685e98..fca18ba79be 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -220,6 +220,16 @@ module Ci update!(committed_at: DateTime.now) end + ## + # This method checks if build status should be displayed. + # + # Build status should be available only if builds are enabled + # on project level and `.gitlab-ci.yml` file is present. + # + def show_build_status? + gl_project.builds_enabled? && ci_yaml_file + end + private def save_yaml_error(error) -- cgit v1.2.1