Unable to approve a merge request after a rebase
From https://gitlab.slack.com/archives/CETG54GQ0/p1550206506061200, both @dbalexandre and I were surprised that due to https://gitlab.com/gitlab-org/gitlab-ee/commit/7503a526e2a766ba96f973d3a5a067b060592638, we are no longer allowed to approve a merge request if we ever push to the repository, even with a rebase. In https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9569/diffs, I just changed the commit message, but now I'm considered an author:
irb(main):002:0> mr = proj.merge_requests.find_by(iid: 25259)
=> #<MergeRequest id:24190098 gitlab-org/gitlab-ce!25259>
irb(main):003:0> mr.authors
=> #<ActiveRecord::Relation [#<User id:3386176 @pokstad1>, #<User id:64248 @stanhu>]>
It looks like this happens because GitLab tracks the author of each push and stores that in merge_request_diff_commits
, rather than look at the actual commits.
This is surprising behavior and a bit annoying for those who want to tidy up a merge request. I think it makes more sense to look at the actual authors in the commit.
/cc: @jramsay