Commit 2aa57071 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Extend runner config options for untagged jobs

parent a8a205cd
...@@ -4,7 +4,7 @@ module Ci ...@@ -4,7 +4,7 @@ module Ci
LAST_CONTACT_TIME = 5.minutes.ago LAST_CONTACT_TIME = 5.minutes.ago
AVAILABLE_SCOPES = %w[specific shared active paused online] AVAILABLE_SCOPES = %w[specific shared active paused online]
FORM_EDITABLE = %i[description tag_list active] FORM_EDITABLE = %i[description tag_list active run_untagged]
has_many :builds, class_name: 'Ci::Build' has_many :builds, class_name: 'Ci::Build'
has_many :runner_projects, dependent: :destroy, class_name: 'Ci::RunnerProject' has_many :runner_projects, dependent: :destroy, class_name: 'Ci::RunnerProject'
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
%span.runner-state.runner-state-specific %span.runner-state.runner-state-specific
Specific Specific
- if @runner.shared? - if @runner.shared?
.bs-callout.bs-callout-success .bs-callout.bs-callout-success
%h4 This runner will process builds from ALL UNASSIGNED projects %h4 This runner will process builds from ALL UNASSIGNED projects
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
- if @runners.include?(runner) - if @runners.include?(runner)
= link_to runner.short_sha, runner_path(runner) = link_to runner.short_sha, runner_path(runner)
%small %small
=link_to edit_namespace_project_runner_path(@project.namespace, @project, runner) do = link_to edit_namespace_project_runner_path(@project.namespace, @project, runner) do
%i.fa.fa-edit.btn %i.fa.fa-edit.btn
- else - else
= runner.short_sha = runner.short_sha
......
...@@ -17,50 +17,39 @@ ...@@ -17,50 +17,39 @@
%th Property Name %th Property Name
%th Value %th Value
%tr %tr
%td %td Active
Tags %td= @runner.active? ? 'Yes' : 'No'
%tr
%td Can run untagged jobs
%td= @runner.run_untagged? ? 'Yes' : 'No'
%tr
%td Tags
%td %td
- @runner.tag_list.each do |tag| - @runner.tag_list.each do |tag|
%span.label.label-primary %span.label.label-primary
= tag = tag
%tr %tr
%td %td Name
Name %td= @runner.name
%td
= @runner.name
%tr %tr
%td %td Version
Version %td= @runner.version
%td
= @runner.version
%tr %tr
%td %td Revision
Revision %td= @runner.revision
%td
= @runner.revision
%tr %tr
%td %td Platform
Platform %td= @runner.platform
%td
= @runner.platform
%tr %tr
%td %td Architecture
Architecture %td= @runner.architecture
%td
= @runner.architecture
%tr %tr
%td %td Description
Description %td= @runner.description
%td
= @runner.description
%tr %tr
%td %td Last contact
Last contact
%td %td
- if @runner.contacted_at - if @runner.contacted_at
#{time_ago_in_words(@runner.contacted_at)} ago #{time_ago_in_words(@runner.contacted_at)} ago
- else - else
Never Never
...@@ -110,4 +110,33 @@ describe "Runners" do ...@@ -110,4 +110,33 @@ describe "Runners" do
expect(page).to have_content(@specific_runner.platform) expect(page).to have_content(@specific_runner.platform)
end end
end end
feature 'configuring runners ability to picking untagged jobs' do
given(:project) { create(:empty_project) }
given(:runner) { create(:ci_runner) }
background do
project.team << [user, :master]
project.runners << runner
end
scenario 'user checks default configuration' do
visit namespace_project_runner_path(project.namespace, project, runner)
expect(page).to have_content 'Can run untagged jobs Yes'
end
scenario 'user want to prevent runner from running untagged job' do
visit runners_path(project)
page.within('.activated-specific-runners') do
first('small > a').click
end
uncheck 'runner_run_untagged'
click_button 'Save changes'
expect(page).to have_content 'Can run untagged jobs No'
expect(runner.reload.run_untagged?).to eq false
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment