summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-08-06 00:47:56 +0200
committerValery Sizov <vsv2711@gmail.com>2015-08-07 10:23:53 +0300
commit40a7dce915268f8e4e5b20ad4dae57f41983d567 (patch)
tree91857a0ff5c98d4b06b895af837638c4369a408d
parent0d6b96dc29f4faeec70ffa6aba57a6ef0df12a2e (diff)
downloadgitlab-ci-40a7dce915268f8e4e5b20ad4dae57f41983d567.tar.gz
Fix broken yaml error saving
-rw-r--r--CHANGELOG15
-rw-r--r--app/models/commit.rb2
-rw-r--r--spec/services/create_commit_service_spec.rb15
3 files changed, 31 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 51c21d7..d215343 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,18 @@
+v7.14.0 (unreleased)
+ - Truncate commit messages after subject line in table
+ - Adjust CI config to support Docker executors
+ - Added Application Settings
+ - Randomize test database for CI tests
+ - Make YAML validation stricter
+ - Use avatars received from GitLab
+ - Refactor GitLab API usage to use either access_token or private_token depending on what was specified during login
+ - Allow to use access_token for API requests
+ - Fix project API listing returning empty list when first projects are not added to CI
+ - Allow to define variables from YAML
+ - Added support for CI skipped status
+ - Fix broken yaml error saving
+ - Rename type(s) to stage(s)
+
v7.13.1
- Fix: user could steal specific runner
- Fix: don't send notifications for jobs with allow_failure set
diff --git a/app/models/commit.rb b/app/models/commit.rb
index eea3653..3739bd0 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -246,7 +246,7 @@ class Commit < ActiveRecord::Base
private
def save_yaml_error(error)
- return unless self.yaml_errors?
+ return if self.yaml_errors?
self.yaml_errors = error
save
end
diff --git a/spec/services/create_commit_service_spec.rb b/spec/services/create_commit_service_spec.rb
index c8bb6bd..8df77a2 100644
--- a/spec/services/create_commit_service_spec.rb
+++ b/spec/services/create_commit_service_spec.rb
@@ -97,5 +97,20 @@ describe CreateCommitService do
)
commit.builds.count(:all).should == 2
end
+
+ it "creates commit with failed status if yaml is invalid" do
+ commits = [{message: "some message"}]
+
+ commit = service.execute(project,
+ ref: 'refs/tags/0_1',
+ before: '00000000',
+ after: '31das312',
+ commits: commits,
+ ci_yaml_file: "invalid: file"
+ )
+
+ commit.status.should == "failed"
+ commit.builds.any?.should be_false
+ end
end
end