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
LAST_CONTACT_TIME = 5.minutes.ago
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 :runner_projects, dependent: :destroy, class_name: 'Ci::RunnerProject'
......
......@@ -9,8 +9,6 @@
%span.runner-state.runner-state-specific
Specific
- if @runner.shared?
.bs-callout.bs-callout-success
%h4 This runner will process builds from ALL UNASSIGNED projects
......
......@@ -5,7 +5,7 @@
- if @runners.include?(runner)
= link_to runner.short_sha, runner_path(runner)
%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
- else
= runner.short_sha
......
......@@ -17,50 +17,39 @@
%th Property Name
%th Value
%tr
%td
Tags
%td Active
%td= @runner.active? ? 'Yes' : 'No'
%tr
%td Can run untagged jobs
%td= @runner.run_untagged? ? 'Yes' : 'No'
%tr
%td Tags
%td
- @runner.tag_list.each do |tag|
%span.label.label-primary
= tag
%tr
%td
Name
%td
= @runner.name
%td Name
%td= @runner.name
%tr
%td
Version
%td
= @runner.version
%td Version
%td= @runner.version
%tr
%td
Revision
%td
= @runner.revision
%td Revision
%td= @runner.revision
%tr
%td
Platform
%td
= @runner.platform
%td Platform
%td= @runner.platform
%tr
%td
Architecture
%td
= @runner.architecture
%td Architecture
%td= @runner.architecture
%tr
%td
Description
%td
= @runner.description
%td Description
%td= @runner.description
%tr
%td
Last contact
%td Last contact
%td
- if @runner.contacted_at
#{time_ago_in_words(@runner.contacted_at)} ago
- else
Never
......@@ -110,4 +110,33 @@ describe "Runners" do
expect(page).to have_content(@specific_runner.platform)
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
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