Render MR page when no persisted diff_refs or diffs size
What does this MR do?
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/49342 regression.
https://gitlab.com/gitlab-org/gitlab-ce/commit/f5ed18e1e3b5e69fa7bd650f3144fcfe26ac315f introduced this regression that happens when there is a MR without diff files (e.g. MergeRequestDiff#state
is without_files
), there's no persisted MergeRequestDiff#real_size
and there's not enough persisted data to use diff_refs
to compare diffs on the repository. In general, old MRs I suppose.
This MR makes it fallback to the persisted diffs collection, which will result in a nil
MergeRequestDiff#diff_size
, but won't raise a 500 error:
Are there points in the code the reviewer needs to double check?
I wonder if there's room to improve MergeRequest#diff_size
in a way that we don't need to go through FileCollection to fetch the diff size.
This needs to be picked into 11.1 since https://gitlab.com/gitlab-org/gitlab-ce/commit/f5ed18e1e3b5e69fa7bd650f3144fcfe26ac315f was already released (couldn't find a case on production yet though).
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Conforms to the code review guidelines
-
Has been reviewed by a Backend maintainer
-
-
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
If you have multiple commits, please combine them into a few logically organized commits by squashing them -
Internationalization required/considered -
End-to-end tests pass ( package-and-qa
manual pipeline job)