Skip to content

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:

Screenshot_2018-07-17_Renamed___1____Merge_Requests___Administrator_test-project

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?

What are the relevant issue numbers?

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/49342

Edited by Oswaldo Ferreira

Merge request reports