Refactor MergeRequest resource interface used in Rapid Diffs to be consistent
Background
In Rapid Diffs architecture, resources' models (Commit, Compare, MergeRequest) have an almost consistent interface. They respond to:
#diffs#first_diffs_slice#diffs_for_streaming#diffs_for_streaming_by_changed_paths
For MergeRequest though, we use #latest_diffs when fetching all diffs for a specific merge request. This is because we can't re-use and modify MergeRequest#diffs given its other use cases.
Proposal
Based on !221876 (comment 3075990995) from @slashmanov :
WDYT of creating a delegated VersionedMergeRequest that would have the extended
diffmethod and delegate the rest to merge request? We could use that as our primary resource in the presenter.
The following discussion from !221876 (merged) should be addressed:
-
@slashmanov started a discussion: (+2 comments)
@patrickbajao WDYT of creating a delegated VersionedMergeRequest that would have the extended
diffmethod and delegate the rest to merge request? We could use that as our primary resource in the presenter.