Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/projects/runners_controller.rb3
-rw-r--r--app/models/ci/runner.rb7
2 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/projects/runners_controller.rb b/app/controllers/projects/runners_controller.rb
index 3a9d67aff64..12172b47520 100644
--- a/app/controllers/projects/runners_controller.rb
+++ b/app/controllers/projects/runners_controller.rb
@@ -20,7 +20,8 @@ class Projects::RunnersController < Projects::ApplicationController
if @runner.update_attributes(runner_params)
redirect_to runner_path(@runner), notice: 'Runner was successfully updated.'
else
- redirect_to runner_path(@runner), alert: 'Runner was not updated.'
+ flash[:alert] = @runner.errors.full_messages.to_sentence
+ render 'edit'
end
end
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb
index 23b1556712c..b1227d72405 100644
--- a/app/models/ci/runner.rb
+++ b/app/models/ci/runner.rb
@@ -26,6 +26,13 @@ module Ci
.where("ci_runner_projects.gl_project_id = :project_id OR ci_runners.is_shared = true", project_id: project_id)
end
+ validate do |runner|
+ if runner.tag_list.empty? && !runner.run_untagged?
+ errors.add(:tags_errors,
+ 'Runner without tags must be able to pick untagged jobs!')
+ end
+ end
+
acts_as_taggable
# Searches for runners matching the given query.