smarkets / marge-bot

A merge-bot for GitLab
BSD 3-Clause "New" or "Revised" License
701 stars 136 forks source link

Fetch pipelines by merge request instead of branch problem #227

Closed b1rdex closed 5 years ago

b1rdex commented 5 years ago

212 causes an error if ci is configured to run different tasks both on the branch and the merge request.

I have tests and all other things configured to be run on the branches because such tasks don't need a merge request to be run. Also, I have one task configured to be run on merge requests — it is used to toggle merge request settings (enable squash). So now Marge thinks that this simple task is my tests and merges even if actual tests are running and not finished yet.

Looks like that's because current_pipeline = next(iter(pipeline for pipeline in pipelines if pipeline.sha == commit_sha), None) line — Marge takes just one pipeline in accordance.

Could we please make this behavior switchable through the config file? I'd to revert to 0.8 release because of this problem.