Commit ab0ec603 authored by Doug Stull's avatar Doug Stull

Add running out alert to pipeline job

- add this in the UI for pipeline job for better
  visibility.
parent e22534e9
......@@ -358,7 +358,6 @@ linters:
- "ee/app/views/notify/unapproved_merge_request_email.html.haml"
- "ee/app/views/oauth/geo_auth/error.html.haml"
- "ee/app/views/projects/commits/_mirror_status.html.haml"
- "ee/app/views/projects/jobs/_shared_runner_limit_warning.html.haml"
- "ee/app/views/projects/merge_requests/_approvals_count.html.haml"
- "ee/app/views/projects/merge_requests/widget/open/_geo.html.haml"
- "ee/app/views/projects/mirrors/_mirrored_repositories_count.html.haml"
......
......@@ -5,4 +5,6 @@
- content_for :page_specific_javascripts do
= stylesheet_link_tag 'page_bundles/xterm'
= render_if_exists "shared/shared_runners_minutes_limit_flash_message"
#js-job-vue-app{ data: jobs_data }
import '~/pages/projects/jobs/show/index';
import initVueAlerts from '~/vue_alerts';
document.addEventListener('DOMContentLoaded', initVueAlerts);
- if project.shared_runners_limit_namespace.shared_runners_minutes_used?
- quota_used = project.shared_runners_limit_namespace.shared_runners_minutes
- quota_limit = project.shared_runners_limit_namespace.actual_shared_runners_minutes_limit
.bs-callout.bs-callout-warning
%p
You have used all your shared Runners pipeline minutes.
= "(#{quota_used} of #{quota_limit})."
- if can?(current_user, :admin_build, @project)
%br
For more information, go to the
= succeed "." do
= link_to project_runners_path(project) do
Runners page
---
title: Add running out of minutes warning to CI job pages
merge_request: 35622
author:
type: added
......@@ -6,8 +6,10 @@ RSpec.describe 'CI shared runner limits' do
using RSpec::Parameterized::TableSyntax
let_it_be(:user) { create(:user) }
let!(:project) { create(:project, :repository, namespace: group, shared_runners_enabled: true) }
let(:project) { create(:project, :repository, namespace: group, shared_runners_enabled: true) }
let(:group) { create(:group) }
let(:pipeline) { create(:ci_empty_pipeline, project: project, sha: project.commit.sha, ref: 'master') }
let!(:job) { create(:ci_build, pipeline: pipeline) }
before do
sign_in(user)
......@@ -46,6 +48,12 @@ RSpec.describe 'CI shared runner limits' do
expect_quota_exceeded_alert(message)
end
it 'displays a warning message on a job page' do
visit project_job_path(project, job)
expect_quota_exceeded_alert(message)
end
end
end
......@@ -67,6 +75,12 @@ RSpec.describe 'CI shared runner limits' do
expect_quota_exceeded_alert(message)
end
it 'displays a warning message on a job page' do
visit project_job_path(project, job)
expect_quota_exceeded_alert(message)
end
end
context 'when limit not yet exceeded' do
......@@ -83,6 +97,12 @@ RSpec.describe 'CI shared runner limits' do
expect_no_quota_exceeded_alert
end
it 'displays a warning message on a job page' do
visit project_job_path(project, job)
expect_no_quota_exceeded_alert
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