Implement support of comparing diff versions

What does this MR do and why?

When comparing version to latest, we need to support finding a MergeRequestDiff by diff_id from params. We also need to support comparing versions (by diff_id and start_sha params).

To support that, we modify Gitlab::MergeRequests::DiffVersion to do that depending on the params set.

This is behind rapid_diffs_on_mr_show feature flag.

References

#466149 (closed)

How to set up and validate locally

  1. Select a diff version in MR page.
  2. Copy the URL of that page and append rapid_diffs=true param.
  3. Compare diffs and they should match.
  4. Compare 2 diff versions in MR page.
  5. Copy the URL of that page and append rapid_diffs=true param.
  6. Compare diffs and they should match.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #466149 (closed)

Edited by Patrick Bajao

Merge request reports

Loading