summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2018-02-19 18:41:50 +0100
committerTomasz Maczukin <tomasz@maczukin.pl>2018-03-28 13:55:46 +0200
commitb6d26f979c29ce594a8645b81ec0fd1028e79b64 (patch)
treeb35ec7b2e4cd73a47a45dccb35ead92e80d05ac2
parent834f473821b816515504abb7c6bc91ab2dee4450 (diff)
downloadgitlab-ce-b6d26f979c29ce594a8645b81ec0fd1028e79b64.tar.gz
Add UI support for per-runner job timeout
-rw-r--r--app/models/ci/runner.rb2
-rw-r--r--app/views/admin/runners/_runner.html.haml5
-rw-r--r--app/views/admin/runners/index.html.haml1
-rw-r--r--app/views/projects/runners/_form.html.haml6
-rw-r--r--app/views/projects/runners/_runner.html.haml2
-rw-r--r--app/views/projects/runners/show.html.haml3
6 files changed, 18 insertions, 1 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb
index b28e892dcb6..be15fb0f729 100644
--- a/app/models/ci/runner.rb
+++ b/app/models/ci/runner.rb
@@ -8,7 +8,7 @@ module Ci
ONLINE_CONTACT_TIMEOUT = 1.hour
UPDATE_DB_RUNNER_INFO_EVERY = 40.minutes
AVAILABLE_SCOPES = %w[specific shared active paused online].freeze
- FORM_EDITABLE = %i[description tag_list active run_untagged locked access_level].freeze
+ FORM_EDITABLE = %i[description tag_list active run_untagged locked access_level job_upper_timeout].freeze
has_many :builds
has_many :runner_projects, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
diff --git a/app/views/admin/runners/_runner.html.haml b/app/views/admin/runners/_runner.html.haml
index e1cee584929..14aee600809 100644
--- a/app/views/admin/runners/_runner.html.haml
+++ b/app/views/admin/runners/_runner.html.haml
@@ -19,6 +19,11 @@
%td
= runner.ip_address
%td
+ - if runner.defines_job_upper_timeout?
+ = runner.job_upper_timeout
+ - else
+ n/a
+ %td
- if runner.shared?
n/a
- else
diff --git a/app/views/admin/runners/index.html.haml b/app/views/admin/runners/index.html.haml
index 9f13dbbbd82..95fd7fe7ebe 100644
--- a/app/views/admin/runners/index.html.haml
+++ b/app/views/admin/runners/index.html.haml
@@ -61,6 +61,7 @@
%th Description
%th Version
%th IP Address
+ %th Timeout
%th Projects
%th Jobs
%th Tags
diff --git a/app/views/projects/runners/_form.html.haml b/app/views/projects/runners/_form.html.haml
index 49c90869146..4fb4323dab4 100644
--- a/app/views/projects/runners/_form.html.haml
+++ b/app/views/projects/runners/_form.html.haml
@@ -40,6 +40,12 @@
.col-sm-10
= f.text_field :description, class: 'form-control'
.form-group
+ = label_tag :job_upper_timeout, class: 'control-label' do
+ Job upper timeout
+ .col-sm-10
+ = f.text_field :job_upper_timeout, class: 'form-control'
+ .help-block This timeout will take precedence when lower than Project-defined timeout
+ .form-group
= label_tag :tag_list, class: 'control-label' do
Tags
.col-sm-10
diff --git a/app/views/projects/runners/_runner.html.haml b/app/views/projects/runners/_runner.html.haml
index 6376496ee1a..e3107fecfad 100644
--- a/app/views/projects/runners/_runner.html.haml
+++ b/app/views/projects/runners/_runner.html.haml
@@ -36,6 +36,8 @@
- if runner.description.present?
%p.runner-description
= runner.description
+ - if runner.defines_job_upper_timeout?
+ %p Job upper timeout: #{runner.job_upper_timeout}
- if runner.tag_list.present?
%p
- runner.tag_list.sort.each do |tag|
diff --git a/app/views/projects/runners/show.html.haml b/app/views/projects/runners/show.html.haml
index 4e57f5f844d..e0223eeb729 100644
--- a/app/views/projects/runners/show.html.haml
+++ b/app/views/projects/runners/show.html.haml
@@ -56,6 +56,9 @@
%td Description
%td= @runner.description
%tr
+ %td Job upper timeout
+ %td= @runner.job_upper_timeout
+ %tr
%td Last contact
%td
- if @runner.contacted_at