• Luke Duncalfe's avatar
    Update ee specs to correctly select MR author · bcb756cf
    Luke Duncalfe authored
    When ce MR https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/26144
    was merged in, it caused failures in ee specs
    https://gitlab.com/gitlab-org/gitlab-ee/issues/10567.
    
    The fix for these specs is to select an "author" of the MR by first
    filtering merge commits from the commit collection. This mirrors the
    behaviour of MergeRequest#authors.
    
    Previously, this test passed as MergeRequest#commits would always return
    commits that lacked parent_ids, as they are initialized from data
    kept in MergeRequestDiffCommit which does not have parent_ids data. This
    meant that all MR commits were considered not to be merge commits, even
    though in gitaly some did have parent ids.
    
    However, now, CommitCollection#enrich! is called
    CommitCollection#without_merge_commits is called (as it is when
    MergeRequest#authors is called), so commit data is fetched from gitaly
    and now have parent_ids data. This cause the tests to fail, because the
    "author" being chosen from the merge request commits was in fact the
    user who had committed a merge commit.
    bcb756cf
approvable_for_rule_spec.rb 3.66 KB