summaryrefslogtreecommitdiff
path: root/app/models/ci/commit.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2015-12-14 17:16:29 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2015-12-14 17:16:29 +0000
commit4526515704855278b2971522ed013ff007c0e40a (patch)
tree5ad7ce08ffb5e22d4459cf0ec0df53c1a635caff /app/models/ci/commit.rb
parent3fb89a36cb2c8bead62f4985ebdda1e05f8114df (diff)
parent0a81a681585bf699a7a41a449a2c0c21e2e335c6 (diff)
downloadgitlab-ce-4526515704855278b2971522ed013ff007c0e40a.tar.gz
Merge branch 'ux/suppress-ci-yml-warning' into 'master'
Suppress warning about missing `.gitlab-ci.yml` if builds are disabled When user disables GitLab Ci Service in project's settings then warning about missing `.gitlab-ci.yml` file should be supressed. This a matter of user experience as stated in #3761 (closes #3761). cc @ayufan See merge request !2014
Diffstat (limited to 'app/models/ci/commit.rb')
-rw-r--r--app/models/ci/commit.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb
index d2a29236942..6bf596e5d3e 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -218,6 +218,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?
+ project.builds_enabled? && ci_yaml_file
+ end
+
private
def save_yaml_error(error)