Resolve "Bug calculating artifacts size for project statistics"
What does this MR do?
Fixes a bug in the artifact size calculation logic for project statistics
Are there points in the code the reviewer needs to double check?
The tests are green when the bug is present because ci_artifacts.id == projects.id
. I discovered the bug while working on !16516 (merged), which happens to break this behaviour, causing the tests to fail.
I couldn't think of a natural way to exercise this failure in specs - setting the ids explicitly is artificial, as is creating a superfluous project or artifact to the same effect - so I suggest we just leave the specs untouched and rely on !16516 (merged) to prevent regressions in future.
I'm trying to keep genuine bugfixes in separate issues and MRs to that one, for better auditing.
Why was this MR needed?
Genuine bug. Needed to make https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16516 green, which is needed to make https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15681 green.
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Tests added for this feature/bug - Review
-
Has been reviewed by Backend
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered
What are the relevant issue numbers?
Closes #42154 (closed)