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
c2409be8
Commit
c2409be8
authored
Jul 06, 2020
by
Francisco Javier López
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch..."
This reverts merge request !35835
parent
4d9ab71a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
26 deletions
+1
-26
app/models/project_statistics.rb
app/models/project_statistics.rb
+1
-6
spec/models/project_statistics_spec.rb
spec/models/project_statistics_spec.rb
+0
-20
No files found.
app/models/project_statistics.rb
View file @
c2409be8
...
...
@@ -14,7 +14,6 @@ class ProjectStatistics < ApplicationRecord
COLUMNS_TO_REFRESH
=
[
:repository_size
,
:wiki_size
,
:lfs_objects_size
,
:commit_count
,
:snippets_size
].
freeze
INCREMENTABLE_COLUMNS
=
{
build_artifacts_size:
%i[storage_size]
,
packages_size:
%i[storage_size]
}.
freeze
NAMESPACE_RELATABLE_COLUMNS
=
[
:repository_size
,
:wiki_size
,
:lfs_objects_size
].
freeze
FLAGGED_NAMESPACE_RELATABLE_COLUMNS
=
[
*
NAMESPACE_RELATABLE_COLUMNS
,
:snippets_size
].
freeze
scope
:for_project_ids
,
->
(
project_ids
)
{
where
(
project_id:
project_ids
)
}
...
...
@@ -32,7 +31,7 @@ class ProjectStatistics < ApplicationRecord
end
end
if
only
.
empty?
||
only
.
any?
{
|
column
|
namespace_relatable_columns
.
include?
(
column
)
}
if
only
.
empty?
||
only
.
any?
{
|
column
|
NAMESPACE_RELATABLE_COLUMNS
.
include?
(
column
)
}
schedule_namespace_aggregation_worker
end
...
...
@@ -111,10 +110,6 @@ class ProjectStatistics < ApplicationRecord
Namespaces
::
ScheduleAggregationWorker
.
perform_async
(
project
.
namespace_id
)
end
end
def
namespace_relatable_columns
Feature
.
enabled?
(
:namespace_snippets_size_stat
)
?
FLAGGED_NAMESPACE_RELATABLE_COLUMNS
:
NAMESPACE_RELATABLE_COLUMNS
end
end
ProjectStatistics
.
prepend_if_ee
(
'EE::ProjectStatistics'
)
spec/models/project_statistics_spec.rb
View file @
c2409be8
...
...
@@ -189,26 +189,6 @@ RSpec.describe ProjectStatistics do
statistics
.
refresh!
end
end
context
'when snippets_size is updated'
do
it
'schedules the aggregation worker'
do
expect
(
Namespaces
::
ScheduleAggregationWorker
)
.
to
receive
(
:perform_async
)
statistics
.
refresh!
(
only:
[
:snippets_size
])
end
context
'when feature flag :namespace_snippets_size_stat is disabled'
do
it
'does not schedules an aggregation worker'
do
stub_feature_flags
(
namespace_snippets_size_stat:
false
)
expect
(
Namespaces
::
ScheduleAggregationWorker
)
.
not_to
receive
(
:perform_async
)
statistics
.
refresh!
(
only:
[
:snippets_size
])
end
end
end
end
context
'when the column is not namespace relatable'
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