Commit 8ebedab8 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch '2139-pipelines-minutes' into 'master'

Rename build minutes to pipeline minutes

Closes #2139

See merge request !1644
parents b2e02061 9ff492bd
.form-group
= form.label :shared_runners_minutes, 'Build minutes quota', class: 'control-label col-sm-2'
= form.label :shared_runners_minutes, 'Pipeline minutes quota', class: 'control-label col-sm-2'
.col-sm-10
= form.number_field :shared_runners_minutes, class: 'form-control'
.help-block
Set the maximum number of build minutes that a group can use on shared Runners per month.
Set the maximum number of pipeline minutes that a group can use on shared Runners per month.
0 for unlimited.
= link_to icon('question-circle'), help_page_path("user/admin_area/settings/continuous_integration", anchor: "shared-runners-build-minutes-quota"), target: '_blank'
......@@ -6,8 +6,8 @@
Enabled
- if project.shared_runners_minutes_limit_enabled?
- limit = project.actual_shared_runners_minutes_limit.to_i
(Limited to #{limit} build minutes per month)
(Limited to #{limit} pipeline minutes per month)
- else
(Unlimited build minutes)
(Unlimited pipeline minutes)
- else
Disabled
......@@ -5,7 +5,7 @@
Group pipelines quota
= link_to icon('question-circle'), help_page_path("user/admin_area/settings/continuous_integration", anchor: "shared-runners-build-minutes-quota"), target: '_blank'
%p.light
Monthly build minutes usage across shared Runners for the
Monthly pipeline minutes usage across shared Runners for the
%strong= @group.name
group
......
- namespace = local_assigns.fetch(:namespace)
- if namespace.shared_runners_enabled?
%li
%span.light Build minutes quota:
%span.light Pipeline minutes quota:
%strong
= group_shared_runner_limits_quota(namespace)
= link_to icon('question-circle'), help_page_path("user/admin_area/settings/continuous_integration", anchor: "shared-runners-build-minutes-quota"), target: '_blank'
- if current_user.admin?
.form-group
= f.label :shared_runners_minutes_limit, class: 'control-label' do
Build Minutes Quota
Pipeline Minutes Quota
.col-sm-10
= f.number_field :shared_runners_minutes_limit, class: 'form-control', min: 0
%span.help-block#shared_runners_minutes_limit_help_block
Set the maximum number of build minutes that a group can use on shared Runners per month.
Set the maximum number of pipeline minutes that a group can use on shared Runners per month.
Set 0 for unlimited.
Set empty to inherit the global setting of #{current_application_settings.shared_runners_minutes}.
= link_to icon('question-circle'), help_page_path("user/admin_area/settings/continuous_integration", anchor: "shared-runners-build-minutes-quota"), target: '_blank'
......@@ -3,7 +3,7 @@
- quota_limit = project.namespace.actual_shared_runners_minutes_limit
.bs-callout.bs-callout-warning
%p
You have used all your shared Runners build minutes.
You have used all your shared Runners pipeline minutes.
= "(#{quota_used} of #{quota_limit})."
- if can?(current_user, :admin_build, @project)
%br
......
......@@ -6,7 +6,7 @@
- if cookies[:hide_shared_runner_quota_message].blank? && has_limit && namespace.shared_runners_minutes_used? && can_see_status
.shared-runner-quota-message.alert.alert-warning.hidden-xs{ data: { scope: scope } }
= namespace.name
has exceeded their build minutes quota. Pipelines will not run anymore on shared Runners.
has exceeded their pipeline minutes quota. Pipelines will not run anymore on shared Runners.
.pull-right
= link_to 'Remind later', '#', class: 'hide-shared-runner-limit-message alert-link'
......@@ -37,13 +37,13 @@ expiration.
[art-yml]: ../../../administration/job_artifacts.md
[duration-syntax]: ../../../ci/yaml/README.md#artifactsexpire_in
## Shared Runners build minutes quota
## Shared Runners pipeline minutes quota
> [Introduced][ee-1078] in GitLab Enterprise Edition 8.16.
If you have enabled shared Runners for your GitLab instance, you can limit their
usage by setting a maximum number of build minutes that a group can use on
shared Runners per month. Set 0 to grant unlimited build minutes.
usage by setting a maximum number of pipeline minutes that a group can use on
shared Runners per month. Set 0 to grant unlimited pipeline minutes.
While build limits are stored as minutes, the counting is done in seconds.
1. Go to the **Admin area ➔ Settings** (`/admin/application_settings`).
......@@ -51,23 +51,23 @@ While build limits are stored as minutes, the counting is done in seconds.
![Admin area settings button](img/admin_area_settings_button.png)
1. Navigate to the **Continuous Integration** block and enable the Shared
Runners setting. Then set the build minutes quota limit.
Runners setting. Then set the pipeline minutes quota limit.
![Shared Runners build minutes quota](img/ci_shared_runners_build_minutes_quota.png)
![Shared Runners pipeline minutes quota](img/ci_shared_runners_build_minutes_quota.png)
1. Hit **Save** for the changes to take effect.
---
While the setting in the Admin area has a global effect, as an admin you can
also change each group's build minutes quota to override the global value.
also change each group's pipeline minutes quota to override the global value.
1. Navigate to the **Groups** admin area and hit the **Edit** button for the
group you wish to change the build minutes quota.
group you wish to change the pipeline minutes quota.
![Groups in the admin area](img/admin_area_groups.png)
1. Set the build minutes quota to the desired value and hit **Save changes** for
1. Set the pipeline minutes quota to the desired value and hit **Save changes** for
the changes to take effect.
![Edit group in the admin area](img/admin_area_group_edit.png)
......@@ -81,12 +81,12 @@ are enabled.
![Project admin info](img/admin_project_quota_view.png)
When the build minutes quota for a group is set to a value different than 0,
When the pipeline minutes quota for a group is set to a value different than 0,
the **Pipelines quota** page is available to the group page settings list.
![Group settings](img/group_settings.png)
You can see there an overview of the build minutes quota of all projects of
You can see there an overview of the pipeline minutes quota of all projects of
the group.
![Group pipelines quota](img/group_pipelines_quota.png)
......
......@@ -208,7 +208,7 @@ describe "Admin::Users", feature: true do
click_link user.name
expect(page).to have_content('Build minutes quota: 0 / 500')
expect(page).to have_content('Pipeline minutes quota: 0 / 500')
end
end
......@@ -222,7 +222,7 @@ describe "Admin::Users", feature: true do
click_link user.name
expect(page).not_to have_content('Build minutes quota:')
expect(page).not_to have_content('Pipeline minutes quota:')
end
end
end
......@@ -299,7 +299,7 @@ describe "Admin::Users", feature: true do
end
it "shows page with new data" do
expect(page).to have_content('Build minutes quota: 0 / 500')
expect(page).to have_content('Pipeline minutes quota: 0 / 500')
end
end
end
......
......@@ -15,7 +15,7 @@ feature 'CI shared runner settings', feature: true do
context 'without global shared runners quota' do
scenario 'should display ratio with global quota' do
visit_admin_group_path
expect(page).to have_content("Build minutes quota: 400 / Unlimited")
expect(page).to have_content("Pipeline minutes quota: 400 / Unlimited")
expect(page).to have_selector('.shared_runners_limit_disabled')
end
end
......@@ -27,21 +27,21 @@ feature 'CI shared runner settings', feature: true do
scenario 'should display ratio with global quota' do
visit_admin_group_path
expect(page).to have_content("Build minutes quota: 400 / 500")
expect(page).to have_content("Pipeline minutes quota: 400 / 500")
expect(page).to have_selector('.shared_runners_limit_under_quota')
end
scenario 'should display new ratio with overridden group quota' do
set_group_shared_runners_minutes 300
visit_admin_group_path
expect(page).to have_content("Build minutes quota: 400 / 300")
expect(page).to have_content("Pipeline minutes quota: 400 / 300")
expect(page).to have_selector('.shared_runners_limit_over_quota')
end
scenario 'should display unlimited ratio with overridden group quota' do
set_group_shared_runners_minutes 0
visit_admin_group_path
expect(page).to have_content("Build minutes quota: 400 / Unlimited")
expect(page).to have_content("Pipeline minutes quota: 400 / Unlimited")
expect(page).to have_selector('.shared_runners_limit_disabled')
end
end
......
......@@ -32,12 +32,12 @@ feature 'CI shared runner limits', feature: true do
scenario 'it displays a warning message on project homepage' do
visit_project_home
expect_quota_exceeded_alert("#{group.name} has exceeded their build minutes quota.")
expect_quota_exceeded_alert("#{group.name} has exceeded their pipeline minutes quota.")
end
scenario 'it displays a warning message on pipelines page' do
visit_project_pipelines
expect_quota_exceeded_alert("#{group.name} has exceeded their build minutes quota.")
expect_quota_exceeded_alert("#{group.name} has exceeded their pipeline minutes quota.")
end
end
......
......@@ -282,7 +282,7 @@ feature 'Builds', :feature do
it 'displays a warning message' do
visit namespace_project_build_path(project.namespace, project, build)
expect(page).to have_content('You have used all your shared Runners build minutes.')
expect(page).to have_content('You have used all your shared Runners pipeline minutes.')
end
end
end
......
......@@ -41,7 +41,7 @@ describe Ci::Build, models: true do
end
end
context 'updates build minutes' do
context 'updates pipeline minutes' do
let(:build) { create(:ci_build, :running, pipeline: pipeline) }
%w(success drop cancel).each do |event|
......
......@@ -31,7 +31,7 @@ describe Project, models: true do
expect(project.any_runners? { |runner| runner == shared_runner }).to be_truthy
end
context 'with used build minutes' do
context 'with used pipeline minutes' do
let(:namespace) { create(:namespace, :with_used_build_minutes_limit) }
let(:project) do
create(:empty_project,
......@@ -49,7 +49,7 @@ describe Project, models: true do
describe '#shared_runners_available?' do
subject { project.shared_runners_available? }
context 'with used build minutes' do
context 'with used pipeline minutes' do
let(:namespace) { create(:namespace, :with_used_build_minutes_limit) }
let(:project) do
create(:empty_project,
......
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