Skip to content
Snippets Groups Projects
Commit 584fc5c5 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
parents 676d558a 22aef3d4
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -37,7 +37,7 @@ class ProjectStatistics < ActiveRecord::Base
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
Loading
Loading
---
title: Fix a bug calculating artifact size for project statistics
merge_request: 16539
author:
type: fixed
Loading
Loading
@@ -146,6 +146,12 @@ describe ProjectStatistics do
 
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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment