• Yorick Peterse's avatar
    Ignore reverted commits when generating changelogs · a1de2ced
    Yorick Peterse authored
    When generating changelogs for a range of commits, any commits both
    added and reverted in that range are ignored. This works by looking for
    commits with the pattern "This reverts commit X", then ignoring the
    commits with the mentioned SHA.
    
    Because commits are retrieved in reverse order (= newest first), and
    revert commits always come after the commit they revert, we can keep
    processing commits in batches; instead of having to first load all of
    them in memory. This means the number of Gitaly calls remains the same.
    
    As part of these changes, CommitsWithTrailerFinder is renamed to
    ChangelogCommitsFinder, as its purpose is now more specific to the
    process of generating changelogs; instead of being a generic "give me
    commits with trailer X" finder.
    
    See https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/1583 for
    more information.
    a1de2ced
branches_controller_spec.rb 21.9 KB