Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
9fd6f1b6
Commit
9fd6f1b6
authored
May 06, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve displaying validation messages for runner
parent
2ee24bd9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
app/controllers/projects/runners_controller.rb
app/controllers/projects/runners_controller.rb
+0
-1
app/models/ci/runner.rb
app/models/ci/runner.rb
+7
-3
app/views/projects/runners/edit.html.haml
app/views/projects/runners/edit.html.haml
+6
-0
No files found.
app/controllers/projects/runners_controller.rb
View file @
9fd6f1b6
...
...
@@ -20,7 +20,6 @@ class Projects::RunnersController < Projects::ApplicationController
if
@runner
.
update_attributes
(
runner_params
)
redirect_to
runner_path
(
@runner
),
notice:
'Runner was successfully updated.'
else
flash
[
:alert
]
=
@runner
.
errors
.
full_messages
.
to_sentence
render
'edit'
end
end
...
...
app/models/ci/runner.rb
View file @
9fd6f1b6
...
...
@@ -27,9 +27,9 @@ module Ci
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!
'
)
unless
runner
.
has_tags?
||
runner
.
run_untagged?
errors
.
add
(
:tags_
list
,
'
can not be empty when runner is not allowed to pick untagged jobs
'
)
end
end
...
...
@@ -103,5 +103,9 @@ module Ci
def
short_sha
token
[
0
...
8
]
if
token
end
def
has_tags?
tag_list
.
any?
end
end
end
app/views/projects/runners/edit.html.haml
View file @
9fd6f1b6
-
page_title
"Edit"
,
"
#{
@runner
.
description
}
#
#{
@runner
.
id
}
"
,
"Runners"
%h4
Runner ##{@runner.id}
-
if
@runner
.
errors
.
any?
.error-message.js-errors
-
@runner
.
errors
.
full_messages
.
each
do
|
error
|
%div
=
error
%hr
=
render
'form'
,
runner:
@runner
,
runner_form_url:
runner_path
(
@runner
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment