Skip to content

Bypass push rules for merge to ref service

Oswaldo Ferreira requested to merge osw-bypass-push-rules-for-merge-to-ref into master

What does this MR do?

Turns out push rules to validate commit message does not apply in the context of automatic merge to refs/merge-requests/:iid/merge. Mainly because if it fails to merge to it, we currently can't give enough preemptive feedback to the user and it'll turn the merge request unmergeable (given we automatically mark it as unmergeable if we can't merge to the ref - it's attached to the MergeRequest#merge_status).

In general, it's a systematic operation, which already bypasses git hooks.

This was recognized through 500's at https://gitlab.com/gitlab-org/gitlab-ce/issues/64184. Which was trying to validate a nil commit message (through params[:commit_message]) when a push rule was set. Though, we already fallback to the default_commit_message if no commit_message param is given.

We currently disabled the feature flag of it to avoid further 500's (merge_ref_auto_sync).

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64184

Does this MR meet the acceptance criteria?

Conformity

Edited by Oswaldo Ferreira

Merge request reports