BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
runners_controller.rb
app/controllers/projects/runners_controller.rb
+0
-1
runner.rb
app/models/ci/runner.rb
+7
-3
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