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
864fa093
Commit
864fa093
authored
Nov 21, 2017
by
ayufanpl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flip shared_runner_minutes_on_subnamespace to shared_runner_minutes_on_root_namespace
parent
a6bfa4b8
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
41 additions
and
47 deletions
+41
-47
ee/app/controllers/groups/pipeline_quota_controller.rb
ee/app/controllers/groups/pipeline_quota_controller.rb
+3
-3
ee/app/models/ee/namespace.rb
ee/app/models/ee/namespace.rb
+4
-4
ee/app/models/ee/project.rb
ee/app/models/ee/project.rb
+3
-3
ee/app/services/ee/ci/register_job_service.rb
ee/app/services/ee/ci/register_job_service.rb
+1
-1
spec/ee/spec/features/groups/pipeline_quota_spec.rb
spec/ee/spec/features/groups/pipeline_quota_spec.rb
+4
-4
spec/ee/spec/models/ee/namespace_spec.rb
spec/ee/spec/models/ee/namespace_spec.rb
+10
-10
spec/ee/spec/models/ee/project_spec.rb
spec/ee/spec/models/ee/project_spec.rb
+4
-4
spec/ee/spec/services/ee/ci/register_job_service_spec.rb
spec/ee/spec/services/ee/ci/register_job_service_spec.rb
+4
-4
spec/ee/spec/views/admin/groups/_form.html.haml_spec.rb
spec/ee/spec/views/admin/groups/_form.html.haml_spec.rb
+4
-4
spec/ee/support/shared_runners_minutes_feature_flag.rb
spec/ee/support/shared_runners_minutes_feature_flag.rb
+0
-6
spec/services/update_build_minutes_service_spec.rb
spec/services/update_build_minutes_service_spec.rb
+4
-4
No files found.
ee/app/controllers/groups/pipeline_quota_controller.rb
View file @
864fa093
...
...
@@ -11,10 +11,10 @@ class Groups::PipelineQuotaController < Groups::ApplicationController
private
def
all_projects
if
Feature
.
enabled?
(
:shared_runner_minutes_on_subnamespace
)
@group
.
projects
else
if
Feature
.
enabled?
(
:shared_runner_minutes_on_root_namespace
)
@group
.
all_projects
else
@group
.
projects
end
end
...
...
ee/app/models/ee/namespace.rb
View file @
864fa093
...
...
@@ -95,7 +95,7 @@ module EE
def
shared_runner_minutes_supported?
if
has_parent?
Feature
.
enabled?
(
:shared_runner_minutes_on_sub
namespace
)
!
Feature
.
enabled?
(
:shared_runner_minutes_on_root_
namespace
)
else
true
end
...
...
@@ -118,10 +118,10 @@ module EE
end
def
shared_runners_enabled?
if
Feature
.
enabled?
(
:shared_runner_minutes_on_subnamespace
)
projects
.
with_shared_runners
.
any?
else
if
Feature
.
enabled?
(
:shared_runner_minutes_on_root_namespace
)
all_projects
.
with_shared_runners
.
any?
else
projects
.
with_shared_runners
.
any?
end
end
...
...
ee/app/models/ee/project.rb
View file @
864fa093
...
...
@@ -83,10 +83,10 @@ module EE
end
def
shared_runners_limit_namespace
if
Feature
.
enabled?
(
:shared_runner_minutes_on_subnamespace
)
namespace
else
if
Feature
.
enabled?
(
:shared_runner_minutes_on_root_namespace
)
root_namespace
else
namespace
end
end
...
...
ee/app/services/ee/ci/register_job_service.rb
View file @
864fa093
...
...
@@ -28,7 +28,7 @@ module EE
def
all_namespaces
namespaces
=
::
Namespace
.
reorder
(
nil
).
where
(
'namespaces.id = projects.namespace_id'
)
unless
Feature
.
enabled?
(
:shared_runner_minutes_on_sub
namespace
)
if
Feature
.
enabled?
(
:shared_runner_minutes_on_root_
namespace
)
namespaces
=
::
Gitlab
::
GroupHierarchy
.
new
(
namespaces
).
roots
end
...
...
spec/ee/spec/features/groups/pipeline_quota_spec.rb
View file @
864fa093
...
...
@@ -101,9 +101,9 @@ feature 'Groups > Pipeline Quota' do
end
end
context
'with shared_runner_minutes_on_
subnamespace en
abled'
do
context
'with shared_runner_minutes_on_
root_namespace dis
abled'
do
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
tru
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
fals
e
)
end
context
'when accessing group with subgroups'
do
...
...
@@ -120,9 +120,9 @@ feature 'Groups > Pipeline Quota' do
end
end
context
'with shared_runner_minutes_on_
subnamespace dis
abled'
do
context
'with shared_runner_minutes_on_
root_namespace en
abled'
do
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
fals
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
tru
e
)
end
context
'when accessing subgroup'
do
...
...
spec/ee/spec/models/ee/namespace_spec.rb
View file @
864fa093
...
...
@@ -66,7 +66,7 @@ describe Namespace do
describe
'#validate_shared_runner_minutes_support'
do
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
fals
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
tru
e
)
end
context
'when changing :shared_runners_minutes_limit'
do
...
...
@@ -331,9 +331,9 @@ describe Namespace do
namespace
.
parent
=
build
(
:group
)
end
context
'when shared_runner_minutes_on_
subnamespace is en
abled'
do
context
'when shared_runner_minutes_on_
root_namespace is dis
abled'
do
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
tru
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
fals
e
)
end
it
'returns true'
do
...
...
@@ -341,9 +341,9 @@ describe Namespace do
end
end
context
'when shared_runner_minutes_on_
subnamespace is disalb
ed'
do
context
'when shared_runner_minutes_on_
root_namespace is enabl
ed'
do
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
fals
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
tru
e
)
end
it
'returns false'
do
...
...
@@ -382,7 +382,7 @@ describe Namespace do
context
'when is subgroup'
do
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
fals
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
tru
e
)
namespace
.
parent
=
build
(
:group
)
end
...
...
@@ -403,9 +403,9 @@ describe Namespace do
let
(
:subgroup
)
{
create
(
:group
,
parent:
namespace
)
}
let!
(
:subproject
)
{
create
(
:project
,
namespace:
subgroup
,
shared_runners_enabled:
true
)
}
context
'when shared_runner_minutes_on_
subnamespace is en
abled'
do
context
'when shared_runner_minutes_on_
root_namespace is dis
abled'
do
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
tru
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
fals
e
)
end
it
"returns false"
do
...
...
@@ -413,9 +413,9 @@ describe Namespace do
end
end
context
'when shared_runner_minutes_on_
subnamespace is dis
abled'
do
context
'when shared_runner_minutes_on_
root_namespace is en
abled'
do
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
fals
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
tru
e
)
end
it
"returns true"
do
...
...
spec/ee/spec/models/ee/project_spec.rb
View file @
864fa093
...
...
@@ -539,9 +539,9 @@ describe Project do
subject
{
project
.
shared_runners_limit_namespace
}
context
'when shared_runner_minutes_on_
subnamespace is en
abled'
do
context
'when shared_runner_minutes_on_
root_namespace is dis
abled'
do
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
tru
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
fals
e
)
end
it
'returns parent namespace'
do
...
...
@@ -549,9 +549,9 @@ describe Project do
end
end
context
'when shared_runner_minutes_on_
subnamespace is dis
abled'
do
context
'when shared_runner_minutes_on_
root_namespace is en
abled'
do
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
fals
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
tru
e
)
end
it
'returns root namespace'
do
...
...
spec/ee/spec/services/ee/ci/register_job_service_spec.rb
View file @
864fa093
...
...
@@ -69,9 +69,9 @@ module Ci
let!
(
:project
)
{
create
:project
,
shared_runners_enabled:
true
,
group:
group
}
let
(
:build
)
{
execute
(
shared_runner
)
}
context
'when shared_runner_minutes_on_
subnamespace is en
abled'
do
context
'when shared_runner_minutes_on_
root_namespace is dis
abled'
do
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
tru
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
fals
e
)
end
it
"does return a build"
do
...
...
@@ -90,9 +90,9 @@ module Ci
end
end
context
'when shared_runner_minutes_on_
subnamespace is dis
abled'
do
context
'when shared_runner_minutes_on_
root_namespace is en
abled'
do
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
fals
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
tru
e
)
end
it
"does return a build"
do
...
...
spec/ee/spec/views/admin/groups/_form.html.haml_spec.rb
View file @
864fa093
...
...
@@ -10,9 +10,9 @@ describe 'admin/groups/_form' do
allow
(
view
).
to
receive
(
:visibility_level
)
{
group
.
visibility_level
}
end
describe
'when :shared_runner_minutes_on_
subnamespace is en
abled'
do
describe
'when :shared_runner_minutes_on_
root_namespace is dis
abled'
do
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
tru
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
fals
e
)
end
context
'when sub group is used'
do
...
...
@@ -27,9 +27,9 @@ describe 'admin/groups/_form' do
end
end
describe
'when :shared_runner_minutes_on_
subnamespace is dis
abled'
do
describe
'when :shared_runner_minutes_on_
root_namespace is en
abled'
do
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
fals
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
tru
e
)
end
context
'when sub group is used'
do
...
...
spec/ee/support/shared_runners_minutes_feature_flag.rb
deleted
100644 → 0
View file @
a6bfa4b8
RSpec
.
configure
do
|
config
|
config
.
before
(
:all
)
do
puts
"this feature is by default disabled"
Feature
.
get
(
:shared_runner_minutes_on_subnamespace
).
disable
end
end
spec/services/update_build_minutes_service_spec.rb
View file @
864fa093
...
...
@@ -46,11 +46,11 @@ describe UpdateBuildMinutesService do
context
'when namespace is subgroup'
do
let
(
:root_ancestor
)
{
create
(
:group
,
shared_runners_minutes_limit:
100
)
}
context
'when shared_runner_minutes_on_
subnamespace is en
abled'
do
context
'when shared_runner_minutes_on_
root_namespace is dis
abled'
do
let
(
:namespace
)
{
create
(
:namespace
,
parent:
root_ancestor
,
shared_runners_minutes_limit:
100
)
}
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
tru
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
fals
e
)
end
it
'creates a statistics in current namespace'
do
...
...
@@ -61,11 +61,11 @@ describe UpdateBuildMinutesService do
end
end
context
'when shared_runner_minutes_on_
subnamespace is dis
abled'
do
context
'when shared_runner_minutes_on_
root_namespace is en
abled'
do
let
(
:namespace
)
{
create
(
:namespace
,
parent:
root_ancestor
)
}
before
do
stub_feature_flags
(
shared_runner_minutes_on_
subnamespace:
fals
e
)
stub_feature_flags
(
shared_runner_minutes_on_
root_namespace:
tru
e
)
end
it
'creates a statistics in root namespace'
do
...
...
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