Read about our upcoming Code of Conduct on this issue

Commit c89f98c5 authored by Robert Speicher's avatar Robert Speicher
Browse files

Merge branch '42154-fix-artifact-size-calc' into 'master'

Resolve "Bug calculating artifacts size for project statistics"

Closes #42154

See merge request gitlab-org/gitlab-ce!16539
......@@ -37,7 +37,7 @@ def update_lfs_objects_size
def update_build_artifacts_size
self.build_artifacts_size =
project.builds.sum(:artifacts_size) +
Ci::JobArtifact.artifacts_size_for(self)
Ci::JobArtifact.artifacts_size_for(self.project)
end
def update_storage_size
......
---
title: Fix a bug calculating artifact size for project statistics
merge_request: 16539
author:
type: fixed
......@@ -146,6 +146,12 @@
expect(statistics.build_artifacts_size).to be(106365)
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
context 'when legacy artifacts are used' do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment