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
f645ce7a
Commit
f645ce7a
authored
Sep 28, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose CI/CD Quotas limits in the namespace / group
parent
b4fcaa6c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
0 deletions
+68
-0
ee/app/models/ee/namespace.rb
ee/app/models/ee/namespace.rb
+10
-0
spec/ee/spec/models/ee/namespace_spec.rb
spec/ee/spec/models/ee/namespace_spec.rb
+58
-0
No files found.
ee/app/models/ee/namespace.rb
View file @
f645ce7a
...
...
@@ -108,6 +108,16 @@ module EE
end
end
# TODO, CI/CD Quotas feature check
#
def
max_active_pipelines
plan
&
.
active_pipelines_limit
.
to_i
end
def
max_pipeline_size
plan
&
.
pipeline_size_limit
.
to_i
end
private
def
validate_plan_name
...
...
spec/ee/spec/models/ee/namespace_spec.rb
View file @
f645ce7a
...
...
@@ -156,6 +156,64 @@ describe Namespace do
end
end
describe
'#max_active_pipelines'
do
context
'when there is no plan associated'
do
it
'returns zero'
do
expect
(
namespace
.
max_active_pipelines
).
to
be_zero
end
end
context
'when limit is not defined'
do
before
do
namespace
.
plan
=
Namespace
::
GOLD_PLAN
end
it
'returns zero'
do
expect
(
namespace
.
max_active_pipelines
).
to
be_zero
end
end
context
'when limit is defined'
do
before
do
namespace
.
plan
=
Namespace
::
GOLD_PLAN
namespace
.
plan
.
update_column
(
:active_pipelines_limit
,
10
)
end
it
'returns a number of maximum active pipelines'
do
expect
(
namespace
.
max_active_pipelines
).
to
eq
10
end
end
end
describe
'#max_pipeline_size'
do
context
'when there is no plan associated'
do
it
'returns zero'
do
expect
(
namespace
.
max_active_pipelines
).
to
be_zero
end
end
context
'when limit is not defined'
do
before
do
namespace
.
plan
=
Namespace
::
GOLD_PLAN
end
it
'returns zero'
do
expect
(
namespace
.
max_pipeline_size
).
to
be_zero
end
end
context
'when limit is defined'
do
before
do
namespace
.
plan
=
Namespace
::
GOLD_PLAN
namespace
.
plan
.
update_column
(
:pipeline_size_limit
,
15
)
end
it
'returns a number of maximum pipeline size'
do
expect
(
namespace
.
max_pipeline_size
).
to
eq
15
end
end
end
describe
'#shared_runners_enabled?'
do
subject
{
namespace
.
shared_runners_enabled?
}
...
...
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