Skip to content

Draft: PoC for rebase-merged merge request diffs

Hordur Freyr Yngvason requested to merge poc-rebase-merged-mr-diff into master

What does this MR do and why?

PoC for rebase-merged merge request diffs

When MRs are rebase-merged, their commit history is rewritten and commits can no longer be found from the latest merge request diff.

In this PoC, I overwrote the merge head diff with the rebased commits, just to demonstrate its viability. It only works for merge trains because I don't know how to find the pre-merge target branch SHA for other types of merges.

In order to trigger the update that can then be found by the changelog, you need to run

MergeRequests::ReloadMergeHeadDiffService.new(mr).execute

The actual solution should probably create a new merge request diff type, e.g. merged, that is only present for merged MRs and contains the entire range of rebased commits.

See #436943

MR acceptance checklist

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

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Merge request reports