summaryrefslogtreecommitdiff
path: root/lib/ci
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2016-02-03 12:55:08 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-02-19 17:24:59 +0100
commitdf313634d0e247fb39726dc3b070c707100275ed (patch)
tree8eb2d307058e1dc5b8507d9d74ced51146f37337 /lib/ci
parent21152d7d51815622fd3cbb93836cb8fa7b753ec8 (diff)
downloadgitlab-ce-df313634d0e247fb39726dc3b070c707100275ed.tar.gz
Do not allow to modify build if it has been erased
Diffstat (limited to 'lib/ci')
-rw-r--r--lib/ci/api/builds.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb
index 2d3d6c75f00..f37a96da93c 100644
--- a/lib/ci/api/builds.rb
+++ b/lib/ci/api/builds.rb
@@ -38,6 +38,8 @@ module Ci
authenticate_runner!
update_runner_last_contact
build = Ci::Build.where(runner_id: current_runner.id).running.find(params[:id])
+ forbidden!('Build has been erased!') if build.erased?
+
build.update_attributes(trace: params[:trace]) if params[:trace]
case params[:state].to_s
@@ -99,6 +101,7 @@ module Ci
not_found! unless build
authenticate_build_token!(build)
forbidden!('Build is not running!') unless build.running?
+ forbidden!('Build has been erased!') if build.erased?
artifacts_upload_path = ArtifactUploader.artifacts_upload_path
artifacts = uploaded_file(:file, artifacts_upload_path)