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
bb59ec6f
Commit
bb59ec6f
authored
Oct 14, 2020
by
Corinna Wiesner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address review comments
parent
9e0da6ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
15 deletions
+10
-15
changelogs/unreleased/refactor_namespace_all_projects.yml
changelogs/unreleased/refactor_namespace_all_projects.yml
+0
-5
ee/spec/services/update_build_minutes_service_spec.rb
ee/spec/services/update_build_minutes_service_spec.rb
+6
-6
spec/models/namespace_spec.rb
spec/models/namespace_spec.rb
+4
-4
No files found.
changelogs/unreleased/refactor_namespace_all_projects.yml
deleted
100644 → 0
View file @
9e0da6ac
---
title
:
Add recursive approach to Namespace#all_projects
merge_request
:
44740
author
:
type
:
changed
ee/spec/services/update_build_minutes_service_spec.rb
View file @
bb59ec6f
...
...
@@ -46,15 +46,15 @@ RSpec.describe UpdateBuildMinutesService do
end
end
context
'when
namespace
is subgroup'
do
context
'when
group
is subgroup'
do
let
(
:root_ancestor
)
{
create
(
:group
,
shared_runners_minutes_limit:
100
)
}
let
(
:namespace
)
{
create
(
:
namespace
,
parent:
root_ancestor
)
}
let
(
:namespace
)
{
create
(
:
group
,
parent:
root_ancestor
)
}
it
'creates a statistics in root
namespace
'
do
it
'creates a statistics in root
group
'
do
subject
expect
(
root_ancestor
.
namespace_statistics
&
.
shared_runners_seconds
)
.
to
be_nil
expect
(
root_ancestor
.
namespace_statistics
.
reload
.
shared_runners_seconds
)
.
to
eq
(
build
.
duration
.
to_i
*
2
)
end
context
'with disabled feature flag :recursive_approach_for_all_projects in Namespace#all_projects'
do
...
...
@@ -62,7 +62,7 @@ RSpec.describe UpdateBuildMinutesService do
stub_feature_flags
(
recursive_approach_for_all_projects:
false
)
end
it
'creates a statistics in root
namespace
'
do
it
'creates a statistics in root
group
'
do
subject
expect
(
root_ancestor
.
namespace_statistics
.
reload
.
shared_runners_seconds
)
...
...
spec/models/namespace_spec.rb
View file @
bb59ec6f
...
...
@@ -856,10 +856,10 @@ RSpec.describe Namespace do
describe
'#all_projects'
do
shared_examples
'all projects for a namespace'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:child
)
{
create
(
:group
,
parent:
group
)
}
let
!
(
:project1
)
{
create
(
:project_empty_repo
,
namespace:
group
)
}
let
!
(
:project2
)
{
create
(
:project_empty_repo
,
namespace:
child
)
}
let
_it_be
(
:group
)
{
create
(
:group
)
}
let
_it_be
(
:child
)
{
create
(
:group
,
parent:
group
)
}
let
_it_be
(
:project1
)
{
create
(
:project_empty_repo
,
namespace:
group
)
}
let
_it_be
(
:project2
)
{
create
(
:project_empty_repo
,
namespace:
child
)
}
it
{
expect
(
group
.
all_projects
.
to_a
).
to
match_array
([
project2
,
project1
])
}
it
{
expect
(
child
.
all_projects
.
to_a
).
to
match_array
([
project2
])
}
...
...
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