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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
22aef3d4
Commit
22aef3d4
authored
Jan 18, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bug calculating artifact size for project statistics
parent
7b0872c7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
app/models/project_statistics.rb
app/models/project_statistics.rb
+1
-1
changelogs/unreleased/42154-fix-artifact-size-calc.yml
changelogs/unreleased/42154-fix-artifact-size-calc.yml
+5
-0
spec/models/project_statistics_spec.rb
spec/models/project_statistics_spec.rb
+6
-0
No files found.
app/models/project_statistics.rb
View file @
22aef3d4
...
@@ -37,7 +37,7 @@ class ProjectStatistics < ActiveRecord::Base
...
@@ -37,7 +37,7 @@ class ProjectStatistics < ActiveRecord::Base
def
update_build_artifacts_size
def
update_build_artifacts_size
self
.
build_artifacts_size
=
self
.
build_artifacts_size
=
project
.
builds
.
sum
(
:artifacts_size
)
+
project
.
builds
.
sum
(
:artifacts_size
)
+
Ci
::
JobArtifact
.
artifacts_size_for
(
self
)
Ci
::
JobArtifact
.
artifacts_size_for
(
self
.
project
)
end
end
def
update_storage_size
def
update_storage_size
...
...
changelogs/unreleased/42154-fix-artifact-size-calc.yml
0 → 100644
View file @
22aef3d4
---
title
:
Fix a bug calculating artifact size for project statistics
merge_request
:
16539
author
:
type
:
fixed
spec/models/project_statistics_spec.rb
View file @
22aef3d4
...
@@ -146,6 +146,12 @@ describe ProjectStatistics do
...
@@ -146,6 +146,12 @@ describe ProjectStatistics do
expect
(
statistics
.
build_artifacts_size
).
to
be
(
106365
)
expect
(
statistics
.
build_artifacts_size
).
to
be
(
106365
)
end
end
it
'calculates related build artifacts by project'
do
expect
(
Ci
::
JobArtifact
).
to
receive
(
:artifacts_size_for
).
with
(
project
)
{
0
}
statistics
.
update_build_artifacts_size
end
end
end
context
'when legacy artifacts are used'
do
context
'when legacy artifacts are used'
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