From 41f41911bcab3679f0a0d7ac5a61ac0fb19ca5f3 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Wed, 1 Jun 2016 12:52:28 +0200 Subject: Remove save_yaml_error from config_processor and don't create Ci::Commit if no builds were created --- app/models/ci/commit.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'app/models') diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 6675a3f5d53..86b819f2192 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -131,10 +131,10 @@ module Ci @config_processor ||= begin Ci::GitlabCiYamlProcessor.new(ci_yaml_file, project.path_with_namespace) rescue Ci::GitlabCiYamlProcessor::ValidationError, Psych::SyntaxError => e - save_yaml_error(e.message) + self.yaml_errors = e.message nil rescue - save_yaml_error("Undefined error") + self.yaml_errors = "Undefined error" nil end end @@ -169,11 +169,5 @@ module Ci self.duration = statuses.latest.duration save end - - def save_yaml_error(error) - return if self.yaml_errors? - self.yaml_errors = error - update_state - end end end -- cgit v1.2.1