• Kerri Miller's avatar
    Add fallback option for overflowed MRDs · 4e7c8d10
    Kerri Miller authored
    When a MergeRequestDiff is "overflowed" (contains more than a certain
    number of files, 1,000 as of 12.10) #modified_paths will cut-off its
    results at the last file of the limit (IE the 1,000th file.) For the
    majority of MRs, this is fine, and we often have fallback code to use
    Repository#diff_stats to get at the expanded list (for example, in
    Gitlab::CodeOwners) This is less than ideal, as
    Repository#diff_stats is slow.. like, super slow. Like, you shouldn't
    use this unless you need to.
    
    Since it is so slow, we really should have a single, unified
    implementation of this fallback, and it should be here inside
    MergeRequest#modifed_paths. The consumer shouldn't have to special
    case their way around this limitation, and having it in 2 different
    locations as of this comment, we really shouldn't have multiple places
    calling their own implementations of code that is potentially very
    slow. By adding this fallback option, flagged to NOT run, we can then
    follow-on and remove our disparate and potentially divergent
    implementations, and provide a better option for future use.
    4e7c8d10
merge_request.rb 48.6 KB