API: Merge Request Accept fails with 405 in case no pipeline is given and merge_when_pipeline_succeeds is set to true

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

The current behavior of the Merge Request Accept API is that it yields a 405 METHOD NOT ALLOWED error in case the merge_when_pipeline_succeeds field is true, but the pipeline doesn't exist. I kinda understand why that may not be a valid request, however, I think it makes clients considerably easier to implement if the field is gracefully ignored in case the MR branch doesn't run a pipeline. IMHO, the current implementation isn't a measure of "protecting" against accidental merges, because that's what the project configured Pipeline must succeed flag is for.

Related: #353984

Edited by 🤖 GitLab Bot 🤖