Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5b97b793
Commit
5b97b793
authored
Dec 19, 2016
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not display CI limit warnings when user cannot start pipelines anyway
parent
90741eea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
13 deletions
+23
-13
app/views/projects/empty.html.haml
app/views/projects/empty.html.haml
+1
-1
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+1
-1
app/views/shared/_shared_runner_minutes_limit.html.haml
app/views/shared/_shared_runner_minutes_limit.html.haml
+6
-6
spec/features/ci_shared_runner_limits_spec.rb
spec/features/ci_shared_runner_limits_spec.rb
+15
-5
No files found.
app/views/projects/empty.html.haml
View file @
5b97b793
...
...
@@ -4,7 +4,7 @@
-
if
current_user
&&
can?
(
current_user
,
:download_code
,
@project
)
=
render
'shared/no_ssh'
=
render
'shared/no_password'
=
render
'shared/shared_runner_minutes_limit'
,
namespace:
@project
.
namespace
=
render
'shared/shared_runner_minutes_limit'
,
project:
@project
=
render
"home_panel"
...
...
app/views/projects/show.html.haml
View file @
5b97b793
...
...
@@ -8,7 +8,7 @@
-
if
current_user
&&
can?
(
current_user
,
:download_code
,
@project
)
=
render
'shared/no_ssh'
=
render
'shared/no_password'
=
render
'shared/shared_runner_minutes_limit'
,
namespace:
@project
.
namespace
=
render
'shared/shared_runner_minutes_limit'
,
project:
@project
-
if
@project
.
above_size_limit?
=
render
'above_size_limit_warning'
...
...
app/views/shared/_shared_runner_minutes_limit.html.haml
View file @
5b97b793
-
if
cookies
[
:hide_shared_runner_quota_message
].
blank?
&&
namespace
.
shared_runners_minutes_used?
-
project
=
local_assigns
.
fetch
(
:project
,
nil
)
-
namespace
=
local_assigns
.
fetch
(
:namespace
,
project
&&
project
.
namespace
)
-
can_see_status
=
project
.
nil?
||
can?
(
current_user
,
:create_pipeline
,
project
)
-
if
cookies
[
:hide_shared_runner_quota_message
].
blank?
&&
namespace
.
shared_runners_minutes_used?
&&
can_see_status
.shared-runner-quota-message.alert.alert-warning.hidden-xs
-
if
namespace
.
class
.
to_s
===
'Group'
Your group has exceeded its build minutes quota.
-
else
You have exceeded your build minutes quota.
Pipelines will not run anymore on shared runners.
=
namespace
.
name
has exceeded their build minutes quota. Pipelines will not run anymore on shared runners.
.pull-right
=
link_to
"Don't show again this month"
,
'#'
,
class:
'hide-shared-runner-limit-message-one-month alert-link'
...
...
spec/features/ci_shared_runner_limits_spec.rb
View file @
5b97b793
...
...
@@ -2,15 +2,14 @@ require 'spec_helper'
feature
'CI shared runner limits'
,
feature:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
namespace:
namespace
,
shared_runners_enabled:
true
)
}
let
(
:namespace
)
{
create
(
:namespace
)
}
before
do
login_as
(
user
)
end
context
'with project'
do
let
(
:project
)
{
create
(
:project
,
namespace:
namespace
,
shared_runners_enabled:
true
)
}
let
(
:namespace
)
{
create
(
:namespace
)
}
context
'when project member'
do
before
do
project
.
team
<<
[
user
,
:developer
]
end
...
...
@@ -28,7 +27,7 @@ feature 'CI shared runner limits', feature: true do
scenario
'it displays a warning message on project homepage'
do
visit
namespace_project_path
(
project
.
namespace
,
project
)
expect_quota_exceeded_alert
(
'You have exceeded your build minutes quota.'
)
expect_quota_exceeded_alert
(
"
#{
namespace
.
name
}
has exceeded their build minutes quota."
)
end
end
...
...
@@ -52,6 +51,17 @@ feature 'CI shared runner limits', feature: true do
end
end
context
'when not a project member'
do
let
(
:namespace
)
{
create
(
:namespace
,
:with_used_build_minutes_limit
)
}
context
'when limit is defined and limit is exceeded'
do
scenario
'it does not display a warning message on project homepage'
do
visit
namespace_project_path
(
project
.
namespace
,
project
)
expect_no_quota_exceeded_alert
end
end
end
def
expect_quota_exceeded_alert
(
message
=
nil
)
expect
(
page
).
to
have_selector
(
'.shared-runner-quota-message'
,
count:
1
)
expect
(
page
.
find
(
'.shared-runner-quota-message'
)).
to
have_content
(
message
)
unless
message
.
nil?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment